:root {
    /* --- PALETA AURORA --- */
    --bg-deep: #050507;
    --bg-surface: #0e0e11;
    --bg-card: #141419;
    
    --primary: #6366f1;       /* Indigo */
    --primary-glow: rgba(99, 102, 241, 0.4);
    --accent: #06b6d4;        /* Cyan */
    --accent-glow: rgba(6, 182, 212, 0.4);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --border: rgba(255, 255, 255, 0.08);
    --radius: 16px;
    
    /* --- ANIMACIONES --- */
    --ease-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* BASE */
* { box-sizing: border-box; outline: none; }
body {
    margin: 0; 
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-deep);
    background-image: 
        radial-gradient(circle at 10% 0%, rgba(99, 102, 241, 0.15), transparent 40%),
        radial-gradient(circle at 90% 100%, rgba(6, 182, 212, 0.1), transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
}

h1, h2, h3 { font-weight: 800; letter-spacing: -0.03em; margin: 0; }
a { text-decoration: none; color: inherit; }

/* UTILITIES */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.font-mono { font-family: 'JetBrains Mono', monospace; }

/* NAVBAR COMPARTIDO */
.navbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 0; margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap; gap: 20px;
}
.brand {
    font-size: 1.5rem; white-space: nowrap;
    background: linear-gradient(135deg, #fff 20%, var(--primary)); 
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    display: flex; align-items: center; gap: 10px;
}
.nav-menu { 
    display: flex; gap: 8px; 
    overflow-x: auto; /* Scroll horizontal */
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    scrollbar-width: none; /* Firefox */
}
.nav-menu::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.nav-btn {
    padding: 8px 14px; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
    color: var(--text-muted); transition: 0.2s; white-space: nowrap; /* No romper línea */
    display: flex; align-items: center; gap: 6px;
    border: 1px solid transparent;
}
.nav-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-btn.active { 
    background: rgba(99, 102, 241, 0.1); 
    color: var(--primary); 
    border-color: rgba(99, 102, 241, 0.3);
}
.nav-btn i { font-size: 1rem; }

/* Separador visual para grupos */
.nav-sep { width: 1px; background: var(--border); margin: 0 5px; height: 24px; align-self: center; }

/* GRID DE CARDS (Para el Home) */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    transition: transform 0.3s var(--ease-elastic), box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 15px;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px var(--primary-glow);
}

.card-icon {
    font-size: 2rem; color: var(--text-muted);
    transition: 0.3s;
}
.card:hover .card-icon { color: var(--primary); transform: scale(1.1); }

.card-title { font-size: 1.25rem; }
.card-desc { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }

/* UI ELEMENTS COMUNES */
.btn {
    background: var(--primary); color: white; border: none;
    padding: 12px 24px; border-radius: 8px; font-weight: 600; cursor: pointer;
    transition: 0.2s; display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.95rem;
}
.btn:hover { filter: brightness(1.2); box-shadow: 0 0 15px var(--primary-glow); }

input[type="text"], textarea {
    background: var(--bg-card); border: 1px solid var(--border);
    color: #fff; padding: 12px 16px; border-radius: 8px;
    width: 100%; font-family: 'JetBrains Mono', monospace;
    transition: 0.2s; font-size: 0.95rem;
}
input:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.output-group { position: relative; margin-top: 15px; }
.copy-btn {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.1); border: none; color: #fff;
    width: 30px; height: 30px; border-radius: 6px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.copy-btn:hover { background: var(--primary); }

/* FOOTER */
footer {
    text-align: center; padding: 40px 0; color: var(--text-muted);
    font-size: 0.85rem; margin-top: auto; border-top: 1px solid var(--border);
}

/* ANIMACIONES */
.fade-in { animation: fadeIn 0.5s ease forwards; opacity: 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- RESPONSIVE MOBILE OPTIMIZATIONS --- */
@media (max-width: 768px) {
    /* 1. Navbar Adaptable */
    .navbar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 10px 0;
    }
    
    .brand { 
        justify-content: center; 
        font-size: 1.8rem;
    }

    .nav-menu {
        justify-content: flex-start; /* Alinear al inicio para scroll natural */
        padding-bottom: 10px; /* Espacio para scrollbar invisible */
    }

    /* 2. Grid de Herramientas */
    .tool-grid {
        grid-template-columns: 1fr; /* Una sola columna */
        gap: 15px;
    }

    .card {
        padding: 20px; /* Menos padding para ganar espacio */
    }

    /* 3. Vistas Divididas (Scoreboard/VPS) */
    .split-view, 
    .dev-hero-card {
        flex-direction: column !important;
        grid-template-columns: 1fr !important; /* Forzar columna única */
        gap: 25px;
    }

    .dev-hero-card {
        text-align: center;
        padding: 25px;
    }

    .dev-avatar {
        margin: 0 auto; /* Centrar avatar */
    }

    .tech-grid {
        justify-content: center;
    }

    /* 4. Inputs y Botones Táctiles */
    input[type="text"], input[type="number"], select, textarea, .btn {
        font-size: 16px; /* Evitar zoom automático en iOS */
        padding: 12px; /* Área táctil más grande */
    }

    /* 5. Terminales y Tablas */
    .terminal {
        font-size: 0.75rem; /* Texto más pequeño para que quepan comandos */
        padding: 15px;
        overflow-x: auto; /* Scroll horizontal si el comando es largo */
    }
    
    /* VPS Academy Layout */
    #tab-vps > div {
        grid-template-columns: 1fr !important; /* Sidebar pasa arriba */
    }
}