/* =========================================================================
   PREMIUM MIDNIGHT THEME - MAIN.CSS
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Deep space background */
    --bg-main: #06070a;
    --bg-sidebar: rgba(10, 11, 16, 0.7);
    --bg-card: rgba(18, 20, 31, 0.4);
    --bg-card-hover: rgba(26, 29, 46, 0.6);
    --bg-input: rgba(15, 16, 25, 0.6);
    
    /* Core Accents */
    --color-primary: #a855f7; /* Vibrant Purple */
    --color-secondary: #3b82f6; /* Bright Blue */
    --color-accent: #06b6d4; /* Cyan */
    --color-danger: #ef4444;
    --color-success: #10b981;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    --gradient-glow: 0 0 30px rgba(168, 85, 247, 0.3);
    
    /* Text */
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    
    /* Borders & Glass */
    --border-color: rgba(168, 85, 247, 0.2);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --glass-blur: blur(20px);

    /* Layout */
    --sidebar-width: 280px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Background Glow */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: 
        radial-gradient(circle at 15% 15%, rgba(168, 85, 247, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(59, 130, 246, 0.15) 0%, transparent 40%);
    z-index: -2;
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.04;
    z-index: -1;
    pointer-events: none;
}

/* Typography utilities */
.font-teko {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.5px;
    font-weight: 800;
}

.text-gradient-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--color-primary);
}

.text-dim { color: var(--text-dim); }
.text-sm { font-size: 13px; }
.text-error { color: var(--color-danger); }
.text-link { color: var(--color-accent); text-decoration: none; transition: 0.2s; }
.text-link:hover { filter: brightness(1.3); text-shadow: 0 0 10px var(--color-accent); }

/* Helpers */
.w-full { width: 100%; }
.mt-3 { margin-top: 15px; }
.mb-15 { margin-bottom: 15px; }
.m-0 { margin: 0 !important; }
.flex-row { display: flex; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }

/* =========================================================================
   LAYOUT: SIDEBAR & MAIN CONTENT
   ========================================================================= */
#app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
}

.sidebar-header {
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
}

.sidebar-logo {
    width: 45px;
    height: 45px;
    border-radius: 0;
    box-shadow: var(--gradient-glow);
    border: 1px solid var(--border-color);
}

.sidebar-brand h1 {
    font-size: 28px;
    line-height: 1;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.brand-subtitle {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--color-primary);
    font-weight: 700;
}

/* The Navigation Tabs (Works with script.js dynamically generated buttons) */
.sidebar-nav {
    padding: 20px 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

/* Override default button styles for .tab-btn generated by script.js */
.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    padding: 14px 20px;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    width: 100%;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.03);
    color: var(--text-main);
    transform: translateX(5px);
}

.tab-btn.active {
    background: var(--gradient-primary) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4) !important;
    transform: translateX(5px);
}
.tab-btn.active:hover {
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.6) !important;
    filter: brightness(1.2);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 25px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-badge {
    background: rgba(255,255,255,0.03);
    padding: 10px 15px;
    border-radius: 0;
    font-size: 14px;
    text-align: center;
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-weight: 600;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    position: relative;
    max-width: 100%;
}

.page-title {
    font-size: 42px;
    background: linear-gradient(to right, #fff, var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 5px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

/* Overlays */
.overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(18, 20, 31, 0.95) 0%, #06070a 100%);
    backdrop-filter: blur(10px);
    z-index: 2000;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.3); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }
