/* Global Theme Utility Classes */
.theme-bg { background-color: var(--bg) !important; }
.theme-text { color: var(--text-main) !important; }
.theme-text-muted { color: var(--text-muted) !important; }
.theme-card { background-color: var(--bg-card) !important; border-color: rgba(150, 150, 150, 0.1) !important; }

/* Apply Base Theme Automatically */
body {
    background-color: var(--bg) !important;
    color: var(--text-main) !important;
}

/* Global Glass Overrides for Theming */
.glass {
    background: var(--bg-card) !important;
    border-color: rgba(150, 150, 150, 0.1) !important;
    backdrop-filter: blur(20px) !important;
}

.glass-dark {
    background: var(--bg-card) !important;
    border-color: rgba(150, 150, 150, 0.2) !important;
    backdrop-filter: blur(24px) !important;
}

/* Override Hardcoded Tailwind Colors to Support Light Theme */
.text-white { color: var(--text-main) !important; }
/* Tailwind Text Color Overrides for Theming - Restored for Light/Dark adaptability */
.text-zinc-500, .text-slate-500, .text-gray-500, .text-zinc-600, .text-slate-600, .text-gray-600 { color: var(--text-muted) !important; }

/* Dark Theme: Brighter text for better readability while preserving theme tint */
body:not(.light) .text-zinc-400, body:not(.light) .text-slate-400, body:not(.light) .text-gray-400 { color: color-mix(in srgb, var(--text-muted) 85%, white) !important; }
body:not(.light) .text-zinc-300, body:not(.light) .text-slate-300, body:not(.light) .text-gray-300, body:not(.light) .text-zinc-200, body:not(.light) .text-slate-200, body:not(.light) .text-gray-200 { color: color-mix(in srgb, var(--text-muted) 65%, white) !important; }

/* Light Theme: Ensure ALL text is exceptionally dark (#000000) on white backgrounds */
.light .text-white,
.light .text-zinc-100, .light .text-slate-100, .light .text-gray-100, 
.light .text-zinc-200, .light .text-slate-200, .light .text-gray-200, 
.light .text-zinc-300, .light .text-slate-300, .light .text-gray-300, 
.light .text-zinc-400, .light .text-slate-400, .light .text-gray-400,
.light .text-zinc-500, .light .text-slate-500, .light .text-gray-500,
.light .text-zinc-600, .light .text-slate-600, .light .text-gray-600,
.light .text-zinc-700, .light .text-slate-700, .light .text-gray-700,
.light .text-zinc-800, .light .text-slate-800, .light .text-gray-800,
.light .text-zinc-900, .light .text-slate-900, .light .text-gray-900,
.light .theme-text, .light .theme-text-muted { 
    color: #000000 !important; 
}
.bg-\[\#030303\], .bg-obsidian-950, .bg-black, .bg-\[\#050505\], .bg-\[\#080808\] { background-color: var(--bg) !important; }
.bg-\[\#0a0a0a\], .bg-\[\#111111\], .bg-\[\#111\] { background-color: var(--bg-card) !important; }
.border-white\/5, .border-white\/10 { border-color: rgba(150, 150, 150, 0.1) !important; }
.border-white\/5, .border-white\/10 { border-color: rgba(150, 150, 150, 0.1) !important; }
.border-white\/5, .border-white\/10 { border-color: rgba(150, 150, 150, 0.1) !important; }

.border-white\/5, .border-white\/10 { border-color: rgba(150, 150, 150, 0.1) !important; }


/* Premium Gold Button */
.btn-gold {
    background: linear-gradient(135deg, #D4AF37 0%, #AA8222 100%);
    color: #030303;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 4px 15px -3px rgba(212,175,55,0.4);
    border: 1px solid #F9E5A3;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.btn-gold:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 12px 30px -5px rgba(212,175,55,0.6);
    filter: brightness(1.15);
}

/* Gold Gradient Text Utility */
.text-gradient-gold {
    background: linear-gradient(to right, #F9E5A3, #D4AF37, #AA8222, #F9E5A3);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% auto;
    animation: shine 6s linear infinite;
}

@keyframes shine {
    to { background-position: 200% center; }
}

.bg-grid-pattern {
    background-image: linear-gradient(to right, rgba(212, 175, 55, 0.05) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(212, 175, 55, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at center, black, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black, transparent 80%);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #030303; 
}
::-webkit-scrollbar-thumb {
    background: #1a1a1a; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #D4AF37; 
}

/* Base and utilities extracted from header */
body { font-family: var(--font-main); background-color: var(--bg); color: #a1a1aa; }
.royal-font { font-family: var(--font-royal); }
.mono { font-family: 'JetBrains Mono', monospace; }

.gold-gradient {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 50%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gold-bg {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 50%, var(--primary-dark) 100%);
    color: var(--text-on-primary) !important;
}

.btn-gold-premium {
    background: linear-gradient(135deg, #F9E5A3 0%, #D4AF37 50%, #AA8222 100%) !important;
    color: #000000 !important;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3) !important;
    transition: all 0.3s ease !important;
}
.btn-gold-premium:hover {
    background: linear-gradient(135deg, #ffffff 0%, #F9E5A3 100%) !important;
    color: #000000 !important;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.45) !important;
    transform: translateY(-2px) !important;
}

.gold-glow { box-shadow: 0 0 50px -15px rgba(var(--primary-rgb),0.5); }

.glass {
    background: rgba(25, 25, 25, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Static Premium Badges for Course Cards */
.static-badge-bestseller {
    background: linear-gradient(135deg, #D4AF37 0%, #AA8222 100%);
    color: #000;
    border: 1px solid #F9E5A3;
}
.static-badge-category {
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: var(--primary);
}
.static-badge-rating {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--primary);
}

/* Light Theme Badge Overrides */
.light .static-badge-category,
.light .static-badge-rating {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    color: #b45309 !important;
}

/* Light Theme Card Borders */
.light .theme-card {
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.04) !important;
}

.static-gold-star {
    color: #D4AF37;
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.5));
}
.static-gold-dot {
    background: #D4AF37;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.8);
}

/* Light Theme Utilities for Membership Section */
.light .bg-emerald-950\/40 { background-color: #d1fae5 !important; border-color: #34d399 !important; }
.light .text-emerald-400 { color: #059669 !important; }
.light .bg-rose-500\/10 { background-color: #ffe4e6 !important; border-color: #fca5a5 !important; }
.light .text-rose-400 { color: #e11d48 !important; }
.light .bg-amber-500\/10 { background-color: #fef3c7 !important; border-color: #fcd34d !important; }
.light .text-amber-400 { color: #d97706 !important; }

/* Light Theme Premium Badges */
.light .badge-premium-gold, .light .badge-premium-silver {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
    color: #ffffff !important;
}
.light .badge-premium-bronze {
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%) !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
}

/* Membership Tier Buttons */
.btn-bronze {
    background: linear-gradient(135deg, #f0d5b6 0%, #cd7f32 50%, #8c5a24 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.3) !important;
    border: 1px solid #eaddcf !important;
    transition: all 0.3s ease !important;
}
.btn-bronze:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(205, 127, 50, 0.4) !important;
    filter: brightness(1.1) !important;
}

.btn-silver {
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 50%, #94a3b8 100%) !important;
    color: #0f172a !important;
    box-shadow: 0 4px 15px rgba(148, 163, 184, 0.3) !important;
    border: 1px solid #ffffff !important;
    transition: all 0.3s ease !important;
}
.btn-silver:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(148, 163, 184, 0.4) !important;
    filter: brightness(1.05) !important;
}

/* Refine Gold Buttons to look more luxurious (deep brown text, brighter gold) */
.btn-gold, .btn-gold-premium {
    background: linear-gradient(135deg, #F9E5A3 0%, #D4AF37 50%, #c49320 100%) !important;
    color: #451a03 !important; /* Deep luxury brown instead of harsh black */
    border: 1px solid #F9E5A3 !important;
}

/* Remove hardcoded dark gradients in Light Theme for premium cards */
.light .bg-gradient-to-b, 
.light .bg-gradient-to-br { 
    background-image: none !important; 
    background-color: var(--bg-card) !important;
}

/* Fix heavy shadows on glass-dark cards (like Image Gallery) in Light Theme */
.light .glass-dark {
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.08) !important;
}

/* Light Theme Scrollbar Overrides */
.light::-webkit-scrollbar-track, 
.light *::-webkit-scrollbar-track {
    background: #f8fafc; 
}
.light::-webkit-scrollbar-thumb, 
.light *::-webkit-scrollbar-thumb {
    background: #cbd5e1; 
    border-radius: 4px;
}
.light::-webkit-scrollbar-thumb:hover, 
.light *::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; 
}

/* Cinematic Text Overlay for Image Cards */
.text-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 60%, transparent 100%) !important;
}

/* Light Theme: Soften heavy shadows on cards */
.light .shadow-2xl {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08) !important;
}

/* Theme-aware Role Text */
.theme-role-text { color: var(--primary); opacity: 0.8; }
.light .theme-role-text { color: #92400e !important; opacity: 1; }

/* ---------------------------------------------------
   LIGHT THEME: HIGH-CONTRAST LUXURY OVERRIDES
   Converts bright yellow gold into sophisticated deep bronze
------------------------------------------------------ */

.light .btn-gold,
.light .btn-gold-premium {
    background: linear-gradient(135deg, #b45309 0%, #78350F 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(120,53,15,0.2) !important;
    border: none !important;
}

.light .gold-bg {
    background: linear-gradient(135deg, #F9E5A3 0%, #D4AF37 50%, #AA8222 100%) !important;
    color: #000000 !important;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3) !important;
}

.light .text-gradient-gold {
    background: linear-gradient(to right, #92400e, #78350F, #b45309, #92400e) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
    background-size: 200% auto !important;
}

.light .shadow-gold-glow {
    box-shadow: 0 0 30px rgba(120,53,15,0.1) !important;
}

.light .static-gold-star,
.light .text-primary-light,
.light .text-gold-400,
.light .text-gold-500,
.light .text-gold-600 {
    color: #92400e !important;
}

.light .static-gold-dot {
    background: #92400e !important;
    box-shadow: 0 0 8px rgba(120,53,15,0.2) !important;
}

.light .static-badge-bestseller {
    background: linear-gradient(135deg, #92400e 0%, #78350F 100%) !important;
    color: #ffffff !important;
    border: none !important;
}

.light .text-\[\#D4AF37\] {
    color: #92400e !important;
}

/* ---------------------------------------------------
   LIGHT THEME: COURSE CARDS FIX
   Overrides dark muddy backgrounds & hardcoded gradients
------------------------------------------------------ */

.light .course-card-elite {
    background: var(--bg-card) !important;
    border-color: rgba(0,0,0,0.08) !important;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.08) !important;
}

.light .course-card-elite:hover {
    border-color: rgba(146, 64, 14, 0.3) !important; 
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.12), 0 0 20px -5px rgba(146, 64, 14, 0.1) !important;
}

.light .course-image-overlay {
    background: linear-gradient(to top, var(--bg-card) 0%, transparent 50%, transparent 100%) !important;
}

.light .to-\[\#0a0a0a\] {
    --tw-gradient-to: var(--bg-card) var(--tw-gradient-to-position) !important;
}

.light .bg-white\/5 { background-color: rgba(0,0,0,0.03) !important; }
.light .border-white\/5 { border-color: rgba(0,0,0,0.05) !important; }
.light .border-white\/10 { border-color: rgba(0,0,0,0.08) !important; }
.light .bg-black\/60,
.light .bg-\[\#050505\] { background-color: var(--bg-card) !important; }

/* Fix muddy dimmed images inside cards for Light Theme */
.light .bg-black\/50 {
    background-color: var(--bg-card) !important;
}
.light .bg-black\/50 img.opacity-60 {
    opacity: 1 !important;
}

/* Elevate Directory Category Icons in Light Theme */
.light .bg-amber-500\/10 {
    background-color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15) !important;
}

/* Fix dark modals and password screens in Light Theme */
.light .glass-premium {
    background: var(--bg-card) !important;
    border-color: rgba(0,0,0,0.1) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
}

/* Improve red badge legibility in Light Theme (used in course discount tags) */
.light .text-red-400 { color: #dc2626 !important; }
.light .bg-red-900\/30,
.light .bg-red-950\/30 { 
    background-color: rgba(220, 38, 38, 0.1) !important; 
    border-color: rgba(220, 38, 38, 0.2) !important; 
}
