﻿/* |==================================================================================|
|                           ESTILOS GLOBALES Y VARIABLES                           |
|==================================================================================| 
*/

/* ------------------------------------------- */
/* 1. DEFINICIÓN DE COLORES (Soporte Modo Claro/Oscuro) */
/* ------------------------------------------- */
:root {
    /* Colores Principales (Más Vibrantes) */
    --naranja: #ff7f00; /* Naranja más vivo */
    --celeste: #0077ff; /* Azul más intenso */
    
    /* Colores Claros (Para Hover/Fondo Secundario) */
    --naranja-claro: #ff9933;
    --celeste-claro: #3399ff;

    /* Esquema de Colores Base (Modo Claro) */
    --bg-light: #ffffff;
    --bg-secondary-light: #f0f4f8; /* Gris azulado muy suave para secciones */
    --text-dark: #1f2937; /* Gris oscuro profundo para texto principal */
    --border-color: #e5e7eb; /* Color de borde sutil */
    --shadow-color: rgba(0, 0, 0, 0.08); /* Sombra clara */
}

/* 🌙 Esquema de Colores Base (Modo Oscuro - AUTOMÁTICO) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #1f2937; /* Fondo oscuro principal */
        --bg-secondary-light: #374151; /* Fondo oscuro secundario */
        --text-dark: #f3f4f6; /* Texto claro */
        --border-color: #4b5563; /* Borde más oscuro */
        --shadow-color: rgba(0, 0, 0, 0.3); /* Sombra más fuerte */
        --naranja: #ff9933; /* Mantener la visibilidad del acento */
        --celeste: #60a5fa; /* Azul claro para acento */
    }
}

/* ------------------------------------------- */
/* 2. ESTILOS BASE Y FUENTES */
/* ------------------------------------------- */
html {
    /* Permite que el navegador decida el esquema de color (CRÍTICO para Modo Oscuro) */
    color-scheme: light dark; 
}

body {
    margin: 0;
    padding: 0;
    /* Fuente más moderna y legible */
    font-family: 'Poppins', 'Century Gothic', CenturyGothic, AppleGothic, sans-serif;
    color: var(--text-dark); 
    background-color: var(--bg-light); 
    /* Transición suave para el cambio de modo oscuro */
    transition: background-color 0.4s ease, color 0.4s ease; 
}

/* Clases de utilidad */
.text-naranja { color: var(--naranja) !important; }
.bg-naranja { background-color: var(--naranja) !important; }
.text-celeste { color: var(--celeste) !important; }
.bg-celeste { background-color: var(--celeste) !important; }
.text-naranja-claro { color: var(--naranja-claro) !important; }
.bg-naranja-claro { background-color: var(--naranja-claro) !important; }
.text-celeste-claro { color: var(--celeste-claro) !important; }
.bg-celeste-claro { background-color: var(--celeste-claro) !important; }
.bg-gray-lighter { background-color: var(--bg-secondary-light) !important; }

.bg-gradient-naranja-celeste {
    background: linear-gradient(135deg, var(--naranja), var(--celeste));
}

/* |==================================================================================|
|                          MODERNIDAD Y EFECTOS VISUALES                           |
|==================================================================================| 
*/

/* ------------------------------------------- */
/* 3. NAVEGACIÓN (Efecto Swipe Moderno) */
/* ------------------------------------------- */
.nav-link {
    position: relative;
    padding-bottom: 8px; /* Más espacio para el underline */
    color: var(--text-dark);
    transition: color 0.3s;
}

    .nav-link::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 2px;
        background-color: var(--celeste);
        /* Efecto de "swipe" elegante */
        transform: scaleX(0); 
        transform-origin: left;
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1); /* Curva más suave */
    }

    .nav-link:hover::after {
        transform: scaleX(1); 
        background-color: var(--naranja);
    }

    .nav-link:hover {
        color: var(--celeste-claro);
    }

/* ------------------------------------------- */
/* 4. TARJETAS (Efecto de Elevación Premium) */
/* ------------------------------------------- */
.tech-card {
    background-color: var(--bg-light);
    /* Curva de animación más moderna */
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s; 
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px var(--shadow-color); /* Sombra inicial sutil */
}

    .tech-card:hover {
        transform: translateY(-8px); /* Más elevación */
        box-shadow: 0 20px 40px var(--celeste-claro), 0 0 0 2px var(--celeste-claro); /* Sombra de acento azul con borde suave */
    }

/* ------------------------------------------- */
/* 5. BOTONES (Efecto de Relieve y Pulsación) */
/* ------------------------------------------- */
.btn-naranja {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 4px 10px rgba(255, 127, 0, 0.3);
    border-radius: 0.5rem;
}

    .btn-naranja:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 20px rgba(255, 127, 0, 0.5);
        background-color: var(--naranja-claro);
    }

    .btn-naranja:active {
        transform: translateY(0px); /* Efecto de "presionar" */
        box-shadow: 0 2px 5px rgba(255, 127, 0, 0.4);
    }

/* ------------------------------------------- */
/* 6. ANIMACIÓN DE ENTRADA */
/* ------------------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out both;
}

/* ------------------------------------------- */
/* 7. SOLUCIÓN CRÍTICA: LOGO Y MODO OSCURO */
/* ------------------------------------------- */
.logo {
    width: 150px;
    height: auto;
    transition: filter 0.4s ease;
}

/* Aplicar filtro de inversión solo cuando el sistema está en modo oscuro para logos oscuros */
@media (prefers-color-scheme: dark) {
    .logo {
        /* Convierte un logo negro/oscuro a blanco/claro para el fondo oscuro */
        filter: invert(100%) hue-rotate(180deg) brightness(1.2) contrast(1.1); 
    }
}

/* Solución original para el logo del footer (asumiendo que está sobre un fondo oscuro fijo) */
.footer-logo {
    filter: brightness(0) invert(1); 
}

/* |==================================================================================|
|                                ROLLER DE LOGOS                                   |
|==================================================================================| 
*/

/* Contenedor que recorta los bordes y asegura que el roller se vea */
.logo-roller-container {
    overflow: hidden; 
    padding: 30px 0; /* Más espacio */
    margin-top: 40px;
    background-color: var(--bg-secondary-light); /* Fondo suave */
    box-shadow: 0 2px 10px var(--shadow-color);
}

/* Contenedor que contendrá la animación */
.logo-roller {
    display: flex;
    /* Velocidad ajustada para un look más profesional */
    animation: scroll 35s linear infinite; 
    width: 200%; 
}

/* Estilo para cada grupo de logos (el original y la copia) */
.logo-slide {
    display: flex;
    justify-content: flex-start; 
    width: 100%; 
    align-items: center;
}

    /* Estilo para cada logo individual (el enlace) */
    .logo-slide a {
        flex-shrink: 0; 
        margin: 0 45px; /* Más espacio entre logos */
        display: flex;
        align-items: center;
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    }

        .logo-slide a:hover {
            transform: scale(1.15); /* Efecto de zoom más pronunciado */
        }

    /* Estilo de la imagen del logo */
    .logo-slide img {
        max-width: 140px; /* Un poco más grandes */
        max-height: 90px;
        width: auto;
        height: auto;
        /* Opacidad y escala de grises inicial para menos distracción */
        filter: grayscale(100%) opacity(0.5); 
        transition: filter 0.5s ease;
    }

    .logo-slide a:hover img {
        filter: grayscale(0%) opacity(1); /* Totalmente a color y opaco al hacer hover */
    }

/* Define la animación de desplazamiento */
@keyframes scroll {
    from {
        transform: translateX(0);
    }
    /* Mueve exactamente el 50% para un loop sin saltos */
    to {
        transform: translateX(-50%);
    }
}

/* |==================================================================================|
|                          FLUJOGRAMA (Flechas Estilizadas)                        |
|==================================================================================| 
*/

.flow-step-bg {
    background-color: var(--bg-secondary-light); /* Fondo dinámico */
}

.flow-title {
    font-weight: 700;
    font-size: 1.35rem; /* Título un poco más grande */
    line-height: 1.4;
    color: var(--text-dark);
    transition: color 0.3s;
}

/* Animación y forma de galón (flecha) */
.flow-step {
    position: relative;
    padding: 1.5rem 1.5rem;
    margin-right: 1.5rem;
    /* Flecha ligeramente más pronunciada */
    clip-path: polygon(0 0, calc(100% - 25px) 0, 100% 50%, calc(100% - 25px) 100%, 0 100%, 25px 50%);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 4px 15px var(--shadow-color);
    border-radius: 8px;
    border: 2px solid var(--border-color); /* Borde dinámico */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 180px;
    flex-grow: 1;
    background-color: var(--bg-light); 
}

    .flow-step:hover {
        box-shadow: 0 10px 25px rgba(0, 119, 255, 0.3);
        border-color: var(--celeste);
        transform: translateY(-5px); /* Movimiento de elevación notorio */
    }

    .flow-step:first-child {
        clip-path: polygon(0 0, calc(100% - 25px) 0, 100% 50%, calc(100% - 25px) 100%, 0 100%);
        padding-left: 1rem;
        min-width: 160px;
    }

    .flow-step:last-child {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 25px 50%);
        margin-right: 0;
        padding-right: 1rem;
    }

/* Media Query para móvil (apilamiento vertical mejorado) */
@media (max-width: 768px) {
    .flow-step {
        clip-path: none;
        border-radius: 0.75rem;
        padding: 1rem;
        text-align: left;
        align-items: flex-start;
        margin-right: 0;
        margin-bottom: 1.5rem; /* Más espacio vertical */
        min-width: unset;
        width: 100%;
    }

        .flow-step:first-child, .flow-step:last-child {
            clip-path: none;
            padding-left: 1rem;
            padding-right: 1rem;
        }
}

/* |==================================================================================|
|                          COMPLEMENTOS Y ACCESIBILIDAD                            |
|==================================================================================| 
*/

/* ------------------------------------------- */
/* MENU DESPLEGABLE (Dropdown) */
/* ------------------------------------------- */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-light);
    min-width: 220px;
    box-shadow: 0px 8px 20px 0px var(--shadow-color);
    z-index: 20;
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    border-top: 3px solid var(--celeste); /* Borde más visible */
    animation: slideDown 0.3s ease-out;
}

    .dropdown-content a {
        color: var(--text-dark);
        padding: 12px 16px;
        text-decoration: none;
        display: block;
        transition: background-color 0.2s, color 0.2s;
    }

        .dropdown-content a:hover {
            background-color: var(--celeste-claro);
            color: white;
        }

.dropdown:hover .dropdown-content {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ------------------------------------------- */
/* BOTÓN DE WHATSAPP (Ajuste Móvil) */
/* ------------------------------------------- */
.whatsapp-btn-mobile-fix {
    display: inline-block;
    max-width: 300px; 
}


/* ------------------------------------------- */
/* BOTÓN VOLVER ARRIBA */
/* ------------------------------------------- */
#btnVolverArriba {
    position: fixed;
    bottom: 30px; 
    right: 30px; 
    z-index: 99; 
    display: none; 
    width: 48px; /* Tamaño más grande */
    height: 48px;
    border: none;
    outline: none;
    background-color: var(--celeste); 
    color: white; 
    cursor: pointer;
    padding: 0;
    border-radius: 50%; 
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0, 119, 255, 0.5);
    transition: background-color 0.3s, transform 0.3s;
}

    #btnVolverArriba:hover {
        background-color: var(--celeste-claro);
        transform: translateY(-2px);
    }


/* ------------------------------------------- */
/* WIDGET DE ACCESIBILIDAD */
/* ------------------------------------------- */

#btnAbrirAccesibilidad {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    font-size: 20px;
    border: none;
    border-radius: 50%;
    background-color: var(--celeste);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}
    #btnAbrirAccesibilidad:hover {
        transform: scale(1.1);
    }

#widgetAccesibilidad {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 20px;
    z-index: 999;
    width: 320px;
    padding: 15px;
    /* Usar variables para adaptabilidad */
    background-color: var(--bg-secondary-light) !important;
    color: var(--text-dark) !important;
    opacity: 1 !important;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

    #widgetAccesibilidad h3 {
        margin-top: 0;
        font-size: 16px;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 5px;
        margin-bottom: 10px;
    }

    #widgetAccesibilidad .opciones-contenedor {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 10px;
    }

    #widgetAccesibilidad button {
        width: auto;
        flex-grow: 1;
        padding: 8px 10px;
        margin-bottom: 0;
        border: 1px solid var(--border-color);
        background-color: var(--bg-light);
        color: var(--text-dark);
        cursor: pointer;
        border-radius: 4px;
        font-size: 14px;
        transition: background-color 0.2s, color 0.2s;
    }

        /* Botón Restablecer (usando --naranja) */
        #widgetAccesibilidad button.btn-reset {
            background-color: var(--naranja) !important;
            color: white !important;
            border: none;
            margin-top: 10px;
        }

        /* Estilo para Opción Activa (usando --celeste) */
        #widgetAccesibilidad button.opcion-activa {
            background-color: var(--celeste) !important;
            color: white !important;
            border-color: var(--celeste) !important;
            font-weight: bold;
        }

/* ------------------------------------------- */
/* CLASES DE ACCESIBILIDAD (Aplicadas al #content-wrapper) */
/* ------------------------------------------- */

/* 1. ALTO CONTRASTE */
#content-wrapper.alto-contraste {
    background-color: black !important;
    color: white !important;
}

    #content-wrapper.alto-contraste *, #content-wrapper.alto-contraste *:before, #content-wrapper.alto-contraste *:after {
        background-color: black !important;
        color: white !important;
        border-color: white !important;
        box-shadow: none !important;
    }

    #content-wrapper.alto-contraste a, #content-wrapper.alto-contraste button, #content-wrapper.alto-contraste input {
        color: yellow !important;
        border-color: yellow !important;
    }

    /* Imágenes en Alto Contraste */
    #content-wrapper.alto-contraste img:not(.logo-imagen),
    #content-wrapper.alto-contraste svg:not(.logo-imagen) {
        filter: grayscale(100%) brightness(120%) contrast(150%) !important;
    }

    #content-wrapper.alto-contraste img.logo-imagen {
        filter: invert(100%) grayscale(100%) !important;
    }


/* 2. INVERSIÓN TOTAL DE COLORES */
#content-wrapper.invertir-colores {
    filter: invert(100%) hue-rotate(180deg);
}

    #content-wrapper.invertir-colores img,
    #content-wrapper.invertir-colores video,
    #content-wrapper.invertir-colores svg {
        filter: invert(100%) hue-rotate(180deg) !important;
    }

/* Cancelación del filtro en el widget flotante */
body.invertir-colores #widgetAccesibilidad,
body.invertir-colores #btnAbrirAccesibilidad {
    filter: invert(100%) hue-rotate(180deg) !important;
    transform: none !important;
}

/* 3. AUMENTO DE TEXTO */
#content-wrapper.texto-grande {
    font-size: 1.25em !important;
    line-height: 1.6 !important;
}

/* 4. FUENTE PARA DISLEXIA */
#content-wrapper.fuente-dislexia {
    font-family: 'OpenDyslexic', sans-serif !important;
    line-height: 1.8 !important;
}

/* 5. RESALTAR ENLACES */
#content-wrapper.resaltar-enlaces a {
    background-color: yellow !important;
    color: black !important;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold !important;
}

/* 6. FILTRO PARA DALTONISMO (NUEVO) */
#content-wrapper.filtro-daltonismo {
    filter: sepia(0.5) saturate(0.8) hue-rotate(10deg);
}

    #content-wrapper.filtro-daltonismo img,
    #content-wrapper.filtro-daltonismo video,
    #content-wrapper.filtro-daltonismo svg {
        filter: sepia(0.5) saturate(0.8) hue-rotate(10deg) !important;
    }