
/* ============================================
   STYLES.CSS RESPONSIVE - IAcombinada
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    width: 100%;
    overflow-x: hidden; /* Evitar scroll horizontal */
    background: rgba(0, 0, 0, 0.85);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #fff;
}

/* Imágenes responsive por defecto */
img {
    max-width: 100%;
    height: auto;
    display: block;
}
/* --- TEXTOS JUSTIFICADOS - SOLO PARA CONTENIDO LARGO --- */
/* Justificar solo párrafos sueltos fuera de cards/boxes */
section > .container > p:not([class]),
article p:not([class]),
body li, 
body td, 
body th {
    text-align: justify !important;
    text-justify: inter-word;
}



/* --- CURSOR PERSONALIZADO (Solo Desktop) --- */
.custom-cursor {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 2px solid #FBBF24;
    background-color: rgba(251, 191, 36, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease-out, width 0.2s ease-out, height 0.2s ease-out, background-color 0.2s ease-out;
    opacity: 0;
}

.custom-cursor.visible { 
    opacity: 1; 
}

.custom-cursor.hover-interactive {
    width: 60px;
    height: 60px;
    background-color: rgba(251, 191, 36, 0.4);
}

/* Ocultar cursor personalizado en móviles y tablets */
@media (pointer: coarse), (max-width: 1024px) {
    .custom-cursor { 
        display: none !important; 
    }
}

/* --- ANIMACIONES DE SCROLL --- */
[data-animation] {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

[data-animation="fade-up"] { 
    transform: translateY(50px); 
}

[data-animation="fade-down"] { 
    transform: translateY(-50px); 
}

[data-animation="fade-left"] { 
    transform: translateX(50px); 
}

[data-animation="fade-right"] { 
    transform: translateX(-50px); 
}

[data-animation].is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

/* --- LOADER Y MATRIX --- */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease;
    overflow: hidden;
}

#loading-screen.hide {
    opacity: 0;
    pointer-events: none;
}

#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100%;
    z-index: 1;
    pointer-events: none;
}

#loader-logo {
    position: absolute;
    width: 150px;
    height: auto;
    opacity: 0;
    z-index: 10001;
    animation: logoAppearProgressive 3s ease 0.5s forwards;
    filter: drop-shadow(0 0 20px #FBBF24);
}

/* Logo más pequeño en móvil */
@media (max-width: 768px) {
    #loader-logo {
        width: 100px;
    }
}

@keyframes logoAppearProgressive {
    0% {
        opacity: 0;
        filter: blur(10px) drop-shadow(0 0 20px #FBBF24);
        transform: scale(0);
    }
    70% {
        opacity: 0.95;
        filter: blur(5px) drop-shadow(0 0 20px #FBBF24);
        transform: scale(0.7);
    }
    100% {
        opacity: 1;
        filter: blur(0px) drop-shadow(0 0 20px #FBBF24);
        transform: scale(1);
    }
}

#matrix-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0;
    transition: opacity 1s ease;
}

#matrix-background.active {
    opacity: 0.35;
}

/* Ocultar contenido durante loader */
body.has-loader:not(.loaded) > header,
body.has-loader:not(.loaded) > main,
body.has-loader:not(.loaded) > footer {
    opacity: 0;
    transform: translateY(10px);
}

header, main, footer {
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* --- UTILIDADES GLOBALES --- */
.shadow-text {
    text-shadow: 0 4px 10px rgba(251, 191, 36, 0.3);
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin-slow { 
    animation: spin-slow 20s linear infinite; 
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.animate-marquee { 
    animation: marquee 40s linear infinite; 
}

/* --- CONTENEDORES RESPONSIVE --- */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* --- RESPONSIVE UTILITIES --- */

/* Móvil (hasta 640px) */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.75rem !important;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.5rem !important;
    }
    
    section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Botones más grandes en móvil para facilitar el toque */
    button, .button, a.button {
        min-height: 48px;
        padding: 0.875rem 1.5rem !important;
    }
    
    /* Forms más fáciles de usar en móvil */
    input, select, textarea {
        font-size: 16px !important; /* Evita zoom en iOS */
        min-height: 48px;
    }
}

/* Tablet (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
    h1 {
        font-size: 2.5rem !important;
    }
    
    h2 {
        font-size: 2rem !important;
    }
    
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
}

/* Desktop (1025px+) */
@media (min-width: 1025px) {
    /* Efectos hover solo en desktop */
    .hover-scale:hover {
        transform: scale(1.05);
    }
}

/* --- GRID RESPONSIVE --- */
.grid-responsive {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid-responsive {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1280px) {
    .grid-responsive {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --- NAVEGACIÓN RESPONSIVE --- */
@media (max-width: 768px) {
    /* Menú hamburguesa */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        z-index: 9998;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    .mobile-menu.active {
        left: 0;
    }
    
    .mobile-menu-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 9997;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        pointer-events: all;
    }
}

/* --- ACCESIBILIDAD --- */
*:focus-visible {
    outline: 2px solid #FBBF24;
    outline-offset: 2px;
}

/* Reducir movimiento para usuarios con preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- PRINT STYLES --- */
@media print {
    body {
        background: white;
        color: black;
    }
    
    header, footer, .no-print {
        display: none;
    }
    
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
}

/* --- FIX PARA ELEMENTOS ESPECÍFICOS --- */

/* Evitar que el canvas Matrix cause scroll horizontal */
canvas {
    max-width: 100%;
    height: auto;
}

/* Asegurar que videos e iframes sean responsive */
iframe,
video,
embed,
object {
    max-width: 100%;
    height: auto;
}

/* Tablas responsive */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

/* --- ANIMACIONES ADICIONALES --- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

/* --- SCROLL SUAVE --- */
html {
    scroll-padding-top: 100px; /* Offset para header fijo */
}

/* --- OPTIMIZACIÓN DE RENDIMIENTO --- */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* --- FIN DEL CSS --- */
