/* ==========================================================================
   MohDaggane Academy - Dark Theme System (Inspired by Modern Developer Platforms)
   Guarantees 100% styled components without relying on uncompiled Tailwind classes
   ========================================================================== */

:root {
    --dark-bg: #080c16;
    --dark-bg-alt: #0d1322;
    --dark-surface: #0f172a;
    --dark-card: rgba(15, 23, 42, 0.85);
    --dark-border: rgba(255, 255, 255, 0.09);
    --dark-border-hover: rgba(56, 189, 248, 0.45);
    --neon-blue: #3b82f6;
    --neon-cyan: #06b6d4;
    --neon-indigo: #6366f1;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}

/* Page Base */
body.dark-mode {
    background-color: var(--dark-bg) !important;
    color: var(--text-primary) !important;
    font-family: 'Figtree', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.dark-page-container {
    background-color: var(--dark-bg);
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

/* Background Ambient Glow & Developer Grid */
.dark-page-bg {
    background-color: var(--dark-bg);
    background-image: 
        radial-gradient(ellipse 90% 60% at 50% -10%, rgba(37, 99, 235, 0.16) 0%, transparent 70%),
        radial-gradient(circle 500px at 5% 25%, rgba(6, 182, 212, 0.09) 0%, transparent 60%),
        radial-gradient(circle 600px at 95% 65%, rgba(99, 102, 241, 0.1) 0%, transparent 60%),
        linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 100% auto, auto, auto, 36px 36px, 36px 36px;
    background-attachment: scroll;
}

/* Navbar */
header.dark-navbar {
    background: rgba(8, 12, 22, 0.88) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    border-bottom: 1px solid var(--dark-border) !important;
    transition: background 0.3s ease;
}

.dark-navbar a.dark-brand {
    color: #ffffff !important;
    font-weight: 700;
}

.dark-navbar .dark-nav-link {
    color: #94a3b8 !important;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dark-navbar .dark-nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.06);
}

.dark-navbar .dark-nav-link.active {
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.12);
}

.dark-mobile-menu {
    background: #080c16 !important;
    border-top: 1px solid var(--dark-border) !important;
}

.dark-mobile-menu a {
    color: #cbd5e1 !important;
    padding: 8px 12px;
}

.dark-mobile-menu a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.05);
}

/* Hero Section */
.dark-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 9999px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    backdrop-filter: blur(8px);
}

.dark-hero-badge .pulse-dot {
    position: relative;
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22d3ee;
    box-shadow: 0 0 10px #22d3ee;
}

.dark-hero-title {
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

@media (min-width: 640px) {
    .dark-hero-title {
        font-size: 3.25rem;
    }
}

@media (min-width: 1024px) {
    .dark-hero-title {
        font-size: 3.75rem;
    }
}

.dark-gradient-text {
    background: linear-gradient(135deg, #60a5fa 0%, #22d3ee 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dark-hero-subtitle {
    color: #94a3b8;
    font-size: 1.125rem;
    line-height: 1.7;
    margin-top: 1.25rem;
}

/* Buttons */
.dark-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%) !important;
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 15px;
    border: none !important;
    box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.45);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
}

.dark-btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -4px rgba(37, 99, 235, 0.65);
    color: #ffffff !important;
}

.dark-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(30, 41, 59, 0.6) !important;
    color: #e2e8f0 !important;
    font-weight: 600;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 15px;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: blur(8px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
}

.dark-btn-outline:hover {
    background: rgba(51, 65, 85, 0.8) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-2px);
}

/* Stats Counter */
.dark-stat-val {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

.dark-stat-lbl {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 4px;
}

/* Glassmorphism Cards */
.dark-card {
    background: rgba(15, 23, 42, 0.78) !important;
    border: 1px solid var(--dark-border) !important;
    border-radius: 16px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.dark-card:hover {
    border-color: var(--dark-border-hover) !important;
    box-shadow: 0 16px 36px -8px rgba(37, 99, 235, 0.22);
    transform: translateY(-4px);
}

.dark-step-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dark-step-card .dark-step-header {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.2) 100%);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dark-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #6366f1);
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Feature Rows */
.dark-feature-frame {
    background: rgba(15, 23, 42, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.5);
    transition: border-color 0.3s ease;
}

.dark-feature-frame:hover {
    border-color: rgba(56, 189, 248, 0.35) !important;
}

.dark-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

/* Course Cards in Dark Mode */
.dark-course-card {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.dark-course-card:hover {
    border-color: rgba(59, 130, 246, 0.45) !important;
    transform: translateY(-4px);
    box-shadow: 0 16px 36px -8px rgba(37, 99, 235, 0.25);
}

.dark-course-card h3 a {
    color: #ffffff !important;
    transition: color 0.2s;
}

.dark-course-card h3 a:hover {
    color: #38bdf8 !important;
}

.dark-course-card p {
    color: #94a3b8;
}

.dark-course-card .dark-cat-badge {
    background: rgba(56, 189, 248, 0.14);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

/* AI Tutor Terminal Window */
.dark-terminal-card {
    background: #090e1a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.dark-terminal-bar {
    background: #060912;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dark-mac-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dark-chat-body {
    background: #070b14;
    height: 320px;
    overflow-y: auto;
    padding: 20px;
}

.dark-bubble-bot {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border-radius: 16px;
    border-top-left-radius: 2px;
    padding: 14px 16px;
    line-height: 1.6;
    max-width: 85%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-bubble-user {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    border-radius: 16px;
    border-top-right-radius: 2px;
    padding: 14px 16px;
    line-height: 1.6;
    max-width: 85%;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.dark-quick-btn {
    background: rgba(30, 41, 59, 0.7);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.dark-quick-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
}

.dark-input-field {
    background: #060911 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    width: 100%;
}

.dark-input-field:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
    outline: none;
}

/* Verify Box */
.dark-verify-box {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(13, 20, 36, 0.95) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.6);
}

/* CTA Banner */
.dark-cta-section {
    background: linear-gradient(135deg, #0e172e 0%, #080c16 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Footer */
footer.dark-footer {
    background: #04070e !important;
    border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
    color: #94a3b8 !important;
}

footer.dark-footer a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

footer.dark-footer a:hover {
    color: #38bdf8 !important;
}

footer.dark-footer h4 {
    color: #ffffff !important;
    font-weight: 600;
}

/* Section divider borders */
.dark-border-b {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.dark-border-t {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* Category Filter Pills */
.dark-filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.5);
    color: #94a3b8;
}

.dark-filter-pill:hover {
    background: rgba(51, 65, 85, 0.7);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.22);
}

.dark-filter-pill.active {
    background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

/* Chapter Accordions */
details.dark-chapter {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    background: #090e1a;
    transition: all 0.2s ease;
}

details.dark-chapter summary {
    background: #0d1424;
    padding: 16px 20px;
    color: #ffffff;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

details.dark-chapter summary::-webkit-details-marker {
    display: none;
}

details.dark-chapter summary:hover {
    background: #121c32;
}

details.dark-chapter .dark-lesson-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #070b14;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    color: #cbd5e1;
}

details.dark-chapter .dark-lesson-item:hover {
    background: #0a0f1d;
    color: #ffffff;
}

/* ==========================================================================
   Member Portal Specific Enhancements
   ========================================================================== */

/* Member Navigation Specifics */
.dark-member-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 6px;
    border-radius: 9999px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dark-member-pill:hover {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(30, 41, 59, 0.9);
}

.dark-member-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
}

/* Member Resume Hero Banner */
.dark-resume-card {
    background: linear-gradient(135deg, rgba(14, 23, 42, 0.95) 0%, rgba(15, 30, 56, 0.85) 100%);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px -10px rgba(2, 6, 23, 0.7), 0 0 20px -5px rgba(56, 189, 248, 0.15);
}

.dark-resume-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #38bdf8, #818cf8, transparent);
}

.dark-resume-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.4);
    flex-shrink: 0;
}

/* Modern Progress Bar */
.dark-progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.dark-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #06b6d4, #3b82f6);
    border-radius: 9999px;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.dark-progress-fill.completed {
    background: linear-gradient(90deg, #10b981, #059669);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Dark Modals */
.dark-modal-overlay {
    background: rgba(4, 7, 14, 0.8) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.dark-modal-box {
    background: #0d1322 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 18px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 30px rgba(56, 189, 248, 0.1);
    color: #f8fafc;
}

.dark-modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 24px;
}

.dark-ussd-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dark-ussd-chip:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: rgba(56, 189, 248, 0.5);
    color: #7dd3fc;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

/* Dark Alerts */
.dark-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
}

.dark-alert-info {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.25);
    color: #7dd3fc;
}

.dark-alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
}

.dark-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

/* Watch Player Page */
.dark-video-frame {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000000;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 40px -10px rgba(0, 0, 0, 0.8), 0 0 25px rgba(37, 99, 235, 0.15);
}

.dark-video-frame:fullscreen {
    border-radius: 0;
    padding-top: 0;
    height: 100%;
    border: none;
}

.dark-lesson-sidebar {
    background: #0b101c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
}

.dark-lesson-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 13px;
    color: #94a3b8;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.dark-lesson-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #f1f5f9;
}

.dark-lesson-link.active {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border-left-color: #38bdf8;
    font-weight: 600;
}

.dark-lesson-link.completed {
    color: #cbd5e1;
}

/* Hero Text (subtitle paragraph below hero headline) */
.dark-hero-text {
    color: #94a3b8;
    font-size: 1.125rem;
    line-height: 1.75;
    margin-top: 1.25rem;
    max-width: 36rem;
}

@media (min-width: 1024px) {
    .dark-hero-text {
        font-size: 1.2rem;
    }
}

/* Pulse Dot Animation (hero badge) */
@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(34, 211, 238, 0); }
}

.pulse-dot {
    animation: pulseDot 2s ease-in-out infinite;
}

/* Dark Mode Scrollbar */
body.dark-mode::-webkit-scrollbar,
.dark-page-container::-webkit-scrollbar {
    width: 8px;
}

body.dark-mode::-webkit-scrollbar-track,
.dark-page-container::-webkit-scrollbar-track {
    background: #080c16;
}

body.dark-mode::-webkit-scrollbar-thumb,
.dark-page-container::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 9999px;
}

body.dark-mode::-webkit-scrollbar-thumb:hover,
.dark-page-container::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* Certificate Page Dark Wrapper */
.dark-cert-controls {
    background: var(--dark-bg);
    border-bottom: 1px solid var(--dark-border);
}

.dark-cert-body {
    background: #0b101c;
    min-height: 100vh;
}

/* Secondary Button (ghost / subtle action) */
.dark-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(30, 41, 59, 0.6) !important;
    color: #cbd5e1 !important;
    font-weight: 600;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
}

.dark-btn-secondary:hover {
    background: rgba(51, 65, 85, 0.8) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-1px);
}

/* Category Badge (member portal) */
.dark-category-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    letter-spacing: 0.02em;
}

