/* ============================================================
   RESET Y CONFIGURACIÓN BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =========================================
   VARIABLES DE TEMA (MODO CLARO / OSCURO)
   ========================================= */
:root {
    --header-height: 80px;
    --gold: #d4af37;
    
    /* --- MODO OSCURO (Por defecto) --- */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-card: rgba(20, 20, 20, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-nav: #252525;
    
    --text-title: #ffffff;
    --text-main: #e0e0e0;
    --text-secondary: #d0d0d0;
    --text-muted: #a0a0a0;
    --text-nav: #cccccc;
    
    --border-color: rgba(212, 175, 55, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.5);
    
    /* Filtro para iconos */
    --icon-filter: brightness(0) invert(1);
    --partner-filter: brightness(0) invert(1);
}

/* --- MODO CLARO (Activado por data-theme="light") --- */
[data-theme="light"] {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(0, 0, 0, 0.03);
    --bg-nav: #f8f8f8;
    
    --text-title: #1a1a1a;
    --text-main: #333333;
    --text-secondary: #555555;
    --text-muted: #666666;
    --text-nav: #333333;
    
    --border-color: rgba(212, 175, 55, 0.4);
    --shadow-color: rgba(0, 0, 0, 0.15);
    
    --icon-filter: none;
    --partner-filter: grayscale(100%) opacity(0.8);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    padding-top: var(--header-height);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================================
   HEADER Y NAVEGACIÓN
   ============================================================ */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    background-color: var(--bg-secondary);
    box-shadow: 0 2px 10px var(--shadow-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 1000;
    transition: background-color 0.3s ease;
}

header h1 {
    color: var(--text-title);
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
}

header h1:hover {
    color: var(--gold);
}

/* --- MENÚ DESPLEGABLE --- */
nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 250px;
    background-color: var(--bg-nav);
    box-shadow: 0 8px 16px var(--shadow-color);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.menu-oculto {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
}

.menu-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

nav ul {
    list-style: none;
    padding: 1rem 0;
}

nav ul li {
    padding: 0;
}

nav ul li a {
    display: block;
    color: var(--text-nav);
    text-decoration: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

nav ul li a:hover {
    background-color: var(--bg-secondary);
    color: var(--text-title);
    border-left: 3px solid var(--gold);
    padding-left: 2rem;
}

/* --- ÍTEM DEL MENÚ PARA TOGGLE THEME --- */
.menu-item-theme {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-left: 3px solid transparent;
    color: var(--text-nav);
    transition: all 0.3s ease;
}

.theme-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-nav);
    cursor: default;
}

.menu-item-theme:hover {
    background-color: var(--bg-secondary);
}

/* --- REDES SOCIALES --- */
.redes-sociales {
    display: flex;
    gap: 1.5rem;
}

.redes-sociales a {
    color: var(--text-nav);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.redes-sociales a:hover {
    color: var(--gold);
    transform: translateY(-3px);
}

/* =========================================
   SWITCH THEME TOGGLE (BOTÓN)
   ========================================= */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: 0.4s;
    border-radius: 34px;
    border: 1px solid #555;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

/* El círculo que se mueve */
.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: var(--gold);
    transition: 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* Iconos dentro del switch */
.moon-icon {
    color: #f1c40f;
    font-size: 14px;
    transition: 0.3s;
    z-index: 1;
}

.sun-icon {
    color: #f39c12;
    font-size: 14px;
    transition: 0.3s;
    z-index: 1;
}

/* ESTADO ACTIVADO (MODO CLARO) */
input:checked + .slider {
    background-color: #e0e0e0;
    border-color: #ccc;
}

input:checked + .slider:before {
    transform: translateX(30px);
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   MAIN Y FONDOS
   ============================================================ */
main {
    position: relative;
    min-height: calc(100vh - var(--header-height));
    padding-top: 1rem;
    overflow: hidden;
}

#matrix-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: var(--bg-primary);
    z-index: -1;
    transition: background-color 0.3s ease;
}

/* ============================================================
   SECCIÓN LOGO PRINCIPAL
   ============================================================ */
.logo-section {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 3rem 1rem;
    min-height: auto;
}

.main-logo {
    width: 40vw;
    max-width: 400px;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    transition: transform 0.25s ease;
}

.main-logo:hover {
    transform: scale(1.05);
}

.brand-tagline {
    font-family: 'Segoe UI', sans-serif;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 5px;
    margin-top: 2rem;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 1.5s ease forwards;
    animation-delay: 0.5s;
}

.brand-tagline .separator {
    color: var(--gold);
    font-weight: bold;
    margin: 0 15px;
    font-size: 1.2rem;
    vertical-align: middle;
}

/* ============================================================
   SECCIÓN SERVICIOS
   ============================================================ */
.services-section {
    position: relative;
    z-index: 2;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.services-section h2 {
    color: var(--text-title);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    text-align: center;
}

.services-container {
    max-width: 1200px;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 3rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px var(--shadow-color);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem 2rem;
    transition: all 0.3s ease;
}

.service-card {
    display: grid;
    padding: 1rem 1rem;
    grid-template-columns: 60px 1fr;
    grid-template-rows: min-content auto;
    column-gap: 1.7rem;
    align-items: start;
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-icon {
    grid-row: 1 / span 2;
    grid-column: 1;
    width: 100%;
    height: auto;
    object-fit: contain;
    align-self: start;
    margin-top: 5px;
    filter: var(--icon-filter);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    filter: invert(1) drop-shadow(0 0 5px var(--gold));
    transform: scale(1.1);
    opacity: 1;
}

/* Corrección para modo claro */
[data-theme="light"] .service-card:hover .service-icon {
    filter: drop-shadow(0 0 5px var(--gold));
}

.service-card h3 {
    grid-column: 2;
    grid-row: 1;
    color: var(--text-title);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.service-card:hover h3 {
    color: var(--gold);
}

.service-card p {
    grid-column: 2;
    grid-row: 2;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: justify;
    hyphens: auto;
}

/* ============================================================
   MODAL (VENTANA EMERGENTE)
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--gold);
    width: 90%;
    max-width: 600px;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.open .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--gold);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.modal-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.modal-header h3 {
    color: var(--gold);
    font-size: 1.8rem;
    text-transform: uppercase;
}

.modal-body p {
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 1rem;
    text-align: justify;
}

.modal-extra-info {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #00ff00;
    background: #000;
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
}

.modal-cta {
    background-color: var(--gold);
    color: #1a1a1a;
    border: none;
    padding: 0.8rem 2rem;
    font-weight: bold;
    margin-top: 1.5rem;
    cursor: pointer;
    width: 100%;
    border-radius: 5px;
    transition: background 0.3s;
}

.modal-cta:hover {
    background-color: #fff;
}

/* ============================================================
   SECCIÓN PARTNERS (INFINITE LOOP)
   ============================================================ */
.partners-section {
    padding: 4rem 1.5rem;
    position: relative;
    z-index: 2;
    text-align: center;
    overflow: hidden;
}

.partners-section h2 {
    color: var(--text-title);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    text-align: center;
}

.slider-window {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
}

.slide-track {
    display: flex;
    width: calc(220px * 22);
    animation: scroll 35s linear infinite;
}

.slide-track:hover {
    animation-play-state: paused;
}

.partner-card {
    width: 180px;
    height: 100px;
    margin: 0 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: all 0.3s ease;
}

.partner-logo {
    max-width: 80%;
    max-height: 80%;
    filter: var(--partner-filter);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.partner-card:hover {
    background: var(--bg-secondary);
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    transform: scale(1.05);
}

.partner-card:hover .partner-logo {
    filter: none;
    opacity: 1;
}

/* ============================================================
   SECCIÓN SOBRE NOSOTROS (ABOUT)
   ============================================================ */
.about-section {
    padding: 4rem 1.5rem;
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
}

.about-section h2 {
    text-align: center;
    color: var(--text-title);
    font-size: 2.2rem;
    margin-bottom: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.about-container {
    max-width: 900px;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 3rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all 0.3s ease;
}

.about-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    text-align: justify;
}

.intro-text {
    font-size: 1.2rem !important;
    font-weight: 300;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem !important;
    text-align: center !important;
}

.highlight, strong {
    color: var(--gold);
    font-weight: 600;
}

.award-box {
    margin-top: 2rem;
    background: linear-gradient(45deg, rgba(212, 175, 55, 0.1), transparent);
    border-left: 4px solid var(--gold);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-radius: 0 10px 10px 0;
}

.award-box p {
    margin-bottom: 0;
    font-weight: 500;
    color: var(--text-title);
    text-align: left;
}

.award-icon {
    font-size: 2rem;
    color: var(--gold);
}

/* ============================================================
   SECCIÓN CONTACTO
   ============================================================ */
.contact-section {
    position: relative;
    padding: 5rem 1.5rem 2rem;
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    z-index: 2;
    text-align: center;
    transition: background-color 0.3s ease;
}

.contact-container {
    max-width: 1000px;
    margin: 0 auto;
}

.contact-section h2 {
    color: var(--text-title);
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.contact-intro {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 4rem;
    line-height: 1.6;
}

.intro-link {
    color: var(--gold);
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
}

.intro-link:hover {
    color: var(--text-title);
    border-bottom-color: var(--text-title);
}

.contact-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 5rem;
}

.contact-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    border-radius: 15px;
    transition: transform 0.3s ease, background 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-card:hover {
    transform: translateY(-5px);
    background: var(--bg-card);
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

.icon-circle {
    width: 60px;
    height: 60px;
    background-color: rgba(212, 175, 55, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--gold);
    transition: all 0.3s ease;
}

.contact-card:hover .icon-circle {
    background-color: var(--gold);
    color: #000;
    transform: scale(1.1);
}

.contact-card h3 {
    color: var(--text-title);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.contact-card p, .contact-card a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.contact-card a:hover {
    color: var(--gold);
}

/* --- BARRA DE COPYRIGHT FINAL --- */
.copyright-bar {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    margin-top: 4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.copyright-bar .highlight {
    color: var(--gold);
    font-weight: 600;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.copyright-bar .highlight:hover {
    opacity: 1;
}

/* ============================================================
   ANIMACIONES
   ============================================================ */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInTag {
    to {
        opacity: 1;
    }
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-220px * 11));
    }
}

/* ============================================================
   RESPONSIVE - TABLETS (max-width: 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .services-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 2rem;
        gap: 2rem;
    }
}

/* ============================================================
   RESPONSIVE - MÓVILES (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {
    /* Header */
    header {
        padding: 1rem;
    }

    nav {
        width: 100%;
    }

    /* Logo */
    .main-logo {
        width: 60vw;
        max-width: 320px;
    }

    .brand-tagline {
        font-size: 0.7rem;
        letter-spacing: 2px;
        margin-top: 1.5rem;
        width: 90%;
        line-height: 1.6;
    }

    /* Servicios */
    .services-container {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .service-card {
        margin-bottom: 1rem;
    }

    /* Partners */
    .partners-grid {
        gap: 1rem;
    }

    .partner-chip {
        width: 130px;
        height: 80px;
    }

    /* About */
    .about-container {
        padding: 1.5rem;
    }

    .intro-text {
        font-size: 1.1rem !important;
        text-align: justify !important;
    }

    .award-box {
        flex-direction: column;
        text-align: center;
    }

    .award-box p {
        text-align: center;
    }

    /* Contacto */
    .contact-details {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-section {
        padding-top: 3rem;
    }

    .copyright-bar {
        margin-bottom: 1rem;
    }
}