/* Gadzooks Admin Dashboard - Base Styles and CSS Variables */

/* ============================================================================
   CSS VARIABLES
   ============================================================================ */
:root {
    /* Colors - Background (Metallic Steel) */
    --bg-primary: #0c0e12;
    --bg-secondary: #13161c;
    --bg-tertiary: #1a1e26;
    --bg-elevated: #21262f;
    --bg-input: #181c23;
    --bg-hover: #282e39;

    /* Colors - Border (Steel/Chrome accents) */
    --border-primary: #2d333d;
    --border-secondary: #3d444f;
    --border-accent: #5b8def;

    /* Colors - Text */
    --text-primary: #e8edf7;
    --text-secondary: #c5d1e8;
    --text-muted: #8a99b8;
    --text-bright: #f8fafd;
    --text-heading: #ffffff;

    /* Colors - Accent & Brand - Expanded Palette */
    --accent-primary: #5b8def;
    --accent-primary-hover: #4a7de8;
    --accent-secondary: #4ade80;
    --accent-tertiary: #fb923c;
    --accent-purple: #a78bfa;
    --accent-pink: #f472b6;
    --accent-teal: #2dd4bf;
    --accent-cyan: #22d3ee;
    --accent-amber: #fbbf24;
    --accent-rose: #fb7185;
    --accent-emerald: #34d399;
    --accent-violet: #8b5cf6;
    --accent-fuchsia: #e879f9;
    --accent-orange: #ff8c42;
    --accent-lime: #a3e635;

    /* Gradients - Modern Multi-Color */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --gradient-success: linear-gradient(135deg, #4ade80 0%, #2dd4bf 100%);
    --gradient-warning: linear-gradient(135deg, #fbbf24 0%, #fb923c 100%);
    --gradient-danger: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);
    --gradient-info: linear-gradient(135deg, #22d3ee 0%, #5b8def 100%);
    --gradient-dark: linear-gradient(135deg, #1a1e26 0%, #0c0e12 100%);
    --gradient-cosmic: linear-gradient(135deg, #667eea 0%, #764ba2 33%, #f093fb 66%, #22d3ee 100%);
    --gradient-sunset: linear-gradient(135deg, #ff8c42 0%, #fb923c 50%, #f472b6 100%);
    --gradient-ocean: linear-gradient(135deg, #2dd4bf 0%, #22d3ee 50%, #5b8def 100%);
    --gradient-forest: linear-gradient(135deg, #4ade80 0%, #34d399 50%, #2dd4bf 100%);

    /* Colors - Status */
    --status-success: #48bb78;
    --status-success-bg: rgba(72, 187, 120, 0.1);
    --status-success-border: rgba(72, 187, 120, 0.3);

    --status-warning: #ed8936;
    --status-warning-bg: rgba(237, 137, 54, 0.1);
    --status-warning-border: rgba(237, 137, 54, 0.3);

    --status-error: #fc8181;
    --status-error-bg: rgba(252, 129, 129, 0.1);
    --status-error-border: rgba(252, 129, 129, 0.3);

    --status-info: #4299e1;
    --status-info-bg: rgba(66, 153, 225, 0.1);
    --status-info-border: rgba(66, 153, 225, 0.3);

    --status-pending: #a0aec0;
    --status-pending-bg: rgba(160, 174, 192, 0.1);
    --status-pending-border: rgba(160, 174, 192, 0.3);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows - Enhanced Depth */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.35), 0 4px 8px rgba(0, 0, 0, 0.45);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.45), 0 8px 16px rgba(0, 0, 0, 0.5);
    --shadow-inner: inset 0 2px 6px rgba(0, 0, 0, 0.2);
    --shadow-glow-blue: 0 0 30px rgba(91, 141, 239, 0.4), 0 0 60px rgba(91, 141, 239, 0.2);
    --shadow-glow-purple: 0 0 30px rgba(167, 139, 250, 0.4), 0 0 60px rgba(167, 139, 250, 0.2);
    --shadow-glow-pink: 0 0 30px rgba(244, 114, 182, 0.4), 0 0 60px rgba(244, 114, 182, 0.2);
    --shadow-glow-teal: 0 0 30px rgba(45, 212, 191, 0.4), 0 0 60px rgba(45, 212, 191, 0.2);
    --shadow-glow-orange: 0 0 30px rgba(255, 140, 66, 0.4), 0 0 60px rgba(255, 140, 66, 0.2);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   RESET AND BASE STYLES
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.65;
    font-size: 0.9375rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* ============================================================================
   SCROLLBAR STYLING
   ============================================================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(19, 22, 28, 0.5);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
        rgba(120, 130, 145, 0.35) 0%,
        rgba(90, 100, 115, 0.25) 100%);
    border-radius: var(--radius-sm);
    border: 2px solid rgba(19, 22, 28, 0.5);
    transition: background var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
        rgba(140, 150, 165, 0.45) 0%,
        rgba(110, 120, 135, 0.35) 100%);
}

/* ============================================================================
   LAYOUT
   ============================================================================ */
#dashboard {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Header */
header {
    background: linear-gradient(135deg, rgba(26, 30, 38, 0.98) 0%, rgba(19, 22, 28, 0.98) 100%);
    color: var(--text-secondary);
    padding: 1rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 8px 32px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(91, 141, 239, 0.15);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(100, 110, 130, 0.04) 0%,
        rgba(80, 90, 110, 0.03) 50%,
        rgba(120, 130, 150, 0.04) 100%);
    pointer-events: none;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent-cyan) 20%,
        var(--accent-primary) 40%,
        var(--accent-purple) 60%,
        var(--accent-pink) 80%,
        transparent 100%);
    opacity: 0.7;
}

.header-content {
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.375rem;
    font-weight: 700;
    background: linear-gradient(180deg,
        #e8e8e8 0%,
        #f5f5f5 15%,
        #b8b8b8 30%,
        #6a6a6a 50%,
        #8a8a8a 60%,
        #d0d0d0 75%,
        #f0f0f0 85%,
        #c0c0c0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    letter-spacing: 0.02em;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.1))
            drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
    text-shadow: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#admin-email {
    color: var(--accent-primary);
    font-weight: 500;
    font-size: 0.9375rem;
    letter-spacing: 0.01em;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, rgba(19, 22, 28, 0.98) 0%, rgba(26, 30, 38, 0.98) 100%);
    border-right: 1px solid rgba(91, 141, 239, 0.12);
    overflow-y: auto;
    flex-shrink: 0;
    min-height: 0;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.35);
    position: relative;
    z-index: 50;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
        rgba(100, 110, 130, 0.02) 0%,
        rgba(80, 90, 110, 0.02) 50%,
        rgba(120, 130, 150, 0.02) 100%);
    pointer-events: none;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg,
        transparent 0%,
        var(--accent-cyan) 25%,
        var(--accent-primary) 50%,
        var(--accent-purple) 75%,
        transparent 100%);
    opacity: 0.4;
}

.sidebar nav {
    padding: 1rem 0;
}

.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar li {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-base);
    border-left: 3px solid transparent;
    position: relative;
    font-size: 0.9375rem;
    font-weight: 500;
    margin: 0.25rem 0.5rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg,
        rgba(91, 141, 239, 0.15) 0%,
        rgba(167, 139, 250, 0.08) 50%,
        transparent 100%);
    transition: width var(--transition-base);
    opacity: 0;
}

.nav-link:hover {
    background: linear-gradient(90deg,
        rgba(91, 141, 239, 0.12) 0%,
        rgba(167, 139, 250, 0.06) 50%,
        transparent 100%);
    color: var(--text-bright);
    transform: translateX(3px);
    border-left-color: rgba(91, 141, 239, 0.4);
}

.nav-link:hover::before {
    width: 100%;
    opacity: 1;
}

.nav-link.active {
    background: linear-gradient(90deg,
        rgba(91, 141, 239, 0.18) 0%,
        rgba(167, 139, 250, 0.08) 50%,
        transparent 100%);
    color: var(--text-heading);
    border-left-color: transparent;
    border-left-width: 3px;
    border-left-style: solid;
    border-image: linear-gradient(180deg, var(--accent-cyan), var(--accent-primary), var(--accent-purple)) 1;
    font-weight: 600;
    box-shadow: inset 0 0 24px rgba(91, 141, 239, 0.12),
                0 2px 8px rgba(91, 141, 239, 0.08);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, var(--accent-primary), var(--accent-purple));
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent-primary), 0 0 20px rgba(91, 141, 239, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        box-shadow: 0 0 12px var(--accent-primary), 0 0 20px rgba(91, 141, 239, 0.5);
    }
    50% {
        box-shadow: 0 0 16px var(--accent-primary), 0 0 30px rgba(91, 141, 239, 0.7);
    }
}

/* Main Content */
#main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    background: var(--bg-primary);
    min-height: 0;
    position: relative;
}

#main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    height: 100vh;
    background:
        radial-gradient(circle at 15% 30%, rgba(91, 141, 239, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(167, 139, 250, 0.05) 0%, transparent 45%),
        radial-gradient(circle at 50% 70%, rgba(45, 212, 191, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 85% 85%, rgba(244, 114, 182, 0.05) 0%, transparent 45%),
        radial-gradient(circle at 20% 90%, rgba(255, 140, 66, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
    animation: float-background 24s ease-in-out infinite;
}

@keyframes float-background {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

#main-content > * {
    position: relative;
    z-index: 1;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page h2 {
    margin-bottom: 2rem;
    color: var(--text-heading);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.page h3 {
    margin-bottom: 1.25rem;
    color: var(--text-bright);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

/* Page Actions */
.page-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ============================================================================
   METRIC CARDS
   ============================================================================ */
.metric-card, .dashboard-card {
    background: linear-gradient(135deg,
        rgba(19, 22, 28, 0.7) 0%,
        rgba(33, 38, 47, 0.85) 100%);
    border: 1px solid rgba(91, 141, 239, 0.15);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.metric-card::before,
.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--accent-cyan) 0%,
        var(--accent-primary) 33%,
        var(--accent-purple) 66%,
        var(--accent-pink) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.metric-card::after,
.dashboard-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle,
        rgba(91, 141, 239, 0.1) 0%,
        transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-slow);
    pointer-events: none;
}

.metric-card:hover,
.dashboard-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 40px rgba(91, 141, 239, 0.15);
    border-color: rgba(91, 141, 239, 0.35);
    background: linear-gradient(135deg,
        rgba(25, 29, 36, 0.9) 0%,
        rgba(38, 44, 54, 0.98) 100%);
}

.metric-card:hover::before,
.dashboard-card:hover::before {
    opacity: 1;
}

.metric-card:hover::after,
.dashboard-card:hover::after {
    opacity: 1;
}

.metric-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg,
        var(--accent-cyan) 0%,
        var(--accent-primary) 50%,
        var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(91, 141, 239, 0.3));
}

.metric-change {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Dashboard Cards */
.dashboard-card {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.dashboard-card h3 {
    font-size: 1rem;
    color: var(--text-bright);
    margin-bottom: 1rem;
    font-weight: 600;
}

.dashboard-card .count {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg,
        var(--accent-primary) 0%,
        var(--accent-purple) 50%,
        var(--accent-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 15px rgba(167, 139, 250, 0.3));
}

.dashboard-card .description {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .db-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    #main-content::before {
        left: 240px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 220px;
    }

    #main-content {
        padding: 1.5rem;
    }

    #main-content::before {
        left: 220px;
    }

    .page h2 {
        font-size: 1.625rem;
    }

    .header-content {
        padding: 0 1.25rem;
    }

    .header-content h1 {
        font-size: 1.25rem;
    }
}
