/* 
   Modern Theme - YellowSystem V2
   Focus: Glassmorphism, Premium UI, Dark Mode, Smooth Animations
*/

:root {
    /* --- Brand Colors (More Vibrant) --- */
    --primary-hue: 45;
    /* Yellow */
    --primary: hsl(var(--primary-hue), 95%, 50%);
    /* #FFC400 */
    --primary-hover: hsl(var(--primary-hue), 100%, 45%);
    --primary-soft: hsl(var(--primary-hue), 90%, 90%);

    --secondary-hue: 220;
    /* Blue/Gray */
    --secondary: hsl(var(--secondary-hue), 15%, 25%);

    --success: #00C851;
    --danger: #ff4444;
    --warning: #ffbb33;
    --info: #33b5e5;

    /* --- Light Mode Base --- */
    --bg-body: #f3f4f6;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-panel: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: rgba(0, 0, 0, 0.08);

    /* --- Shadows & Effects --- */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.1);
    --glass-blur: blur(12px);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* --- Transitions --- */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Dark Mode Override --- */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-glass: rgba(17, 24, 39, 0.75);
    --bg-panel: #1e293b;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.08);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* --- Global Resets & Typography Enhancements --- */
body {
    background-color: var(--bg-body);
    font-family: 'Inter', 'Roboto', sans-serif;
    /* Modern stack */
    color: var(--text-main);
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    letter-spacing: -0.025em;
    /* Tighter heading tracking */
    color: var(--text-main);
}

/* --- Glassmorphism Utilities --- */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    /* Safari */
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
}

.glass-card {
    background: var(--bg-panel);
    /* Fallback or opacity layer */
    background: linear-gradient(145deg, var(--bg-panel), rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

[data-theme="dark"] .glass-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(30, 41, 59, 0.6));
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

/* --- Premium Buttons --- */
.btn-premium {
    background: linear-gradient(135deg, var(--primary) 0%, #ffab00 100%);
    color: #1a1a1a;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 15px rgba(255, 196, 0, 0.3);
    transition: all var(--transition-fast);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 196, 0, 0.4);
}

.btn-premium:active {
    transform: scale(0.98);
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

/* --- Admin Layout Fixes --- */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 70px);
    background: var(--bg-body);
}

.admin-content {
    flex: 1;
    padding: 2rem;
    overflow-x: hidden;
}

/* --- Stats Grid --- */
.stats-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stat-icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(var(--primary-hue), 0.1);
    /* color would need specific handling or helper classes for specific colors */
}

/* Typography for stats */
.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 0.5rem;
    color: var(--text-main);
    background: -webkit-linear-gradient(45deg, var(--text-main), var(--text-muted));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Optional artistic effect */
}

.stat-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* --- Utility Classes (Tailwind-ish) --- */
.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-start {
    align-items: flex-start;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-3xl {
    font-size: 1.875rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.text-primary {
    color: var(--primary);
}

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

.hover\:underline:hover {
    text-decoration: underline;
}

/* --- Sidebar Modernization --- */
.sidebar {
    background-color: var(--bg-panel);
    /* Override existing color */
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    /* Reset Fixed Position from style.css */
    position: relative !important;
    height: auto !important;
    min-height: 100%;
    flex-shrink: 0;
    z-index: 100;
}

/* Hide Mobile Elements on Desktop */
@media (min-width: 900px) {

    .sidebar-header-mobile,
    .close-sidebar-btn {
        display: none !important;
    }
}

.sidebar-header-mobile {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.close-sidebar-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}


.sidebar .menu-item a {
    color: var(--text-main);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.sidebar .menu-item a:hover {
    background-color: var(--bg-body);
    color: var(--primary-hover);
    transform: translateX(4px);
}

.sidebar .menu-item.active a {
    background: linear-gradient(90deg, rgba(var(--primary-hue), 0.15) 0%, rgba(var(--primary-hue), 0.05) 100%);
    border-left: 4px solid var(--primary);
    color: var(--primary-hover);
}

[data-theme="dark"] .sidebar {
    background-color: var(--bg-panel);
    border-right-color: var(--border-color);
}

/* --- Select2 Dark Mode & Modernization --- */
.select2-container .select2-selection--single {
    height: 42px !important;
}

.select2-container--default .select2-selection--single {
    background-color: var(--bg-panel) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    outline: none;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-main) !important;
    line-height: 40px !important;
    padding-left: 1rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
}

.select2-dropdown {
    background-color: var(--bg-panel) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius-sm) !important;
    z-index: 9999;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--bg-body) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    color: var(--text-main) !important;
    outline: none;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--primary) !important;
    color: #000 !important;
}

.select2-container--default .select2-results__option {
    color: var(--text-main) !important;
    padding: 8px 12px !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: var(--primary-soft) !important;
    color: var(--text-main) !important;
}

/* Fix Focus Ring */
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--primary) !important;
}