/**
 * Root Patagonia - Estilos principales
 * Separado del HTML para mejor mantenimiento y rendimiento
 */

:root {
    /* PALETA CORPORATE CYBERSEC - Modo Oscuro (Default) */
    --bg-body: #020617; 
    --bg-card: #0f172a; 
    
    --primary: #38bdf8; /* IT (Azul) */
    --web-color: #c084fc; /* WEB (Violeta) */
    --ot-color: #fbbf24; /* OT (Ámbar) */
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --border: rgba(255, 255, 255, 0.08);
    
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
}

/* Modo Claro */
[data-theme="light"] {
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    
    --primary: #0284c7; /* Azul más oscuro para mejor contraste */
    --web-color: #9333ea; /* Violeta más oscuro */
    --ot-color: #d97706; /* Ámbar más oscuro */
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    
    --border: rgba(0, 0, 0, 0.1);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    scroll-behavior: smooth; 
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(192, 132, 252, 0.08) 0px, transparent 50%);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Ajustes para modo claro */
[data-theme="light"] body {
    background-image: 
        radial-gradient(at 0% 0%, rgba(2, 132, 199, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(147, 51, 234, 0.05) 0px, transparent 50%);
}

/* COMPONENTES UI */
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

.btn {
    display: inline-block; 
    padding: 12px 24px; 
    border-radius: 6px;
    font-weight: 600; 
    text-decoration: none; 
    transition: all 0.2s ease;
    font-size: 0.95rem; 
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary); 
    color: #0f172a;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3); 
    border: 1px solid var(--primary);
}

.btn-primary:hover, 
.btn-primary:focus { 
    transform: translateY(-2px); 
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.5); 
    background: #fff; 
    border-color: #fff; 
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-secondary {
    background: rgba(255,255,255,0.03); 
    color: var(--text-main);
    border: 1px solid var(--border); 
    backdrop-filter: blur(5px);
}

.btn-secondary:hover,
.btn-secondary:focus { 
    border-color: var(--primary); 
    color: var(--primary); 
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* NAVBAR */
nav {
    padding: 20px 0; 
    position: sticky; 
    top: 0; 
    z-index: 100;
    backdrop-filter: blur(12px); 
    border-bottom: 1px solid var(--border);
    background: rgba(2, 6, 23, 0.85);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] nav {
    background: rgba(248, 250, 252, 0.95);
}

.nav-inner { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.logo { 
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo:hover,
.logo:focus {
    transform: scale(1.02);
    outline: none;
}

.logo-terminal {
    position: relative;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    min-width: 240px;
    overflow: hidden;
    backdrop-filter: blur(5px);
    box-shadow: none;
}


.logo-text {
    position: relative;
    z-index: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo-prompt {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.8), 0 0 20px rgba(56, 189, 248, 0.4);
    letter-spacing: 0.5px;
}

.logo-cursor {
    width: 8px;
    height: 16px;
    background: var(--primary);
    display: inline-block;
    animation: blink-cursor 1s infinite;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

@keyframes blink-cursor {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Ajustes para modo claro */
[data-theme="light"] .logo-terminal {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

[data-theme="light"] .logo-prompt {
    color: var(--primary);
    text-shadow: 0 0 8px rgba(2, 132, 199, 0.6), 0 0 15px rgba(2, 132, 199, 0.3);
}

[data-theme="light"] .logo-cursor {
    background: var(--primary);
    box-shadow: 0 0 6px rgba(2, 132, 199, 0.6);
}


/* Responsive */
@media(max-width: 900px) {
    .logo-terminal {
        min-width: 200px;
        padding: 10px 16px;
    }
    
    .logo-text {
        font-size: 0.85rem;
    }
}

/* HERO SECTION */
.hero { 
    padding: 80px 0 100px 0; 
    display: flex; 
    align-items: center; 
    gap: 60px; 
    min-height: 85vh; 
}

.hero-content { 
    flex: 1; 
}

.badge {
    display: inline-block; 
    padding: 6px 12px;
    background: rgba(56, 189, 248, 0.1); 
    color: var(--primary);
    border-radius: 50px; 
    font-size: 0.8rem; 
    font-weight: 700;
    border: 1px solid rgba(56, 189, 248, 0.2); 
    margin-bottom: 25px;
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

h1 {
    font-size: 3.5rem; 
    line-height: 1.15; 
    margin-bottom: 25px;
    letter-spacing: -1px; 
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: background 0.3s ease;
}

[data-theme="light"] h1 {
    background: linear-gradient(to right, #0f172a, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p { 
    font-size: 1.15rem; 
    color: var(--text-muted); 
    margin-bottom: 35px; 
    max-width: 520px; 
}

/* VISUAL WINDOWS */
.hero-visual { 
    flex: 1; 
    position: relative; 
    display: flex; 
    justify-content: center;
}

.code-window {
    width: 100%; 
    max-width: 550px; 
    background: #1e293b;
    border-radius: 12px; 
    border: 1px solid var(--border);
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6);
    overflow: hidden; 
    font-family: var(--font-code); 
    font-size: 0.8rem;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .code-window {
    background: #f1f5f9;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.15);
}

.window-header {
    background: #0f172a; 
    padding: 12px 16px;
    border-bottom: 1px solid var(--border); 
    display: flex; 
    gap: 8px; 
    align-items: center;
    transition: background-color 0.3s ease;
}

[data-theme="light"] .window-header {
    background: #e2e8f0;
}

.dot { 
    width: 10px; 
    height: 10px; 
    border-radius: 50%; 
    background: #334155; 
}

.window-body { 
    padding: 25px; 
    color: #e2e8f0; 
    line-height: 1.6;
    transition: color 0.3s ease;
}

[data-theme="light"] .window-body {
    color: #334155;
}

/* Syntax Colors */
.ln { 
    color: #475569; 
    margin-right: 15px; 
    user-select: none; 
}

.kw { 
    color: #c084fc; 
}

.str { 
    color: #38bdf8; 
}

.fn { 
    color: #fbbf24; 
}

.com { 
    color: #475569; 
    font-style: italic; 
}

/* TRUST BAR */
.trust-bar { 
    border-top: 1px solid var(--border); 
    border-bottom: 1px solid var(--border); 
    padding: 40px 0; 
    text-align: center; 
    background: rgba(255,255,255,0.01); 
}

.trust-text { 
    font-size: 0.8rem; 
    color: #475569; 
    text-transform: uppercase; 
    letter-spacing: 1.5px; 
    font-weight: 700; 
    margin-bottom: 25px;
    transition: color 0.3s ease;
}

[data-theme="light"] .trust-text {
    color: #64748b;
}

.standards { 
    display: flex; 
    justify-content: center; 
    gap: 30px; 
    flex-wrap: wrap; 
    opacity: 0.8; 
}

.std-item { 
    font-weight: 700; 
    color: #94a3b8; 
    font-size: 1.1rem; 
    display: flex; 
    align-items: center; 
    gap: 10px;
    transition: color 0.3s ease;
}

[data-theme="light"] .std-item {
    color: #64748b;
}

.cert-item { 
    color: var(--web-color); 
    font-family: var(--font-code); 
    background: rgba(192, 132, 252, 0.1); 
    padding: 2px 8px; 
    border-radius: 4px; 
    font-size: 0.9rem; 
}

/* SECTIONS GENERAL */
.section-padding { 
    padding: 80px 0; 
}

.section-title { 
    text-align: center; 
    margin-bottom: 60px; 
}

.section-title h2 { 
    font-size: 2.5rem; 
    margin-bottom: 15px; 
}

.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 40px; 
}

.card {
    background: var(--bg-card); 
    padding: 40px; 
    border-radius: 12px;
    border: 1px solid var(--border); 
    transition: 0.3s; 
    position: relative;
}

.card:hover,
.card:focus-within { 
    border-color: var(--primary); 
    transform: translateY(-5px); 
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5); 
}

.icon-box { 
    width: 48px; 
    height: 48px; 
    background: rgba(56, 189, 248, 0.1); 
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 25px; 
    color: var(--primary); 
    font-size: 1.2rem; 
}

.card h3 { 
    font-size: 1.25rem; 
    margin-bottom: 15px; 
}

.card p { 
    color: var(--text-muted); 
    font-size: 0.95rem; 
}

/* DEEP DIVE SECTIONS */
.deep-dive {
    padding: 80px 40px; 
    border-radius: 12px; 
    margin-bottom: 40px;
}

/* INDUSTRIES */
.industry-card {
    background: rgba(255,255,255,0.02); 
    padding: 25px;
    border-radius: 8px; 
    border: 1px solid var(--border); 
    text-align: center; 
    transition: 0.3s;
}

.industry-card:hover,
.industry-card:focus-within { 
    border-color: rgba(255,255,255,0.2); 
    background: rgba(255,255,255,0.04); 
}

.industry-emoji { 
    font-size: 2rem; 
    margin-bottom: 15px; 
    display: block; 
}

/* FAQ */
.faq-item { 
    margin-bottom: 0; 
    border-bottom: 1px solid var(--border); 
    padding: 25px 0; 
}

.faq-item:last-child { 
    border-bottom: none; 
}

.faq-item h4 { 
    color: var(--text-main); 
    margin-bottom: 10px; 
    font-size: 1.1rem; 
}

.faq-item p { 
    color: var(--text-muted); 
    font-size: 0.95rem; 
    line-height: 1.6; 
}

/* CTA BOX */
.cta-section {
    background: linear-gradient(135deg, var(--bg-card) 0%, #1e293b 100%);
    padding: 80px 40px; 
    border-radius: 16px; 
    text-align: center;
    border: 1px solid var(--border); 
    margin: 60px 0; 
    box-shadow: 0 0 50px rgba(0,0,0,0.3);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="light"] .cta-section {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    box-shadow: 0 0 50px rgba(0,0,0,0.1);
}

/* Ajustes para texto blanco en modo claro - Servicios IT & Cloud */
[data-theme="light"] h4[style*="color: #fff"],
[data-theme="light"] h4[style*="color:#fff"] {
    color: var(--text-main) !important;
}

/* Ajustes específicos para las secciones de servicios */
[data-theme="light"] .deep-dive h4[style*="color: #fff"],
[data-theme="light"] .deep-dive h4[style*="color:#fff"] {
    color: var(--text-main) !important;
}

/* Ajustes para elementos dentro de las secciones deep-dive */
[data-theme="light"] section.deep-dive h4 {
    color: var(--text-main) !important;
}

/* Ajustes para tags de especialidades en modo claro */
[data-theme="light"] span[style*="background: rgba(255, 255, 255, 0.05)"] {
    background: rgba(0, 0, 0, 0.05) !important;
    color: var(--text-main) !important;
}

/* Ajustes para texto dentro de ventanas de código en modo claro */
[data-theme="light"] .window-body span[style*="color: #e2e8f0"],
[data-theme="light"] .window-body span[style*="color:#e2e8f0"] {
    color: #334155 !important;
}

[data-theme="light"] .window-body div[style*="color: #94a3b8"],
[data-theme="light"] .window-body div[style*="color:#94a3b8"] {
    color: #64748b !important;
}

/* Ajustes específicos para comandos en terminal whoami */
[data-theme="light"] #whoami .window-body span[style*="color: #fff"],
[data-theme="light"] #whoami .window-body span[style*="color:#fff"] {
    color: var(--text-main) !important;
}

/* Ajustes para todos los spans con color blanco dentro de window-body en modo claro */
[data-theme="light"] .code-window .window-body span[style*="color: #fff"],
[data-theme="light"] .code-window .window-body span[style*="color:#fff"] {
    color: var(--text-main) !important;
}

/* Ajustes para bordes dentro de window-body en modo claro */
[data-theme="light"] .window-body div[style*="border-top: 1px solid rgba(255, 255, 255, 0.1)"] {
    border-top-color: rgba(0, 0, 0, 0.1) !important;
}

/* Ajustes generales para todos los elementos con texto blanco en modo claro */
[data-theme="light"] h4[style*="color: #fff"],
[data-theme="light"] h4[style*="color:#fff"],
[data-theme="light"] span[style*="color: #fff"],
[data-theme="light"] span[style*="color:#fff"],
[data-theme="light"] p[style*="color: #fff"],
[data-theme="light"] p[style*="color:#fff"],
[data-theme="light"] div[style*="color: #fff"],
[data-theme="light"] div[style*="color:#fff"] {
    color: var(--text-main) !important;
}

/* Excepción: mantener blanco solo si está sobre fondo oscuro (como badges) */
[data-theme="light"] .badge,
[data-theme="light"] .btn-primary {
    color: inherit !important;
}

/* Ajustes para secciones deep-dive en modo claro */
[data-theme="light"] .deep-dive {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.02), transparent) !important;
}

/* Ajustes para bordes en modo claro */
[data-theme="light"] .deep-dive[style*="border: 1px solid"] {
    border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Ajustes para "Root Patagonia" en el footer en modo claro */
[data-theme="light"] footer h4[style*="color: #fff"],
[data-theme="light"] footer h4[style*="color:#fff"] {
    color: var(--text-main) !important;
}

/* FOOTER */
footer { 
    padding: 60px 0 30px 0; 
    border-top: 1px solid var(--border); 
    color: var(--text-muted); 
    font-size: 0.9rem; 
    background: #01040f;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] footer {
    background: #f1f5f9;
}

.footer-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 40px; 
    margin-bottom: 40px; 
}

.social-link { 
    color: var(--text-main); 
    text-decoration: none; 
    margin-left: 20px; 
    font-weight: 500; 
    transition: 0.2s; 
}

.social-link:hover,
.social-link:focus { 
    color: var(--primary); 
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}

.legal-row { 
    border-top: 1px solid var(--border); 
    padding-top: 25px; 
    display: flex; 
    justify-content: space-between; 
    font-size: 0.8rem; 
}

.legal-link { 
    color: var(--text-muted); 
    text-decoration: none; 
    margin-left: 15px; 
}

.legal-link:hover,
.legal-link:focus {
    color: var(--primary);
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Skip to main content para accesibilidad */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: #0f172a;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
}

/* Animaciones suaves */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.industry-card {
    animation: fadeIn 0.5s ease-out;
}

/* Mejoras de rendimiento - reducir movimiento para usuarios con preferencia */
@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;
    }
}

/* Toggle de Tema */
.theme-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-main);
    font-size: 1.2rem;
    padding: 0;
    margin: 0;
}

.theme-toggle:hover,
.theme-toggle:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    transform: scale(1.05);
}

[data-theme="light"] .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .theme-toggle:hover,
[data-theme="light"] .theme-toggle:focus {
    background: rgba(0, 0, 0, 0.1);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: none;
}

/* Dropdown de Demos para móviles */
.demo-buttons-desktop {
    display: flex;
    gap: 15px;
    align-items: center;
}

.demo-dropdown-mobile {
    display: none;
    position: relative;
}

.demo-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.demo-dropdown-btn svg {
    transition: transform 0.3s ease;
}

.demo-dropdown-btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.demo-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.demo-dropdown-menu[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.demo-dropdown-item {
    display: block;
    padding: 12px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border);
}

.demo-dropdown-item:last-child {
    border-bottom: none;
}

.demo-dropdown-item:hover,
.demo-dropdown-item:focus {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    outline: none;
}

[data-theme="light"] .demo-dropdown-menu {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .demo-dropdown-item:hover,
[data-theme="light"] .demo-dropdown-item:focus {
    background: rgba(2, 132, 199, 0.1);
}

/* Responsive */
@media(max-width: 900px) {
    h1 { 
        font-size: 2.5rem; 
    }
    
    .hero { 
        flex-direction: column; 
        text-align: center; 
        padding-top: 50px; 
        gap: 40px; 
    }
    
    .hero-visual { 
        width: 100%; 
    }
    
    .grid { 
        grid-template-columns: 1fr; 
    }
    
    .footer-grid { 
        grid-template-columns: 1fr; 
        text-align: center; 
    }
    
    .social-link { 
        margin: 0 10px; 
    }
    
    .legal-row { 
        flex-direction: column; 
        gap: 15px; 
        text-align: center; 
    }
    
    .legal-link { 
        margin: 0 10px; 
    }
    
    .visual-block { 
        order: -1; 
    }
    
    /* Ocultar botones individuales y mostrar dropdown en móviles */
    .demo-buttons-desktop {
        display: none;
    }
    
    .demo-dropdown-mobile {
        display: block;
    }
    
    /* Ocultar toggle de tema en móviles */
    .theme-toggle {
        display: none !important;
    }
}
