/* ==========================================================================
   MANNY MICHAEL STUDY GROUP (MMSG) - HIGH CONTRAST & RESPONSIVE DESIGN SYSTEM
   ========================================================================== */

:root {
    /* Brand Palette - Deep Sapphire, Master Gold & Pure White */
    --navy-950: #030612;
    --navy-900: #070d22;
    --navy-850: #0b1436;
    --navy-800: #101c48;
    --navy-700: #172862;
    --navy-600: #1e3580;
    
    --gold-50: #fffdf5;
    --gold-100: #fff5c0;
    --gold-200: #fee885;
    --gold-300: #fde047;
    --gold-400: #f5c42f;
    --gold-500: #d4af37; /* Master Gold */
    --gold-600: #b89124;
    
    --text-pure: #ffffff;
    --text-bright: #f8fafc;
    --text-body: #e2e8f0;
    --text-muted: #94a3b8;
    --text-gold: #fef08a;
    
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    
    --rose-400: #fb7185;
    --rose-500: #f43f5e;
    
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;

    /* Theme Surfaces */
    --bg-page: radial-gradient(circle at 50% 0%, #0d173d 0%, #070d22 55%, #030612 100%);
    --bg-card: rgba(11, 20, 54, 0.95);
    --bg-card-solid: #0b1436;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --border-color: rgba(245, 196, 47, 0.35);
    --border-subtle: rgba(255, 255, 255, 0.12);
    
    --shadow-navy: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
    --radius-pill: 9999px;
    --radius-card: 22px;
    --radius-input: 50px;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Cinzel', 'Playfair Display', Georgia, serif;
}

/* Light Theme Variables */
body.light-theme {
    --bg-page: radial-gradient(circle at 50% 0%, #ffffff 0%, #f1f5fc 55%, #e2ebf8 100%);
    --bg-card: rgba(255, 255, 255, 0.98);
    --bg-card-solid: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.9);
    --border-color: rgba(184, 145, 36, 0.45);
    --border-subtle: rgba(0, 0, 0, 0.12);
    --text-pure: #070d22;
    --text-bright: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-gold: #936e1c;
    --shadow-navy: 0 20px 40px -10px rgba(7, 13, 34, 0.15);
    /* Override yellow/white tokens that would be invisible on light backgrounds */
    --gold-200: #7c5a10;
    --gold-300: #8c6512;
    --gold-400: #9e7315;
    --emerald-400: #059669;
    --rose-400: #e11d48;
    --blue-400: #2563eb;
}

/* Base Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background: var(--bg-page);
    color: var(--text-bright);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.55;
    transition: background 0.3s ease, color 0.3s ease;
}

.font-serif {
    font-family: var(--font-serif);
}

/* Clean Radiant Gold Text */
.gold-gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, #fff5c0 30%, #f5c42f 70%, #d4af37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

body.light-theme .gold-gradient-text {
    background: linear-gradient(135deg, #070d22 0%, #936e1c 60%, #b89124 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
}

/* Ambient Backdrops */
.ambient-glow {
    position: fixed;
    width: 650px;
    height: 650px;
    border-radius: 50%;
    filter: blur(150px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.18;
}

.ambient-glow-1 {
    top: -200px;
    left: -100px;
    background: radial-gradient(circle, #d4af37, #1e3580);
}

.ambient-glow-2 {
    bottom: -200px;
    right: -100px;
    background: radial-gradient(circle, #3b82f6, #070d22);
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    background: rgba(7, 13, 34, 0.88);
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 2rem;
    transition: all 0.3s ease;
    width: 100%;
}

body.light-theme .navbar {
    background: rgba(255, 255, 255, 0.92);
}

.nav-content {
    max-width: 1380px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo-wrap {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    text-decoration: none;
}

.brand-crest {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold-400);
    box-shadow: 0 0 16px rgba(245, 196, 47, 0.4);
    background: #000;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #ffffff;
    line-height: 1.2;
}

body.light-theme .brand-title {
    color: #070d22;
}

.brand-subtitle {
    font-size: 0.7rem;
    color: var(--gold-300);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    outline: none;
    white-space: nowrap;
    min-height: 46px;
}

.btn-primary-gold {
    background: linear-gradient(135deg, #fee885 0%, #f5c42f 40%, #d4af37 80%, #b89124 100%);
    color: #030612;
    box-shadow: 0 6px 20px rgba(245, 196, 47, 0.25);
    border: 1px solid rgba(184, 145, 36, 0.35); /* Dimmed subtle border */
}

.btn-primary-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(245, 196, 47, 0.35);
    background: linear-gradient(135deg, #ffffff 0%, #fee885 50%, #f5c42f 100%);
    border-color: rgba(184, 145, 36, 0.5);
}

.btn-outline-gold {
    background: rgba(245, 196, 47, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.32); /* Dimmed subtle border */
    color: var(--gold-200);
}

.btn-outline-gold:hover {
    background: var(--gold-500);
    border-color: rgba(184, 145, 36, 0.5);
    color: #030612;
    box-shadow: 0 6px 22px rgba(245, 196, 47, 0.25);
}

.btn-navy {
    background: var(--navy-800);
    color: #ffffff;
    border: 1px solid var(--border-subtle);
}

.btn-navy:hover {
    background: var(--navy-700);
    border-color: rgba(212, 175, 55, 0.32);
    color: var(--gold-200);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    color: var(--text-bright);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(245, 196, 47, 0.12);
    border-color: rgba(212, 175, 55, 0.32);
    color: var(--gold-300);
    transform: translateY(-1px);
}

/* Badge Tags */
.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.95rem;
    background: rgba(245, 196, 47, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.28); /* Dimmed border */
    border-radius: var(--radius-pill);
    color: var(--gold-200);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    width: fit-content;
}

body.light-theme .badge-tag {
    background: rgba(158, 115, 21, 0.1);
    border-color: rgba(158, 115, 21, 0.35);
    color: #7c5a10;
}

/* Light theme button overrides */
body.light-theme .btn-outline-gold {
    background: rgba(158, 115, 21, 0.08);
    border-color: rgba(158, 115, 21, 0.4);
    color: #6b4f0e;
}

body.light-theme .btn-outline-gold:hover {
    background: #8c6512;
    border-color: #7c5a10;
    color: #ffffff;
}

body.light-theme .btn-navy {
    background: #1e3580;
    color: #ffffff;
    border-color: rgba(0, 0, 0, 0.18);
}

body.light-theme .btn-navy:hover {
    background: #172862;
    color: #ffffff;
    border-color: rgba(158, 115, 21, 0.5);
}

body.light-theme .btn-icon {
    background: rgba(7, 13, 34, 0.07);
    border-color: rgba(0, 0, 0, 0.15);
    color: #070d22;
}

body.light-theme .btn-icon:hover {
    background: rgba(158, 115, 21, 0.12);
    border-color: rgba(158, 115, 21, 0.4);
    color: #7c5a10;
}

/* ==========================================================================
   ONBOARDING SPLIT VIEW
   ========================================================================== */
.onboarding-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    position: relative;
    z-index: 10;
    width: 100%;
}

.onboarding-card-frame {
    width: 100%;
    max-width: 1060px;
    min-height: 560px;
    background: var(--bg-card);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1.5px solid var(--border-color);
    border-radius: 28px;
    box-shadow: var(--shadow-navy), 0 0 50px rgba(212, 175, 55, 0.16);
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    overflow: hidden;
    animation: fadeInScale 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Left Panel: Borderless Blended Logo */
.onboarding-left-panel {
    background: linear-gradient(145deg, #0d173d 0%, #070d22 100%);
    padding: 3.5rem 2.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    position: relative;
    border-right: 1px solid var(--border-subtle);
    overflow: hidden;
}

body.light-theme .onboarding-left-panel {
    background: linear-gradient(145deg, #edf2fc 0%, #e2ebf9 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.blended-logo-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0;
    width: 100%;
    max-width: 320px;
}

.blended-logo-img {
    width: 100%;
    max-width: 300px;
    height: auto;
    object-fit: contain;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    mix-blend-mode: lighten;
    filter: drop-shadow(0 15px 35px rgba(245, 196, 47, 0.35));
    transition: transform 0.4s ease;
}

body.light-theme .blended-logo-img {
    mix-blend-mode: normal;
    border-radius: 20px;
    filter: drop-shadow(0 12px 25px rgba(7, 13, 34, 0.25));
}

.blended-logo-img:hover {
    transform: scale(1.03);
}

/* Right Form Card Panel */
.onboarding-right-panel {
    padding: 3.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(11, 20, 54, 0.6);
    position: relative;
}

body.light-theme .onboarding-right-panel {
    background: #ffffff;
}

/* Pill Input Fields */
.form-group {
    margin-bottom: 1.4rem;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-pure);
}

body.light-theme .form-label {
    color: #070d22;
}

.form-pill-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.form-pill-icon {
    position: absolute;
    left: 1.35rem;
    color: var(--gold-400);
    font-size: 1.05rem;
    pointer-events: none;
}

.form-pill-input {
    width: 100%;
    padding: 1rem 1.35rem 1rem 3.3rem;
    border-radius: var(--radius-input);
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid var(--border-color);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.25s ease;
    outline: none;
    min-height: 50px;
}

body.light-theme .form-pill-input {
    background: #f8fafc;
    border: 1.5px solid #94a3b8;
    color: #070d22;
}

.form-pill-input:focus {
    border-color: var(--gold-300);
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 4px rgba(245, 196, 47, 0.25);
}

body.light-theme .form-pill-input:focus {
    background: #ffffff;
    border-color: #b89124;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.3);
}

.form-pill-input::placeholder {
    color: var(--text-muted);
}

.input-suffix-btn {
    position: absolute;
    right: 1.1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-suffix-btn:hover {
    color: var(--gold-300);
}

/* Password Strength Indicator */
.password-strength-meter {
    display: flex;
    gap: 5px;
    margin-top: 0.5rem;
}

.strength-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
    transition: background 0.3s ease;
}

.strength-bar.weak { background: var(--rose-500); }
.strength-bar.medium { background: var(--amber-500); }
.strength-bar.strong { background: var(--emerald-500); }

/* Chapter Selector Cards */
.chapter-picker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.4rem;
}

.chapter-card-option {
    border: 1.5px solid var(--border-subtle);
    border-radius: 18px;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    position: relative;
}

.chapter-card-option:hover {
    border-color: var(--gold-400);
    background: rgba(245, 196, 47, 0.08);
    transform: translateY(-2px);
}

.chapter-card-option.selected {
    border-color: var(--gold-400);
    background: linear-gradient(135deg, rgba(245, 196, 47, 0.18) 0%, rgba(7, 13, 34, 0.5) 100%);
    box-shadow: 0 6px 24px rgba(245, 196, 47, 0.25);
}

.chapter-card-option .check-badge {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 0.8rem;
}

.chapter-card-option.selected .check-badge {
    background: var(--gold-400);
    color: #030612;
}

/* Level Selection Pill Buttons */
.level-pill-btn {
    padding: 0.65rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-pill);
    background: rgba(7, 13, 34, 0.6);
    border: 1.5px solid var(--border-subtle);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.level-pill-btn:hover {
    border-color: var(--gold-400);
    color: var(--gold-200);
    transform: translateY(-2px);
    background: rgba(245, 196, 47, 0.08);
}

.level-pill-btn.active {
    background: var(--grad-gold) !important;
    border-color: var(--gold-400) !important;
    color: #030612 !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 18px rgba(245, 196, 47, 0.4) !important;
    transform: translateY(-2px) scale(1.03);
}

.level-pill-btn.active::before {
    content: "\f058"; /* fa-check-circle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.95rem;
    color: #030612;
}

/* Light Theme Level Button Overrides */
body.light-theme .level-pill-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    color: #475569;
}

body.light-theme .level-pill-btn:hover {
    border-color: #9e7315;
    color: #7c5a10;
    background: rgba(158, 115, 21, 0.08);
}

body.light-theme .level-pill-btn.active {
    background: linear-gradient(135deg, #d4af37 0%, #b89124 100%) !important;
    border-color: #8c6512 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(184, 145, 36, 0.35) !important;
}

body.light-theme .level-pill-btn.active::before {
    color: #ffffff;
}

/* Upload Dropzones */
.upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 18px;
    padding: 1.6rem 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.25s ease;
}

.upload-dropzone:hover {
    border-color: var(--gold-300);
    background: rgba(245, 196, 47, 0.08);
}

.upload-preview-img {
    width: 95px;
    height: 95px;
    border-radius: 14px;
    object-fit: cover;
    margin: 0 auto 0.75rem;
    border: 2.5px solid var(--gold-400);
    display: block;
}

/* ==========================================================================
   PORTAL DASHBOARD SECTION
   ========================================================================== */
.dashboard-wrapper {
    max-width: 1380px;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
    width: 100%;
}

/* Hero Welcome Banner */
.portal-hero-card {
    background: linear-gradient(135deg, #0e1a42 0%, #080f28 60%, #132454 100%);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 2.5rem;
    margin-bottom: 2.25rem;
    box-shadow: var(--shadow-navy), 0 0 40px rgba(212, 175, 55, 0.14);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

body.light-theme .portal-hero-card {
    background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 60%, #e6efff 100%);
    border: 1.5px solid rgba(184, 145, 36, 0.4);
}

.student-hero-profile {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.student-avatar-large {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gold-400);
    box-shadow: 0 0 25px rgba(245, 196, 47, 0.45);
    background: #000;
}

/* Hero Stats Grid */
.hero-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem 1.6rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--gold-300);
}

.stat-icon-wrap {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Curriculum Course Cards (Course Name & Instructor Only) */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.curriculum-course-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-subtle);
    border-radius: 20px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    min-height: 140px;
}

.curriculum-course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold-400), #3b82f6);
}

.curriculum-course-card:hover {
    border-color: var(--gold-400);
    transform: translateY(-3px);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.4);
}

.course-instructor-info {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.9rem;
    color: var(--gold-300);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

/* Modals System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 18, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: var(--bg-card-solid);
    border: 1.5px solid var(--border-color);
    border-radius: 26px;
    width: 100%;
    max-width: 840px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
    box-shadow: var(--shadow-navy), 0 0 60px rgba(212, 175, 55, 0.2);
    transform: scale(0.96);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.35rem;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0.5rem;
}

.modal-close-btn:hover {
    color: var(--rose-400);
}

/* Responsive Table Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.25rem 0;
    border-radius: 12px;
}

.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.92rem;
    min-width: 580px; /* Ensures clean layout on small screens with scroll */
}

.custom-table th {
    background: rgba(255, 255, 255, 0.08);
    color: var(--gold-200);
    text-align: left;
    padding: 1rem 1.1rem;
    font-weight: 700;
    border-bottom: 1.5px solid var(--border-color);
}

.custom-table td {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-bright);
}

.custom-table tr:hover td {
    background: rgba(245, 196, 47, 0.05);
}

/* Remarks Styling */
.remark-distinction-star {
    background: linear-gradient(135deg, rgba(245, 196, 47, 0.25), rgba(212, 175, 55, 0.4));
    border: 1px solid var(--gold-400);
    color: #fff5c0;
    font-weight: 800;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-pill);
    box-shadow: 0 0 10px rgba(245, 196, 47, 0.4);
    display: inline-block;
    white-space: nowrap;
}

.remark-distinction {
    background: rgba(245, 196, 47, 0.18);
    border: 1px solid var(--gold-400);
    color: var(--gold-200);
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-pill);
    display: inline-block;
    white-space: nowrap;
}

.remark-pass {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid var(--emerald-500);
    color: var(--emerald-400);
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-pill);
    display: inline-block;
    white-space: nowrap;
}

.remark-fail {
    background: rgba(244, 63, 94, 0.18);
    border: 1px solid var(--rose-500);
    color: var(--rose-400);
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-pill);
    display: inline-block;
    white-space: nowrap;
}

/* ─── Light theme: table, remarks, instructor, dashboard inline elements ─── */
body.light-theme .custom-table th {
    background: rgba(7, 13, 34, 0.05);
    color: #0f172a;
}

body.light-theme .custom-table td {
    color: #1e293b;
}

body.light-theme .custom-table tr:hover td {
    background: rgba(158, 115, 21, 0.06);
}

body.light-theme .course-instructor-info {
    color: #7c5a10;
    border-top-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .remark-distinction-star {
    background: linear-gradient(135deg, rgba(158, 115, 21, 0.18), rgba(140, 101, 18, 0.28));
    border-color: #9e7315;
    color: #5a3f08;
    box-shadow: 0 0 8px rgba(158, 115, 21, 0.25);
}

body.light-theme .remark-distinction {
    background: rgba(158, 115, 21, 0.12);
    border-color: #9e7315;
    color: #5a3f08;
}

/* Hero, stat cards, and other dashboard elements with inline color:#fff */
body.light-theme .portal-hero-card h2,
body.light-theme .portal-hero-card p,
body.light-theme .portal-hero-card .badge-tag,
body.light-theme [style*="color: #ffffff"],
body.light-theme [style*="color:#ffffff"],
body.light-theme [style*="color: #fff5c0"],
body.light-theme [style*="color:#fff5c0"] {
    color: var(--text-pure) !important;
}

body.light-theme .stat-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .stat-card #stat-score-val,
body.light-theme .stat-card #stat-courses-count {
    color: var(--text-pure);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 90vw;
}

/* Toast — keep dark bg for legibility on all themes */
.toast {
    background: #0b1436;
    border: 1.5px solid var(--gold-400);
    color: #ffffff;
    padding: 0.95rem 1.4rem;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.92rem;
    font-weight: 600;
    animation: slideInUp 0.3s ease;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   MOBILE OPTIMIZATION (BREAKPOINTS & TOUCH TARGETS)
   ========================================================================== */
@media (max-width: 900px) {
    .onboarding-card-frame {
        grid-template-columns: 1fr;
        max-width: 560px;
    }
    .portal-hero-card {
        flex-direction: column;
        align-items: stretch;
        padding: 1.75rem;
        gap: 1.5rem;
    }
    .hero-stats-grid {
        grid-template-columns: 1fr;
    }
    .chapter-picker-grid {
        grid-template-columns: 1fr;
    }
    #form-biodata > div:first-child {
        grid-template-columns: 1fr !important;
    }
    #form-biodata > div:nth-child(4) {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 640px) {
    html {
        font-size: 15px;
    }
    .navbar {
        padding: 0.75rem 1rem;
    }
    .brand-crest {
        width: 38px;
        height: 38px;
    }
    .brand-title {
        font-size: 1rem;
    }
    .brand-subtitle {
        font-size: 0.62rem;
    }
    .onboarding-wrapper {
        padding: 1.25rem 0.75rem;
    }
    .onboarding-left-panel {
        padding: 2rem 1.25rem;
    }
    .blended-logo-container {
        max-width: 220px;
        margin: 1rem 0;
    }
    .onboarding-right-panel {
        padding: 2rem 1.25rem;
    }
    .dashboard-wrapper {
        padding: 1.25rem 0.85rem 3rem;
    }
    .student-hero-profile {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    .student-avatar-large {
        width: 76px;
        height: 76px;
    }
    .modal-container {
        padding: 1.5rem 1.1rem;
        border-radius: 20px;
    }
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Print Rules */
@media print {
    .navbar, .btn, .ambient-glow, .toast-container, .hero-stats-grid, .modal-close-btn, #courses-section-title, #courses-section-subtitle {
        display: none !important;
    }
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .modal-container, .dashboard-wrapper {
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
}
