/**
 * GDSTJUV.CN Professional Theme System
 * Based on Tailwind CSS Zinc + Blue Color Palette
 *
 * Design References:
 * - Linear App (https://linear.app) - Neutral gray + minimal color
 * - GitHub Primer (https://primer.style) - Professional design system
 * - Tailwind CSS (https://tailwindcss.com/docs/colors) - Zinc neutral scale
 * - shadcn/ui (https://ui.shadcn.com/colors) - Professional components
 *
 * Color Philosophy:
 * - Zinc: Pure neutral gray without color cast
 * - Blue: Professional, trustworthy accent color
 * - Minimal: Reduce color noise, maximize clarity
 */

/* ============================================
   CSS Variables - Theme System
   ============================================ */

:root {
    /* Transition for smooth theme switching */
    --theme-transition: 0.2s ease;

    /* Brand Color - Professional Blue */
    --brand-primary: var(--accent-primary);
    --brand-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
    --brand-gradient-subtle: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
}

/* ============================================
   Light Theme (Professional Light) - Default
   Zinc Scale: White to Zinc-200
   ============================================ */
:root,
[data-theme="light"] {
    /* Background Layers - Clean Whites */
    --bg-base: #ffffff;
    --bg-subtle: #fafafa;      /* zinc-50 */
    --bg-muted: #f4f4f5;       /* zinc-100 */
    --bg-emphasis: #e4e4e7;    /* zinc-200 */

    /* Surface Colors */
    --bg-surface0: #ffffff;
    --bg-surface1: #fafafa;
    --bg-surface2: #f4f4f5;
    --bg-mantle: #fafafa;
    --bg-crust: #f4f4f5;

    /* Text Colors - High Contrast */
    --text-primary: #18181b;   /* zinc-900 */
    --text-secondary: #3f3f46; /* zinc-700 */
    --text-tertiary: #52525b;  /* zinc-600 */
    --text-muted: #71717a;     /* zinc-500 */
    --text-subtle: #a1a1aa;    /* zinc-400 */
    --text-inverse: #fafafa;   /* zinc-50 */

    /* Accent Colors - Professional Blue */
    --accent-primary: #2563eb;   /* blue-600 - Main accent */
    --accent-hover: #1d4ed8;     /* blue-700 - Hover state */
    --accent-active: #1e40af;    /* blue-800 - Active state */
    --accent-muted: #dbeafe;     /* blue-100 - Subtle background */
    --accent-subtle: #eff6ff;    /* blue-50 - Very subtle */

    /* Secondary Accents */
    --accent-success: #16a34a;   /* green-600 */
    --accent-warning: #ca8a04;   /* yellow-600 */
    --accent-error: #dc2626;     /* red-600 */
    --accent-info: #0284c7;      /* sky-600 */

    /* UI Colors */
    --overlay0: #d4d4d8;       /* zinc-300 */
    --overlay1: #a1a1aa;       /* zinc-400 */
    --overlay2: #71717a;       /* zinc-500 */

    /* Borders */
    --border-default: #e4e4e7; /* zinc-200 */
    --border-muted: #f4f4f5;   /* zinc-100 */
    --border-strong: #d4d4d8;  /* zinc-300 */
    --border-accent: var(--accent-primary);

    /* Shadows - Subtle */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);

    /* Card */
    --card-bg: #ffffff;
    --card-border: #e4e4e7;
    --card-shadow: var(--shadow-md);
    --card-hover-shadow: var(--shadow-lg);

    /* Input */
    --input-bg: #ffffff;
    --input-border: #d4d4d8;
    --input-focus-border: var(--accent-primary);
    --input-placeholder: #a1a1aa;

    /* Button */
    --btn-primary-bg: var(--accent-primary);
    --btn-primary-hover: var(--accent-hover);
    --btn-primary-text: #ffffff;
    --btn-secondary-bg: #f4f4f5;
    --btn-secondary-hover: #e4e4e7;
    --btn-secondary-text: #3f3f46;

    /* Navbar */
    --navbar-bg: #ffffff;
    --navbar-border: #e4e4e7;
    --navbar-text: #18181b;
    --navbar-text-muted: #71717a;

    /* Hero Section */
    --hero-bg: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
    --hero-accent-bg: var(--brand-gradient);

    /* Footer - Dark footer on light theme */
    --footer-bg: #18181b;
    --footer-text: #f4f4f5;
    --footer-text-muted: #a1a1aa;
}

/* ============================================
   Dark Theme (Professional Dark)
   Zinc Scale: Zinc-950 to Zinc-700
   ============================================ */
[data-theme="dark"] {
    /* Background Layers - Deep Neutrals */
    --bg-base: #09090b;        /* zinc-950 */
    --bg-subtle: #18181b;      /* zinc-900 */
    --bg-muted: #27272a;       /* zinc-800 */
    --bg-emphasis: #3f3f46;    /* zinc-700 */

    /* Surface Colors */
    --bg-surface0: #18181b;    /* zinc-900 */
    --bg-surface1: #27272a;    /* zinc-800 */
    --bg-surface2: #3f3f46;    /* zinc-700 */
    --bg-mantle: #09090b;      /* zinc-950 */
    --bg-crust: #09090b;       /* zinc-950 */

    /* Text Colors - High Contrast */
    --text-primary: #fafafa;   /* zinc-50 */
    --text-secondary: #e4e4e7; /* zinc-200 */
    --text-tertiary: #d4d4d8;  /* zinc-300 */
    --text-muted: #a1a1aa;     /* zinc-400 */
    --text-subtle: #71717a;    /* zinc-500 */
    --text-inverse: #18181b;   /* zinc-900 */

    /* Accent Colors - Brighter Blue for Dark Mode */
    --accent-primary: #3b82f6;   /* blue-500 */
    --accent-hover: #60a5fa;     /* blue-400 */
    --accent-active: #2563eb;    /* blue-600 */
    --accent-muted: #1e3a8a;     /* blue-900 */
    --accent-subtle: #172554;    /* blue-950 */

    /* Secondary Accents */
    --accent-success: #22c55e;   /* green-500 */
    --accent-warning: #eab308;   /* yellow-500 */
    --accent-error: #ef4444;     /* red-500 */
    --accent-info: #0ea5e9;      /* sky-500 */

    /* UI Colors */
    --overlay0: #52525b;       /* zinc-600 */
    --overlay1: #71717a;       /* zinc-500 */
    --overlay2: #a1a1aa;       /* zinc-400 */

    /* Borders */
    --border-default: #27272a; /* zinc-800 */
    --border-muted: #18181b;   /* zinc-900 */
    --border-strong: #3f3f46;  /* zinc-700 */
    --border-accent: var(--accent-primary);

    /* Shadows - Deeper */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.2);

    /* Card */
    --card-bg: #18181b;
    --card-border: #27272a;
    --card-shadow: var(--shadow-md);
    --card-hover-shadow: var(--shadow-glow);

    /* Input */
    --input-bg: #18181b;
    --input-border: #3f3f46;
    --input-focus-border: var(--accent-primary);
    --input-placeholder: #71717a;

    /* Button */
    --btn-primary-bg: var(--accent-primary);
    --btn-primary-hover: var(--accent-hover);
    --btn-primary-text: #ffffff;
    --btn-secondary-bg: #27272a;
    --btn-secondary-hover: #3f3f46;
    --btn-secondary-text: #e4e4e7;

    /* Navbar */
    --navbar-bg: #09090b;
    --navbar-border: #27272a;
    --navbar-text: #fafafa;
    --navbar-text-muted: #a1a1aa;

    /* Hero Section */
    --hero-bg: linear-gradient(180deg, #09090b 0%, #18181b 100%);
    --hero-accent-bg: var(--brand-gradient);

    /* Footer */
    --footer-bg: #09090b;
    --footer-text: #d4d4d8;
    --footer-text-muted: #71717a;
}

/* ============================================
   Base Styles
   ============================================ */
* {
    transition: background-color var(--theme-transition),
                border-color var(--theme-transition),
                color var(--theme-transition);
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
}

p {
    color: var(--text-secondary);
    line-height: 1.6;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--theme-transition);
}

a:hover {
    color: var(--accent-hover);
}

.text-muted {
    color: var(--text-muted) !important;
}

/* ============================================
   Navbar - Clean Professional Style
   ============================================ */
.navbar-theme {
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--navbar-border);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.navbar-theme .navbar-brand {
    color: var(--navbar-text) !important;
    font-weight: 700;
    font-size: 1.1rem;
}

.navbar-theme .nav-link {
    color: var(--navbar-text-muted) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.navbar-theme .nav-link:hover {
    color: var(--navbar-text) !important;
    background: var(--bg-muted);
}

.navbar-theme .nav-link.active {
    color: var(--accent-primary) !important;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-muted);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 1rem;
}

.theme-toggle:hover {
    background: var(--bg-emphasis);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

/* ============================================
   Cards - Clean and Minimal
   ============================================ */
.card-theme {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: all 0.2s ease;
}

.card-theme:hover {
    box-shadow: var(--card-hover-shadow);
    border-color: var(--border-strong);
}

/* Resource Card Specific */
.resource-card-theme {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.2s ease;
    position: relative;
    height: 100%;
}

.resource-card-theme:hover {
    box-shadow: var(--card-hover-shadow);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.resource-card-theme .resource-cover {
    background: var(--accent-muted);
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--accent-primary);
    position: relative;
    overflow: hidden;
}

/* File type icon in cover */
.resource-card-theme .resource-cover::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: var(--accent-primary);
    opacity: 0.05;
    border-radius: 50%;
}

.resource-card-theme .resource-body {
    padding: 1.25rem;
}

.resource-card-theme .resource-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.resource-card-theme .resource-meta {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ============================================
   Buttons - Professional Style
   ============================================ */
.btn-theme-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-theme-primary:hover {
    background: var(--btn-primary-hover);
    color: var(--btn-primary-text);
    transform: translateY(-1px);
}

.btn-theme-secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border: 1px solid var(--border-default);
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-theme-secondary:hover {
    background: var(--btn-secondary-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-theme-gradient {
    background: var(--brand-gradient);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-theme-gradient:hover {
    opacity: 0.9;
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* ============================================
   Forms - Clean Input Style
   ============================================ */
.form-control-theme {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-control-theme::placeholder {
    color: var(--input-placeholder);
}

.form-control-theme:focus {
    background: var(--input-bg);
    border-color: var(--input-focus-border);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* ============================================
   Category Pills - Minimal Style
   ============================================ */
.category-pill-theme {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-pill-theme:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-subtle);
}

.category-pill-theme.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* ============================================
   Hero Section - Professional Clean Style
   ============================================ */
.hero-theme {
    background: var(--hero-bg);
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-default);
}

/* Subtle grid pattern */
.hero-theme::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(var(--border-default) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-default) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.3;
}

/* Blue accent glow */
.hero-theme::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -25%;
    width: 50%;
    height: 100%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-theme h1 {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 2.5rem;
    position: relative;
    z-index: 1;
}

.hero-theme .hero-subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
    position: relative;
    z-index: 1;
}

/* Hero Icon */
.hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--accent-muted);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.hero-icon i {
    font-size: 1.75rem;
    color: var(--accent-primary);
}

/* Search Box in Hero */
.search-box-theme {
    background: var(--card-bg);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 0.375rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.search-box-theme .form-control {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
}

.search-box-theme .form-control::placeholder {
    color: var(--text-muted);
}

.search-box-theme .form-control:focus {
    box-shadow: none;
}

.search-box-theme .btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
}

.search-box-theme .btn:hover {
    background: var(--accent-hover);
    color: white;
}

/* ============================================
   Section Titles
   ============================================ */
.section-title-theme {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.section-title-theme::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 2px;
}

/* ============================================
   File Type Badges - Minimal
   ============================================ */
.file-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.file-badge-pdf {
    background: rgba(220, 38, 38, 0.1);
    color: var(--accent-error);
}

.file-badge-doc {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-primary);
}

.file-badge-video {
    background: rgba(147, 51, 234, 0.1);
    color: #9333ea;
}

.file-badge-zip {
    background: rgba(234, 179, 8, 0.1);
    color: var(--accent-warning);
}

.file-badge-image {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-success);
}

/* ============================================
   Footer - Clean Dark Style
   ============================================ */
.footer-theme {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 2rem 0;
    border-top: 1px solid var(--border-default);
}

.footer-theme a {
    color: var(--footer-text);
    transition: color 0.2s ease;
}

.footer-theme a:hover {
    color: var(--accent-primary);
}

/* ============================================
   Alerts & Status
   ============================================ */
.alert-theme-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--accent-success);
    border-radius: 8px;
}

.alert-theme-warning {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.2);
    color: var(--accent-warning);
    border-radius: 8px;
}

.alert-theme-error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: var(--accent-error);
    border-radius: 8px;
}

.alert-theme-info {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    color: var(--accent-info);
    border-radius: 8px;
}

/* ============================================
   Scrollbar - Minimal Style
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-subtle);
}

::-webkit-scrollbar-thumb {
    background: var(--overlay0);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--overlay1);
}

/* ============================================
   Utility Classes
   ============================================ */
.bg-base { background-color: var(--bg-base) !important; }
.bg-subtle { background-color: var(--bg-subtle) !important; }
.bg-muted { background-color: var(--bg-muted) !important; }
.bg-surface { background-color: var(--bg-surface0) !important; }
.bg-card { background-color: var(--card-bg) !important; }

.text-accent { color: var(--accent-primary) !important; }
.text-secondary-theme { color: var(--text-secondary) !important; }
.text-muted-theme { color: var(--text-muted) !important; }

.border-accent { border-color: var(--accent-primary) !important; }
.border-default { border-color: var(--border-default) !important; }

/* ============================================
   Info Grid - Detail Page
   ============================================ */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-subtle);
    border-radius: 8px;
    border: 1px solid var(--border-default);
}

.info-item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-muted);
    border-radius: 8px;
    color: var(--accent-primary);
}

.info-item-content {
    flex: 1;
}

.info-item-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.125rem;
}

.info-item-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-muted);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 2rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .hero-theme {
        padding: 2.5rem 0 2rem;
    }

    .hero-theme h1 {
        font-size: 1.75rem;
    }

    .hero-theme .hero-subtitle {
        font-size: 1rem;
    }

    .category-pill-theme {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }

    .resource-card-theme .resource-cover {
        height: 120px;
        font-size: 2.5rem;
    }

    .section-title-theme {
        font-size: 1.25rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .navbar-theme,
    .theme-toggle,
    .footer-theme {
        display: none !important;
    }
}
