/* === VARIABLES GLOBALES === */
:root {
    --neon-green: #00ff9f;
    --neon-pink: #ff00ff;
    --neon-blue: #00ffff;
    --neon-red: #ff0033;
    --dark-bg: #0a0a0a;
    --darker-bg: #050505;
    --card-bg: #111111;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --blood-red: #8b0000;
    --matrix-green: #00ff41;
    
    /* Colores del tercer CSS para compatibilidad */
    --legacy-blue: #00bcd4;
    --legacy-primary: #007bff;
    --legacy-success: #28a745;
    --legacy-gray: #6c757d;
}

/* === RESET Y ESTILOS BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

body {
    background: #000000;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-y: auto;
}

/* === EFECTO MATRIX BACKGROUND MEJORADO === */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 280px; /* Comienza después del sidebar */
    width: calc(100% - 280px); /* Ancho total menos sidebar */
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.15;
    filter: hue-rotate(90deg);
}

/* === LAYOUT PRINCIPAL === */
.container {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR MEJORADO - FONDO NEGRO SÓLIDO === */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #000000 0%, #0a0a0a 100%);
    padding: 20px;
    border-right: 1px solid var(--neon-green);
    box-shadow: 0 0 40px rgba(0, 255, 159, 0.3);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    flex-shrink: 0;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 255, 159, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 0, 255, 0.03) 0%, transparent 50%);
    z-index: -1;
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 255, 159, 0.3);
    position: relative;
}

.logo-container::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 25%;
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-green), transparent);
}

.logo {
    max-width: 200px;
    height: auto;
    filter: 
        drop-shadow(0 0 15px var(--neon-green))
        drop-shadow(0 0 30px rgba(0, 255, 159, 0.3));
    border-radius: 8px;
    transition: all 0.3s ease;
}

.logo:hover {
    filter: 
        drop-shadow(0 0 20px var(--neon-green))
        drop-shadow(0 0 40px rgba(0, 255, 159, 0.5));
    transform: scale(1.02);
}

.sidebar h2 {
    color: var(--neon-green);
    font-size: 16px;
    margin-bottom: 15px;
    text-align: center;
    padding: 12px;
    background: rgba(0, 255, 159, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 159, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sidebar h2::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 159, 0.2), transparent);
    transition: left 0.5s ease;
}

.sidebar h2:hover::before {
    left: 100%;
}

.sidebar h2:hover {
    background: rgba(0, 255, 159, 0.15);
    box-shadow: 0 0 20px rgba(0, 255, 159, 0.4);
}

.section-title {
    color: var(--neon-green);
    font-size: 14px;
    margin-top: 25px;
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 3px solid var(--neon-green);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 255, 159, 0.5);
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin: 8px 0;
    position: relative;
}

.sidebar a {
    display: block;
    color: var(--text-primary);
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    font-size: 0.9rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.sidebar a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 159, 0.1), transparent);
    transition: left 0.5s ease;
}

.sidebar a:hover::before,
.sidebar a.active::before {
    left: 100%;
}

.sidebar a:hover,
.sidebar a.active {
    background: rgba(0, 255, 159, 0.15);
    color: var(--neon-green);
    border: 1px solid var(--neon-green);
    transform: translateX(5px);
    box-shadow: 
        0 0 15px rgba(0, 255, 159, 0.3),
        inset 0 0 10px rgba(0, 255, 159, 0.1);
}

/* === GATES SUBMENU MEJORADO === */
.gates-submenu {
    display: none;
    margin-left: 15px;
    border-left: 2px solid rgba(0, 255, 159, 0.3);
    padding-left: 10px;
    animation: slideDown 0.3s ease;
    position: relative;
}

.gates-submenu::before {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    height: 100%;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--neon-green), transparent);
}

.gates-submenu.active {
    display: block;
}

@keyframes slideDown {
    from { 
        opacity: 0; 
        max-height: 0;
        transform: translateY(-10px);
    }
    to { 
        opacity: 1; 
        max-height: 200px;
        transform: translateY(0);
    }
}

.gate-item {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 159, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.gate-item:hover {
    border-color: var(--neon-green);
    background: rgba(0, 255, 159, 0.1);
    transform: translateX(5px);
    box-shadow: 0 0 15px rgba(0, 255, 159, 0.3);
}

.gate-name {
    color: var(--neon-green);
    font-size: 0.85rem;
    font-weight: 600;
}

.gate-btn {
    background: rgba(0, 255, 159, 0.2);
    color: var(--neon-green);
    border: 1px solid var(--neon-green);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

.gate-btn:hover {
    background: var(--neon-green);
    color: var(--dark-bg);
    box-shadow: 0 0 15px rgba(0, 255, 159, 0.5);
    transform: scale(1.05);
}

.gate-inactive {
    background: rgba(255, 0, 0, 0.2);
    border-color: var(--neon-red);
    color: var(--neon-red);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
}

/* === CONTENIDO PRINCIPAL - CON MATRIX VISIBLE === */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 40px;
    min-height: 100vh;
    background: transparent;
    overflow: hidden;
    position: relative;
}

/* === SECCIÓN BIENVENIDA MEJORADA === */
.welcome-section {
    max-width: 1000px;
    margin: 0 auto 50px auto;
    padding: 40px;
    background: rgba(10, 10, 10, 0.9);
    border-radius: 20px;
    border: 1px solid var(--neon-green);
    box-shadow: 
        0 0 40px rgba(0, 255, 159, 0.4),
        inset 0 0 20px rgba(0, 255, 159, 0.1);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
    min-height: 400px;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 159, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 255, 255, 0.06) 0%, transparent 50%);
    z-index: 0;
    animation: backgroundShift 10s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { 
        background-position: 0% 0%, 100% 100%, 50% 50%;
    }
    50% { 
        background-position: 100% 100%, 0% 0%, 80% 20%;
    }
}

.welcome-section.compact {
    min-height: 200px;
    padding: 25px 40px;
    backdrop-filter: blur(20px);
}

.welcome-title {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.welcome-heading {
    color: var(--neon-green);
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 
        0 0 10px var(--neon-green),
        0 0 20px rgba(0, 255, 159, 0.5);
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from {
        text-shadow: 
            0 0 10px var(--neon-green),
            0 0 20px rgba(0, 255, 159, 0.5);
    }
    to {
        text-shadow: 
            0 0 15px var(--neon-green),
            0 0 30px rgba(0, 255, 159, 0.7),
            0 0 40px rgba(0, 255, 159, 0.3);
    }
}

.decorative-text {
    font-size: 1.2rem;
    color: var(--neon-pink);
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 3px;
    z-index: 1;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.welcome-message {
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: center;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
    min-height: 250px;
}

/* === TERMINAL PROMPT MEJORADO === */
.terminal-prompt {
    background: rgba(0, 255, 159, 0.1);
    border: 1px solid var(--neon-green);
    border-radius: 12px;
    padding: 18px 25px;
    margin-top: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.terminal-prompt::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 159, 0.2), transparent);
    transition: left 0.6s ease;
}

.terminal-prompt:hover::before {
    left: 100%;
}

.terminal-prompt:focus {
    outline: 2px dashed rgba(0, 255, 159, 0.4);
    outline-offset: 2px;
}

.terminal-prompt:hover {
    background: rgba(0, 255, 159, 0.15);
    box-shadow: 
        0 0 25px rgba(0, 255, 159, 0.5),
        inset 0 0 15px rgba(0, 255, 159, 0.1);
    transform: translateY(-2px);
}

/* === PANELES INFORMATIVOS MEJORADOS === */
.info-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.info-panel {
    background: rgba(10, 10, 10, 0.9);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(0, 255, 159, 0.3);
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(15px);
}

.info-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--neon-green), 
        var(--neon-blue), 
        var(--neon-pink), 
        transparent
    );
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.info-panel.large {
    grid-column: 1 / -1;
}

.info-panel:hover {
    border-color: var(--neon-green);
    box-shadow: 
        0 0 35px rgba(0, 255, 159, 0.5),
        inset 0 0 20px rgba(0, 255, 159, 0.05);
    transform: translateY(-8px) scale(1.02);
}

.panel-title {
    color: var(--neon-green);
    font-size: 1.2rem;
    margin-bottom: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(0, 255, 159, 0.3);
}

.panel-description {
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.panel-default {}
.panel-hover { 
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.info-panel:hover .panel-default { display: none; }
.info-panel:hover .panel-hover { display: block; }

/* === BOTONES CLICKEABLES MEJORADOS === */
.gate-active, .gate-inactive {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.gate-active {
    color: var(--neon-green);
    background: rgba(0, 255, 159, 0.1);
    border: 1px solid rgba(0, 255, 159, 0.3);
}

.gate-inactive {
    color: var(--neon-red);
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
}

.gate-active:hover {
    background-color: rgba(0, 255, 159, 0.2);
    transform: scale(1.08);
    box-shadow: 0 0 15px rgba(0, 255, 159, 0.4);
}

.gate-inactive:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.08);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

/* === MEJORAS ADICIONALES === */

/* Efecto de partículas para el área principal */
.main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 280px;
    width: calc(100% - 280px);
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 159, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 255, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Mejoras de scroll para sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 255, 159, 0.05);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--neon-green);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--neon-blue);
}

/* Efectos de hover mejorados para todos los elementos interactivos */
.sidebar a, .gate-btn, .terminal-prompt, .info-panel {
    transition: 
        transform 0.3s ease,
        box-shadow 0.3s ease,
        background-color 0.3s ease,
        border-color 0.3s ease;
}

/* Responsive mejorado */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        margin-bottom: 0;
    }
    
    .main-content {
        margin-left: 0;
        padding: 25px;
    }
    
    .matrix-bg {
        left: 0;
        width: 100%;
    }
    
    .info-panels {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .welcome-section {
        margin: 0 auto 30px auto;
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }
    
    .welcome-section {
        padding: 20px;
        margin: 0 auto 25px auto;
    }
    
    .welcome-heading {
        font-size: 2rem;
    }
    
    .info-panel {
        padding: 20px;
    }
    
    .terminal-prompt {
        padding: 15px 20px;
    }
}

/* Efectos de carga y transiciones */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible para mejor accesibilidad */
a:focus-visible,
button:focus-visible,
.gate-active:focus-visible,
.gate-inactive:focus-visible {
    outline: 2px solid var(--neon-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

/* === SCROLLBAR PERSONALIZADO MEJORADO === */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-green), var(--neon-blue));
    border-radius: 5px;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--neon-blue), var(--neon-green));
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Resto de estilos existentes (extrapolador, etc.) se mantienen igual... */

/* === ESTILOS DEL EXTRAPOLADOR === */
.app-title {
    text-align: center;
    padding: 20px;
    position: relative;
    margin-bottom: 20px;
}

.app-title h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
    letter-spacing: 3px;
}

.app-title p {
    font-size: 1.2rem;
    color: var(--neon-blue);
    opacity: 0.9;
}

/* Contenedor del extrapolador */
.extrapolador-container {
    display: flex;
    height: auto;
    padding: 20px;
    gap: 20px;
    box-sizing: border-box;
    margin: 2rem;
    flex-direction: column;
}

.extrapolador-header {
    margin-bottom: 20px;
}

.extrapolador-header h1 {
    color: var(--neon-green);
    margin: 0 0 15px 0;
    font-size: 1.5rem;
}

.extrapolador-panels {
    display: flex;
    gap: 20px;
    height: calc(100vh - 120px);
}

/* Paneles del extrapolador */
.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(17, 17, 17, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid var(--neon-green);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 0 30px rgba(0, 255, 159, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 159, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 255, 0.1) 0%, transparent 50%);
    z-index: 0;
}

.panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 40px rgba(0, 255, 159, 0.4);
}

.panel h3 {
    margin: 0 0 20px 0;
    color: var(--neon-green);
    font-size: 1.4rem;
    border-bottom: 2px solid var(--neon-green);
    padding-bottom: 10px;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 5px var(--neon-green);
}

/* ... resto de estilos del extrapolador se mantienen igual ... */

/* === ANIMACIONES Y EFECTOS MEJORADOS === */
.blink {
    animation: blink 1s infinite;
    color: var(--neon-green);
    font-weight: bold;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.glitch-text,
.glitch-words {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after,
.glitch-words::before,
.glitch-words::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before,
.glitch-words::before {
    left: 2px;
    text-shadow: -2px 0 var(--neon-pink);
    animation: glitch-1 2s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.glitch-text::after,
.glitch-words::after {
    left: -2px;
    text-shadow: -2px 0 var(--neon-blue);
    animation: glitch-2 3s infinite linear alternate-reverse;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch-1 {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

@keyframes glitch-2 {
    0% { transform: translate(0); }
    20% { transform: translate(2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-2px, 2px); }
    80% { transform: translate(-2px, -2px); }
    100% { transform: translate(0); }
}

.blood-text {
    color: var(--blood-red);
    text-shadow: 
        0 0 10px rgba(139, 0, 0, 0.5),
        0 0 20px rgba(139, 0, 0, 0.3);
    animation: bloodPulse 2s ease-in-out infinite;
}

@keyframes bloodPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.capitalism-text {
    color: var(--neon-red);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 0, 51, 0.5);
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 255, 159, 0.3);
    border-radius: 50%;
    border-top-color: var(--neon-green);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Mejoras finales - Efectos de profundidad */
.sidebar {
    box-shadow: 
        5px 0 30px rgba(0, 0, 0, 0.8),
        inset -1px 0 0 rgba(0, 255, 159, 0.1);
}

.main-content {
    box-shadow: 
        -5px 0 30px rgba(0, 0, 0, 0.5),
        inset 1px 0 0 rgba(0, 255, 159, 0.05);
}