/**
 * L2Config Enterprise CSS Framework
 * Modular, maintainable, and performance-optimized styles
 */

:root { 
    /* Color Palette */
    --gold: #D4AF37; 
    --gold-glow: rgba(212, 175, 55, 0.3);
    --dark: #050506; 
    --card-bg: rgba(15, 15, 18, 0.6);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    /* Spacing System */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    
    /* Animation Curves */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body { 
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--dark); 
    color: var(--text-secondary);
    line-height: 1.6;
    overflow-x: hidden;
    font-feature-settings: 'kern' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip to main content for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--gold);
    color: black;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    font-weight: 600;
}

.skip-link:focus {
    top: 6px;
}

/* Background gradient mesh */
.bg-gradient-mesh {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    z-index: -1;
    background: 
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.03) 0%, transparent 40%);
    will-change: transform;
}

/* Typography */
.title-serif { 
    font-family: 'Playfair Display', Georgia, serif; 
    font-display: swap;
}

.text-gradient-gold {
    background: linear-gradient(135deg, #fff 0%, #D4AF37 50%, #856a1d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation */
.glass-nav {
    background: rgba(5, 5, 6, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s var(--ease-out);
}

.glass-nav:hover {
    background: rgba(5, 5, 6, 0.95);
}

/* Marquee Animation - Performance Optimized */
.marquee-mask {
    mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    overflow: hidden;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.marquee-container { 
    display: flex; 
    width: max-content; 
    gap: 2.5rem; 
    animation: marquee 40s linear infinite;
    will-change: transform;
}

.pause-on-hover:hover .marquee-container { 
    animation-play-state: paused; 
}

/* Gallery Components */
.gallery-content {
    max-height: 0; 
    opacity: 0; 
    overflow: hidden;
    transition: 
        max-height 1s var(--ease-out), 
        opacity 0.8s ease;
}

.gallery-content.open { 
    max-height: 2000px; 
    opacity: 1; 
    margin-top: var(--spacing-xl); 
}

/* Interactive Buttons */
.btn-expander { 
    position: relative;
    transition: all 0.5s var(--ease-out);
    border: 1px solid rgba(255,255,255,0.03); 
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    cursor: pointer;
    outline: none;
    /* Focus styles for accessibility */
    focus-visible: outline 2px solid var(--gold);
}

.btn-expander:hover { 
    border-color: rgba(212, 175, 55, 0.3); 
    background: rgba(212, 175, 55, 0.02);
    transform: translateY(-2px);
}

.btn-expander:active {
    transform: translateY(0);
}

/* Active states */
.active .icon-gold { 
    background: var(--gold) !important; 
    color: black !important; 
    box-shadow: 0 0 40px var(--gold-glow); 
    transform: scale(1.1);
}

.active .icon-silver { 
    background: white !important; 
    color: black !important; 
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.2); 
    transform: scale(1.1);
}

.active.btn-expander { 
    border-color: rgba(212, 175, 55, 0.5); 
    background: rgba(212, 175, 55, 0.05); 
}

/* Asset Cards */
.asset-card {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 32px;
    overflow: hidden;
    transition: all 0.6s var(--ease-out);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    cursor: pointer;
}

.asset-card::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    background: linear-gradient(135deg, transparent, var(--gold), transparent);
    border-radius: inherit;
    mask: linear-gradient(black, black) content-box, linear-gradient(black, black);
    mask-composite: exclude;
    -webkit-mask-composite: source-out;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.asset-card:hover::before {
    opacity: 0.6;
}

.asset-card:hover { 
    border-color: var(--gold); 
    transform: translateY(-12px) scale(1.02);
    box-shadow: 
        0 30px 60px -12px rgba(0,0,0,0.8),
        0 0 40px rgba(212, 175, 55, 0.1);
}

.img-zoomable { 
    cursor: zoom-in; 
    width: 100%; 
    height: 300px; 
    object-fit: cover; 
    opacity: 0.7; 
    transition: all 0.8s var(--ease-out);
    filter: grayscale(30%);
    /* Loading state */
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: loading 2s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.img-zoomable.loaded {
    animation: none;
    background: none;
}

.asset-card:hover .img-zoomable { 
    opacity: 1; 
    filter: grayscale(0%); 
    transform: scale(1.05); 
}

/* Rotation Animation */
.rotate-icon { 
    transition: transform 0.6s var(--ease-out); 
}

.active .rotate-icon { 
    transform: rotate(180deg); 
}

/* Lightbox */
#lightbox {
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.95);
    z-index: 1000; 
    justify-content: center; 
    align-items: center; 
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    animation: slideIn 0.3s var(--ease-out);
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: scale(0.8) translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

/* License Cards */
.license-card {
    background: rgba(15, 15, 18, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.5s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.license-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transition: left 0.6s ease;
}

.license-card:hover::after {
    left: 100%;
}

.license-card:hover {
    transform: translateY(-10px);
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.02);
    box-shadow: var(--shadow-xl);
}

.license-card.premium {
    border-color: rgba(212, 175, 55, 0.3);
    background: radial-gradient(circle at top right, rgba(212, 175, 55, 0.08), transparent);
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .marquee-container {
        animation: none;
    }
    
    .asset-card,
    .btn-expander,
    .license-card {
        transition: none;
    }
    
    .img-zoomable {
        transition: none;
    }
}

/* Focus indicators */
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-secondary: #ffffff;
        --card-bg: rgba(0, 0, 0, 0.9);
    }
    
    .asset-card {
        border-color: rgba(255, 255, 255, 0.3);
    }
}

/* Loading states */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-top: 2px solid var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hero Section Styles */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.hero-background {
    /* Removido border-radius para ir de borde a borde */
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
}

.hero-section img[alt="Lineage2Config Logo"] {
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
}

.hero-section img[alt="Lineage2Config Logo"]:hover {
    transform: scale(1.02);
}

.hero-section h1 {
    text-shadow: 
        0 0 30px rgba(212, 175, 55, 0.5),
        2px 2px 10px rgba(0, 0, 0, 0.8);
}

.hero-section p {
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* FAQ Styles */
.faq-item {
    transition: all 0.3s var(--ease-out);
}

.faq-item:hover {
    border-color: rgba(212, 175, 55, 0.3);
    background: rgba(212, 175, 55, 0.02);
}

.faq-question {
    transition: all 0.3s var(--ease-out);
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.faq-question[aria-expanded="true"] .faq-question-content {
    color: var(--gold);
}

.faq-answer {
    transition: max-height 0.5s var(--ease-out), opacity 0.3s ease;
}

.faq-question[aria-expanded="true"] + .faq-answer {
    opacity: 1;
}

/* Services Section Styles */
.services-section {
    position: relative;
}

.services-section .service-card {
    transition: all 0.5s var(--ease-out);
}

.services-section .service-card:hover {
    transform: translateY(-5px);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments for hero */
@media (max-width: 768px) {
    .hero-section {
        min-height: 80vh;
        padding: 1rem 0;
    }
    
    .hero-section img[alt="Lineage2Config Logo"] {
        max-width: 120px; /* 40% más pequeño en móviles también */
    }
    
    .hero-section h1 {
        font-size: 3rem;
    }
    
    .hero-section p {
        font-size: 1rem;
        padding: 1.5rem;
    }
    
    .faq-question {
        padding: 1rem;
    }
    
    .faq-answer {
        padding: 0 1rem 1rem;
    }
}

/* Print styles */
@media print {
    .bg-gradient-mesh,
    .glass-nav,
    #lightbox {
        display: none !important;
    }
    
    .asset-card {
        break-inside: avoid;
    }
}