@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

@font-face {
  font-family: 'July';
  src: url('bgs/fonts/July-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'July';
  src: url('bgs/fonts/July-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'July';
  src: url('bgs/fonts/July-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'July';
  src: url('bgs/fonts/July-Bold-Italic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
    /* ── Professional Light Theme ── */
    --bg-body: #f4f6f9;
    --bg-surface: #ffffff;
    --bg-surface-2: #eef1f6;

    --text-primary: #1a2235;
    --text-secondary: #5a6a85;

    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #e8f0fe;

    --accent-color: #0ea472;
    --accent-hover: #047857;

    --danger-color: #dc2626;
    --warning-color: #d97706;
    --success-color: #16a34a;

    --border-color: #dde3ed;
    --border-focus: #93b4fd;

    --shadow-sm: 0 1px 3px rgba(30, 50, 100, 0.07);
    --shadow-md: 0 4px 12px rgba(30, 50, 100, 0.09), 0 2px 4px rgba(30, 50, 100, 0.05);
    --shadow-lg: 0 12px 28px rgba(30, 50, 100, 0.12), 0 4px 8px rgba(30, 50, 100, 0.06);

    /* Border Radii */
    --radius-sm: 6px;
    --radius-md: 9px;
    --radius-lg: 14px;

    /* Navigation */
    --nav-height: 62px;
    --transition: all 0.2s ease-in-out;
}

[data-theme="dark"] {
    /* ── Professional Dark Theme — Lighter & Comfortable ── */
    /* Surfaces are warm-toned dark grey instead of deep navy */
    --bg-body: #1c1f26;
    --bg-surface: #252930;
    --bg-surface-2: #2f333d;

    --text-primary: #e8ecf4;
    --text-secondary: #9aa3b8;

    --primary-color: #5b9cf6;
    --primary-hover: #7db3f8;
    --primary-light: rgba(91, 156, 246, 0.14);

    --accent-color: #34d399;
    --accent-hover: #6ee7b7;

    --danger-color: #f87171;
    --warning-color: #fbbf24;
    --success-color: #4ade80;

    --border-color: #3a3f4c;
    --border-focus: #5b9cf6;

    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.32);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.38);
}

/* Global Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'July', 'Inter', 'Noto Sans Bengali', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.25s ease, color 0.25s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Navigation */
header {
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-height);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] header {
    background-color: rgba(37, 41, 48, 0.90);
    border-bottom-color: rgba(58, 63, 76, 0.8);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
}

.logo-area {
    display: flex;
    flex-direction: column;
}

.logo-area h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary-color), #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.logo-area p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* --- Buttons --- */
.btn {
    padding: 0.45rem 1.15rem;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: var(--transition);
    font-size: 0.875rem;
    letter-spacing: 0.01em;
}

.btn:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-surface-2);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.theme-toggle {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    width: 36px; /* Lowered height */
    height: 36px; /* Lowered height */
    font-size: 1.1rem;
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    background-color: var(--bg-surface-2);
    color: var(--primary-color);
}

/* Layout */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 2rem 2.5rem;
    flex: 1;
}

@media (min-width: 769px) {
    .container {
        max-width: 960px;
    }
    .hero-section {
        padding: 2.5rem 3rem;
    }
    .hero-title {
        font-size: 2.2rem;
    }
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 5rem 3rem;
    background: linear-gradient(145deg, var(--bg-surface) 0%, var(--bg-surface-2) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}

.hero-section:hover {
    box-shadow: var(--shadow-md);
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
}

.badge-new {
    font-size: 0.7rem;
    background: var(--accent-color);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
    text-transform: uppercase;
    vertical-align: middle;
}

/* Cards & Sections */
.menu-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-focus);
}

.card h2 {
    margin-bottom: 1.2rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--bg-surface-2);
    padding-bottom: 0.8rem;
}

.topic-list li {
    margin-bottom: 0.6rem;
}

.topic-list a {
    display: block;
    padding: 0.75rem 1rem;
    background-color: var(--bg-body);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.topic-list a:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

/* User Profile (Header) */
.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface-2);
    padding: 4px 12px 4px 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: none; 
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    font-size: 0.875rem;
}

.user-profile:hover {
    background: var(--bg-surface);
    border-color: var(--primary-color);
}

.user-profile img {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.profile-arrow {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.user-profile.active .profile-arrow {
    transform: rotate(180deg);
}

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 180px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 1100;
    margin-top: 8px;
    animation: slideDown 0.15s ease-out;
}

.user-dropdown.show {
    display: flex;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-primary);
    border: none;
    background: transparent;
    text-align: left;
    transition: var(--transition);
    width: 100%;
}

.dropdown-item:hover {
    background: var(--bg-surface-2);
    color: var(--primary-color);
}

.dropdown-item.danger {
    color: var(--danger-color);
}

.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Feedback Modal */
.feedback-modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.feedback-modal.active {
    display: flex;
}

.feedback-content {
    background-color: var(--bg-surface);
    margin: auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.2s ease-out;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.feedback-textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    margin: 15px 0;
    transition: border-color 0.2s;
}

.feedback-textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* History Modal */
.history-modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.history-modal.active {
    display: flex;
}

.history-content {
    background-color: var(--bg-surface);
    margin: auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 650px; 
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.2s ease-out;
    display: flex;
    flex-direction: column;
}

.history-list-container {
    max-height: 350px;
    overflow-y: auto;
    margin-top: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.history-table th, .history-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.history-table th {
    background: var(--bg-surface-2);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.history-table tr:last-child td {
    border-bottom: none;
}

/* Home Button */
.home-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 40px; /* Lowered height */
    height: 40px; /* Lowered height */
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    z-index: 100;
    font-size: 1.2rem;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    color: var(--text-secondary);
}

.home-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* --- MCQ Specific Styles --- */

.mcq-logo-title {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.03em;
}

.screen {
    display: none;
    animation: fadeIn 0.25s ease-out;
}
.screen.active { display: block; }

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

/* MCQ Container Override */
.mcq-container {
    max-width: 750px;
    margin: 2rem auto;
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    text-align: center;
}

.selection-box { margin-bottom: 1.2rem; text-align: left; }
.selection-box label { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 0.4rem; color: var(--text-secondary); }

select {
    width: 100%;
    padding: 0.5rem 0.8rem; /* Lowered height */
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2364748b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 0.65rem auto;
}

select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Quiz Header & Status */
.quiz-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.quiz-badge {
    background: var(--bg-surface-2);
    padding: 4px 10px; /* Lowered height */
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.quiz-score {
    color: var(--primary-color);
    font-weight: 600;
}

.quiz-timer {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
}

.progress-container {
    width: 100%;
    height: 6px; /* Sleeker progress bar */
    background: var(--bg-surface-2);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* MCQ Options */
#options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.option-btn {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem; /* Lowered height */
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-weight: 500;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.option-btn.correct {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.option-btn.incorrect {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* Leaderboard */
#leaderboard-section {
    margin-top: 2rem;
    background: var(--bg-body);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

/* Auth Profile in MCQ */
.user-profile-section {
    background: var(--bg-surface-2);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border-color);
}

.user-info { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.8rem; }
.user-avatar { width: 48px; height: 48px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
.user-welcome { font-size: 1rem; font-weight: 600; color: var(--text-primary); }

/* About Section (Footer Style) */
.about-section {
    margin-top: 4rem;
    padding: 3rem 1.5rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.creators {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-surface-2);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

/* Topic Specifics */
.topic-controls {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.topic-btn {
    padding: 0.8rem 1.2rem; /* Lowered height */
    min-width: 160px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.topic-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-surface-2);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Overview Items */
.overview-item {
    border: 1px solid var(--border-color);
    padding: 1.2rem;
    margin-bottom: 0.8rem;
    border-radius: var(--radius-md);
    position: relative;
    background: var(--bg-surface);
    transition: var(--transition);
}

.overview-item:hover {
    border-color: var(--text-secondary);
}

.overview-status {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1.2rem;
}

.overview-explanation {
    background: var(--bg-surface-2);
    padding: 10px;
    border-radius: var(--radius-sm);
    margin-top: 10px;
    font-size: 0.85rem;
    border-left: 3px solid var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 1.5rem;
        margin-bottom: 1.5rem;
    }

    .hero-title {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    :root {
        --nav-height: 54px;
    }

    nav {
        padding: 0 1rem;
    }

    .logo-area h1 {
        font-size: 1.1rem;
    }

    .logo-area p {
        font-size: 0.65rem;
    }

    .user-area {
        gap: 0.5rem;
    }

    .user-area .btn-primary#login-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
    }

    .user-profile {
        padding: 2px 6px 2px 2px; 
        gap: 6px;
        background: transparent;
        border: none;
    }

    #user-name {
        display: none;
    }

    .user-profile img {
        width: 26px;
        height: 26px;
        border: 1px solid var(--border-color);
    }

    #logout-btn {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.7rem !important;
        background: transparent;
        color: var(--danger-color);
        border: 1px solid var(--danger-color);
    }

    #logout-btn:hover {
        background: var(--danger-color);
        color: white;
    }

    #notif-bell-container {
        margin-right: 5px !important;
    }
    #notif-bell {
        font-size: 1rem !important;
    }

    .menu-section { grid-template-columns: 1fr; }
    #options-container { grid-template-columns: 1fr; }
    .user-welcome { font-size: 0.9rem; }
    .container { padding: 1.5rem 1rem; }

    .main-footer {
        text-align: center;
    }
}

/* --- Footer --- */
.main-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 2rem 1.5rem 1rem;
}
.main-footer .footer-brand {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary-color), #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}
.main-footer p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.footer-bottom a {
    color: var(--text-secondary);
}
.footer-bottom a:hover {
    color: var(--primary-color);
}

/* Floating ICT Redirect Button */
.ict-fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px; /* Lowered height */
    background: var(--bg-surface);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.ict-fab:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.ict-fab .fab-icon {
    font-size: 1.1rem;
}

.ict-fab .fab-text {
    white-space: nowrap;
}

@media (max-width: 480px) {
    .ict-fab {
        bottom: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 0.8rem;
        gap: 6px;
    }
    
    .ict-fab .fab-icon {
        font-size: 1rem;
    }
}


/* --- Notification System Styles --- */
.notif-bell-container {
    position: relative;
    margin-right: 12px;
    cursor: pointer;
    color: var(--text-secondary);
}

.notif-bell-container:hover {
    color: var(--text-primary);
}

.notif-bell {
    font-size: 1.1rem;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger-color);
    color: white;
    font-size: 0.65rem;
    padding: 2px 4px;
    border-radius: 4px;
    display: none;
}

.btn-logout-minimal {
    padding: 0.25rem 0.7rem !important; /* Lowered height */
    font-size: 0.75rem !important;
}

/* Generic Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-surface);
    margin: 10% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 450px;
    border-radius: var(--radius-lg);
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.2s ease-out;
}

.modal-close {
    color: var(--text-secondary);
    float: right;
    font-size: 24px;
    line-height: 1;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger-color);
}

.modal-title {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.modal-controls {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-select {
    padding: 4px 8px; /* Lowered height */
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.modal-list {
    max-height: 350px;
    overflow-y: auto;
}

.modal-empty-msg {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Footer Copyright */
.footer-copyright {
    text-align: center;
    flex-basis: 100%;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* --- MCQ App Specific Styles --- */
.mcq-nav-controls {
    position: fixed;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 100;
}

.mcq-user-profile-section {
    background: var(--bg-surface-2);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: none; 
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border-color);
}

.mcq-auth-buttons {
    display: flex;
    gap: 8px;
}

.mcq-guest-msg {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.mcq-btn-full {
    width: 100%;
    margin-top: 1rem;
}

.mcq-stats-title {
    margin-bottom: 1.2rem;
    font-size: 1.15rem;
}

.mcq-stats-controls {
    margin-bottom: 1.2rem;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mcq-stats-filter {
    padding: 6px 10px; /* Lowered height */
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.mcq-aggregate-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    text-align: center;
}

.mcq-stat-box {
    background: var(--bg-surface-2);
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.mcq-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.mcq-stat-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.mcq-stat-value.right { color: var(--accent-color); }
.mcq-stat-value.wrong { color: var(--danger-color); }
.mcq-stat-value.accuracy { color: var(--primary-color); }

.mcq-table-container {
    overflow-x: auto;
}

.mcq-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 550px;
    font-size: 0.85rem;
}

.mcq-table th {
    background: var(--bg-surface-2);
    text-align: left;
    padding: 8px 10px;
}

.mcq-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.mcq-table-row {
    border-bottom: 1px solid var(--border-color);
}

.mcq-table-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.mcq-btn-back {
    margin-top: 1.5rem;
}

.mcq-auth-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
    display: none;
    font-size: 0.85rem;
}

.mcq-overview-summary {
    background: var(--bg-surface-2);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.mcq-overview-list {
    text-align: left;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 1.5rem;
}

.mcq-overview-summary-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 1rem;
    font-weight: 600;
}

.mcq-final-score {
    margin-top: 8px;
    font-weight: 600;
    font-size: 1.1rem;
}

.right-text { color: var(--accent-color); font-weight: 600; }
.wrong-text { color: var(--danger-color); font-weight: 600; }
.accuracy-text { color: var(--primary-color); font-weight: 600; }

.mcq-table-msg {
    text-align: center;
    padding: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.mcq-question-text {
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    min-height: 50px;
    color: var(--text-primary);
}

.leaderboard-score {
    font-weight: 600;
    color: var(--text-primary);
}

.mcq-footer {
    margin-top: 0 !important;
}

/* --- Admin Panel Specific Styles --- */
.admin-body {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#admin-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-body);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.admin-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    display: none;
}

.admin-sidebar {
    width: 240px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.admin-sidebar button {
    text-align: left;
    padding: 8px 12px; /* Lowered height */
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition);
}

.admin-sidebar button:hover,
.admin-sidebar button.active {
    background: var(--bg-surface-2);
    color: var(--text-primary);
}

.admin-main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-body);
}

.admin-panel-section {
    display: none;
}

.admin-panel-section.active {
    display: block;
}

.admin-stat-card {
    background: var(--bg-surface);
    padding: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.admin-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
    padding: 10px 12px; /* Lowered height */
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--bg-surface-2);
    font-weight: 500;
    color: var(--text-secondary);
}

/* Admin Modal Overrides (reusing generic modal where possible) */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.admin-modal-content {
    background: var(--bg-surface);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.admin-close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.admin-close-modal:hover {
    color: var(--text-primary);
}

.loading-spinner {
    border: 3px solid var(--border-color);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
    margin: 15px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Admin specific overrides */
.admin-card-login {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.admin-login-header {
    text-align: center;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.admin-login-subtitle {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-login-divider {
    position: relative;
    text-align: center;
    margin: 15px 0;
}

.admin-login-divider hr {
    border: 0;
    border-top: 1px solid var(--border-color);
}

.admin-login-divider span {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    padding: 0 8px;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.admin-input {
    width: 100%;
    padding: 0.5rem 0.75rem; /* Lowered height */
    margin-bottom: 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.admin-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.admin-error-msg {
    color: var(--danger-color);
    text-align: center;
    margin-top: 10px;
    font-size: 0.85rem;
}

.admin-header-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.25rem;
}

.admin-header-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.admin-profile-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-surface-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.admin-avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.admin-name-text {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-footer-tag {
    position: fixed;
    bottom: 5px;
    right: 10px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    z-index: 1000;
}

/* Additional Admin Styles */
.sidebar-header {
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.flex-1 { flex: 1; }
.overflow-hidden { overflow: hidden; }

.admin-analytics-title { margin-bottom: 15px; font-weight: 600; color: var(--text-primary); }
.admin-stat-value-warning { color: var(--warning-color); }
.admin-filter-container {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 5px;
}
.admin-filter-select, .admin-filter-input {
    padding: 2px 6px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
}
.admin-stat-label-small { font-size: 0.75rem; margin-top: 5px; color: var(--text-secondary); }

.admin-section-title { margin-bottom: 15px; font-weight: 600; font-size: 1.1rem; }
.admin-table-container { overflow-x: auto; }

.admin-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.admin-tab-btn {
    padding: 8px 12px; /* Lowered height */
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.admin-tab-btn.active {
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-primary);
}

.admin-notif-form {
    max-width: 600px;
    background: var(--bg-surface);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.admin-form-group {
    margin-bottom: 15px;
}

.admin-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.admin-select, .admin-textarea, .admin-datetime {
    width: 100%;
    padding: 0.5rem 0.75rem; /* Lowered height */
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.admin-textarea {
    resize: vertical;
    min-height: 80px;
}

.admin-search-results {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px;
    background: var(--bg-surface-2);
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.admin-flex-row {
    display: flex;
    gap: 8px;
}

.admin-sent-header {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-modal-title { margin-bottom: 5px; font-weight: 600; font-size: 1.1rem; }
.admin-modal-subtitle { color: var(--text-secondary); margin-bottom: 15px; font-size: 0.85rem; }

.admin-modal-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.admin-modal-tab-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.admin-modal-list {
    max-height: 250px;
    overflow-y: auto;
}

.admin-btn-danger {
    background: var(--danger-color) !important;
    color: white !important;
}

/* Common utility classes */
.admin-mb-20 { margin-bottom: 15px; }
.admin-mt-10 { margin-top: 8px; }
.display-none { display: none; }
.margin-0 { margin: 0; }
.btn-refresh { padding: 4px 8px; font-size: 0.8rem; }
.width-40 { width: 40%; }
.font-size-0-8 { font-size: 0.8rem; }


/* ── Scrollbar Styling ── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--bg-surface-2); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ── Text Selection ── */
::selection { background: var(--primary-light); color: var(--primary-color); }

/* ── Input & Textarea Global Focus ── */
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ── Smooth Theme Transition ── */
*, *::before, *::after {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease,
                box-shadow 0.2s ease;
}