/* OBSIDIAN & NEON MINT CSS (Cyber-Minimal) 🌌✨ */

:root {
    /* Obsidian Dark Theme */
    --win-bg: #0f172a;        /* Background (Slate 900) */
    --win-surface: #1e293b;   /* Panels (Slate 800) */
    --win-surface-hover: #334155; /* Interactive Surface (Slate 700) */
    
    --win-text: #f8fafc;      /* High contrast text */
    --text-muted: #94a3b8;    /* Muted text */
    
    --win-border-light: rgba(255,255,255,0.05); /* Top border subtle light */
    --win-border-dark: rgba(0,0,0,0.4);      /* Bottom shadow */
    --win-border-darker: rgba(0,0,0,0.8);
    --win-title-bg: #1e293b;
    
    /* Neon Mint Accents */
    --primary: #14b8a6;       /* Teal 500 */
    --primary-hover: #0d9488; /* Teal 600 */
    --primary-text: #042f2e;  /* Dark teal for text ON primary background */
    
    /* Status Colors */
    --success: #10b981;      /* Emerald */
    --warning: #f59e0b;      /* Amber */
    --danger: #ef4444;       /* Red */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--win-bg);
    color: var(--win-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Base Area */
.desktop {
    flex: 1;
    padding: 20px;
    padding-top: 140px; /* Space for top nav on desktop, increased to avoid hiding titles when wrapping */
    padding-bottom: 20px;
    overflow-y: auto;
}

.content {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

/* MINIMALIST TASKBAR */
.taskbar {
    position: fixed;
    top: 0; /* Default to top for desktop */
    width: 100%;
    background-color: var(--win-surface);
    border-bottom: 1px solid var(--win-border-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    z-index: 1000;
    min-height: 60px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap; /* Prevents squishing on desktop */
    gap: 8px;
    width: 100%;
    max-width: 1000px;
}

.nav-links li { flex: 0 1 auto; }

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px 8px;
    background-color: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.nav-links a:hover, .nav-links a:active {
    background-color: var(--win-surface-hover);
    color: var(--win-text);
}

/* Active Link Subtlety (In future we can add .active class) */

/* Page Header */
.page-header {
    background-color: var(--win-surface);
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--win-border-light);
}

.page-header h1 {
    font-size: 1.4rem;
    color: var(--win-text);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.page-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* MODERN GLASS PANELS */
.glass-panel, .content-panel, .stat-card {
    background-color: var(--win-surface);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    border: 1px solid var(--win-border-light);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

/* MINIMAL FORM ELEMENTS */
.styled-form { display: flex; flex-direction: column; gap: 20px; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--win-bg);
    color: var(--win-text);
    font-size: 0.95rem;
    border: 1px solid var(--win-surface-hover);
    border-radius: 8px;
    transition: all 0.2s;
}

/* Revert select colors for better readability on dark mode */
.form-group select option {
    background: var(--win-bg);
    color: var(--win-text);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2); /* Neon glow effect */
}

/* CYBER-MINIMAL BUTTONS */
button, .btn-primary, .btn-secondary, .btn-edit, .btn-delete, .btn-success {
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 24px;
    cursor: pointer;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary, button[type="submit"] { 
    background-color: var(--primary); 
    color: var(--primary-text); 
    box-shadow: 0 4px 14px 0 rgba(20, 184, 166, 0.39);
}
.btn-primary:hover, button[type="submit"]:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success { background-color: var(--success); color: white; }
.btn-success:hover { background-color: #059669; }

.btn-edit { background-color: var(--warning); color: #fff; }
.btn-edit:hover { background-color: #d97706; }

.btn-delete { background-color: var(--danger); color: white; }
.btn-delete:hover { background-color: #dc2626; }

.btn-secondary { 
    background-color: var(--win-surface-hover); 
    color: var(--win-text); 
}
.btn-secondary:hover { background-color: #475569; }

button:active, .btn-primary:active, .btn-secondary:active {
    transform: translateY(1px);
    box-shadow: none;
}

.btn-small { padding: 6px 12px; font-size: 0.8rem; width: auto !important; }

/* Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    border-left: 4px solid var(--primary);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.stat-card h3 { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 2.2rem; font-weight: 800; color: var(--win-text); line-height: 1; }

/* Table List (Minimal) */
.table-container {
    margin-top: 15px;
    background: var(--win-surface);
    border-radius: 12px;
    overflow-x: auto;
    border: 1px solid var(--win-border-light);
}

.styled-table { 
    width: 100%; 
    border-collapse: collapse; 
    min-width: 600px; 
}
.styled-table th, .styled-table td { 
    padding: 16px; 
    border-bottom: 1px solid var(--win-surface-hover); 
    text-align: left;
}
.styled-table th { 
    background: transparent; 
    color: var(--text-muted);
    font-size: 0.75rem; 
    font-weight: 600;
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

.styled-table tbody tr:hover {
    background-color: rgba(255,255,255,0.02);
}

/* Status INDICATORS */
.badge {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    color: white;
}
.badge-success { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.5); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.5); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.5); }

/* --- USER INFO IN TASKBAR --- */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 15px;
    border-left: 1px solid var(--win-border-light);
    font-size: 0.85rem;
    font-weight: 600;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.role-badge {
    background-color: rgba(20, 184, 166, 0.1);
    color: var(--primary);
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.btn-logout {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-left: 5px;
    padding: 4px;
    transition: all 0.2s;
    border-radius: 8px;
}

.btn-logout:hover {
    color: var(--danger);
    background-color: rgba(239, 68, 68, 0.1);
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media screen and (min-width: 768px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; align-items: start; }
    .btn-primary, button[type="submit"] { width: auto; align-self: flex-start; }
}

@media screen and (max-width: 900px) {
    .user-info, .desktop-logo { display: none !important; }
}

@media screen and (max-width: 600px) {
    .taskbar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-bottom: none;
        border-top: 1px solid var(--win-border-light);
        box-shadow: 0 -4px 12px rgba(0,0,0,0.2);
        padding: 8px 10px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom)); /* Soporte para Notch/Barra inferior de iOS */
        height: auto;
        min-height: 75px;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
        justify-content: flex-start;
        z-index: 9999;
    }
    
    .desktop {
        padding: 10px;
        padding-top: 20px;
        padding-bottom: 110px; /* Space for bottom nav */
    }

    .mobile-only-link {
        display: block !important;
    }
    .mobile-only-link a span { color: var(--danger); font-weight: 900;}
    
    .nav-links {
        gap: 5px;
        justify-content: flex-start;
        align-items: stretch;
        overflow-x: auto;
        flex-wrap: nowrap; /* Forzar en una sola línea scrolleable */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none;  /* IE and Edge */
        width: 100%;
    }

    .nav-links::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .nav-links li {
        flex: 0 0 auto;
        display: flex;
    }

    .nav-links a {
        padding: 8px 12px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        font-size: 0.7rem;
        border-radius: 12px;
        white-space: nowrap;
        height: 100%;
    }

    .nav-links a span {
        font-size: 1.3rem;
    }

    .nav-links a:hover, .nav-links a:active {
        background-color: var(--win-surface-hover);
        color: var(--primary);
    }
}

.mobile-only-link { display: none; }

/* --- ANIMACIONES GLITCH & ALARMAS (Adaptadas al Minimalismo) --- */
@keyframes radar-ping {
    0% { transform: scale(1); opacity: 1; }
    75%, 100% { transform: scale(2); opacity: 0; }
}

.radar-ping-container {
    position: relative;
    display: inline-flex;
}

.radar-ping-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--danger);
    position: absolute;
    top: -2px;
    right: -2px;
    z-index: 10;
}

.radar-ping-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--danger);
    animation: radar-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.glitch-critical {
    color: #f87171 !important;
    background-color: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.5);
    font-weight: 800;
    animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
/* --- EMPTY STATES & WELCOME --- */
.empty-state-card {
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, var(--win-surface) 0%, #0f172a 100%);
    border-radius: 16px;
    border: 1px dashed var(--primary);
    margin: 40px 0;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
    filter: drop-shadow(0 0 10px var(--primary));
}

.empty-state-card h2 {
    color: var(--win-text);
    margin-bottom: 12px;
}

.empty-state-card p {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 30px auto;
    font-size: 1rem;
    line-height: 1.6;
}

.welcome-banner {
    background: linear-gradient(90deg, var(--primary) 0%, #0d9488 100%);
    color: var(--primary-text);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.welcome-banner .icon {
    font-size: 2.5rem;
}

.welcome-banner .text h2 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.welcome-banner .text p {
    font-size: 0.9rem;
    opacity: 0.9;
}
