@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;700;900&display=swap');

:root {
    /* Common Vars */
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
}

/* === DARK MODE CONFIGURATION (Default if .dark class is present) === */
html.dark {
    --page-bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.4);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(15, 23, 42, 0.6);
}

html.dark body {
    background-color: var(--page-bg);
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(56, 189, 248, 0.15) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    color: var(--text-main);
}

/* Dark Mode Global Overrides */
html.dark .text-gray-900 {
    color: #f1f5f9 !important;
}

html.dark .text-gray-800 {
    color: #e2e8f0 !important;
}

html.dark .text-gray-700 {
    color: #cbd5e1 !important;
}

html.dark .text-gray-600 {
    color: #94a3b8 !important;
}

html.dark .text-gray-500 {
    color: #64748b !important;
}

html.dark .bg-white {
    background-color: rgba(30, 41, 59, 0.6) !important;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

html.dark .bg-gray-50 {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

html.dark .bg-gray-100 {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-gray-300,
html.dark .border-gray-400 {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html.dark input,
html.dark textarea,
html.dark select,
html.dark .form-control {
    background-color: var(--input-bg) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html.dark #sidebar {
    background: rgba(15, 23, 42, 0.7) !important;
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark #sidebar .bg-white {
    background: transparent !important;
}

html.dark #sidebar .text-gray-700 {
    color: #e2e8f0 !important;
}


/* === LIGHT MODE CONFIGURATION (Total White / No Gray) === */
html:not(.dark) {
    --page-bg: #ffffff;
    /* Absolute White */
    --card-bg: #ffffff;
    --text-main: #000000;
    --text-muted: #404040;
    /* Dark Charcoal instead of Gray */
    --border-color: #f0f0f0;
    /* Ultra light border just for structure */
    --input-bg: #ffffff;
}

html:not(.dark) body {
    background-color: #ffffff;
    background-image: none;
    /* No gradients, purely white */
    color: var(--text-main);
}

/* Light Mode Glass Effects - Cleaned Up */
html:not(.dark) .glass {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    /* Minimal shadow */
}

html:not(.dark) .glass-card {
    background: #ffffff;
    border: 1px solid #f5f5f5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

html:not(.dark) .glass-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    background: #ffffff;
    border-color: #e5e5e5;
}

/* Light Mode Sidebar */
html:not(.dark) #sidebar {
    background: #ffffff !important;
    border-right: 1px solid #f5f5f5 !important;
    box-shadow: none;
    /* Removed shadow for cleaner look */
}

html:not(.dark) #sidebar .text-gray-300 {
    color: #525252 !important;
}

html:not(.dark) #sidebar .bg-white {
    background: #ffffff !important;
}

/* Light Mode Inputs */
html:not(.dark) input,
html:not(.dark) select,
html:not(.dark) textarea,
html:not(.dark) .form-control {
    background-color: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
    color: #000000 !important;
    box-shadow: none;
}

html:not(.dark) input:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1) !important;
}

/* Force removal of gray backgrounds in Light Mode */
html:not(.dark) .bg-gray-50,
html:not(.dark) .bg-gray-100 {
    background-color: #ffffff !important;
    /* Make them white */
    border: 1px solid #f5f5f5;
    /* Add subtle border instead of background color */
}

/* Common Typography & Utilities */
body {
    background-attachment: fixed;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-family: 'Inter', sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

/* Neon utilities mostly for Dark Mode, but safe to keep */
.glow-text {
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

html.dark ::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

html:not(.dark) ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Gamification */
.badge-frame {
    position: relative;
    padding: 2px;
    border-radius: 999px;
    background: linear-gradient(45deg, #6366f1, #ec4899);
}

.bg-dark-900 {
    background-color: #0f172a !important;
    color: white;
}

/* Keep specifically if used explicitly */