/* Base Variables */
:root {
    /* Colors */
    --bg-color: #f8fafc;
    /* Very light slate/gray background */
    --text-main: #111827;
    /* Dark gray for headings */
    --text-muted: #6b7280;
    /* Medium gray for descriptions */

    /* Primary / Blue */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-bg: #eff6ff;
    /* light blue for selected cards */
    --primary-border: #93c5fd;

    /* Secondary Colors */
    --math-bg: #e0e7ff;
    /* Indigo 100 */
    --math-text: #4338ca;
    /* Indigo 700 */
    --science-bg: #dcfce7;
    /* Green 100 */
    --science-text: #15803d;
    /* Green 700 */
    --gk-bg: #f3e8ff;
    /* Purple 100 */
    --gk-text: #7e22ce;
    /* Purple 700 */

    --warning-bg: #fefce8;
    /* Yellow 50 */
    --warning-text: #a16207;
    /* Yellow 700 */

    --error-text: #ef4444;
    /* Red 500 */

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: 'Lora', Georgia, serif;

    /* Styling */
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);

    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --card-bg-unselected: #f3f4f6;
    /* Gray 100 */
}

/* Reset & Global */
html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    font-family: var(--font-sans);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    /* Use native inertial scrolling for mobile */
    overflow-x: hidden;
    width: 100%;
    min-height: 100%;
}

/* Typography Base */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    color: var(--text-main);
}

.text-muted {
    color: var(--text-muted);
}

/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Navbar */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 200;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.3s ease;
}

.nav-container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 66px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area-link {
    text-decoration: none !important;
    color: inherit !important;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    background-color: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon .material-symbols-rounded {
    font-size: 20px;
}

.logo-text {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-main);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-main);
}

.nav-links .material-symbols-rounded {
    font-size: 18px;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: 2px solid var(--primary-border);
    transition: all 0.2s;
    user-select: none;
}

.profile-avatar:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Profile Dropdown */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    z-index: 50;
    overflow: hidden;
    animation: dropdownFade 0.2s ease-out forwards;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #f8fafc;
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.dropdown-user-info {
    flex: 1;
    overflow: hidden;
}

.dropdown-name {
    font-size: 0.875rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-email {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.dropdown-item .material-symbols-rounded {
    font-size: 20px;
    color: var(--text-muted);
}

.dropdown-item:hover {
    background-color: var(--card-bg-unselected);
}

.dropdown-item.text-error-hover:hover {
    background-color: #fef2f2;
    color: var(--error-text);
}

.dropdown-item.text-error-hover:hover .material-symbols-rounded {
    color: var(--error-text);
}


/* Utilities */
.hidden {
    display: none !important;
}

/* Sections Common */
section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* Tournaments */
.tournaments-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.tournament-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.tournament-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary-border);
}

.tournament-card.selected-tournament {
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
}

.t-card-header {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.t-card-header .material-symbols-rounded {
    font-size: 20px;
}

.math-header {
    background-color: var(--math-bg);
    color: var(--math-text);
}

.science-header {
    background-color: var(--science-bg);
    color: var(--science-text);
}

.gk-header {
    background-color: var(--gk-bg);
    color: var(--gk-text);
}

.t-card-body {
    padding: 1rem;
}

.t-card-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.truncate-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.t-card-tags {
    display: flex;
    gap: 0.5rem;
}

.tag {
    background-color: var(--card-bg-unselected);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
}

/* Create Quiz Section */
.form-group {
    margin-bottom: 1.5rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-sm {
    margin-bottom: 1rem;
}

.ml-2 {
    margin-left: 0.75rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.flex-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.icon-blue {
    color: var(--primary);
    font-size: 20px;
}

/* Options Grid */
.options-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.options-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* Option Cards Big (Mode & Input) */
.option-card {
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.option-card.selected {
    background-color: var(--primary-bg);
    border-color: var(--primary);
}

.option-card.unselected {
    background-color: var(--card-bg-unselected);
    border-color: transparent;
}

.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bg-blue {
    background-color: var(--primary);
}

.bg-gray {
    background-color: #e5e7eb;
}

.bg-purple {
    background-color: var(--gk-bg);
}

.text-white {
    color: white;
}

.text-gray {
    color: var(--text-muted);
}

.text-purple {
    color: #c084fc;
}

.bg-yellow-soft {
    background-color: #fef9c3;
}

.text-yellow-dark {
    color: #a16207;
}

.bg-peach-soft {
    background-color: #ffedd5;
}

.text-peach-dark {
    color: #ea580c;
}

/* matching camera icon color roughly */
.text-blue-muted {
    color: var(--primary);
}

.option-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.option-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

/* Option Cards Small (Prep For) */
.selected-small {
    background-color: var(--primary-bg);
    border: 1px solid var(--primary);
}

.unselected-small {
    background-color: var(--card-bg-unselected);
    border: 1px solid transparent;
}

.option-title-sm {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

.option-desc-sm {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Inputs */
.textarea-input {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--card-bg);
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-main);
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.textarea-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.textarea-input::placeholder {
    color: #9ca3af;
}

/* File Upload Box */
.file-upload-box {
    width: 100%;
    min-height: 100px;
    /* same as textarea to prevent jumping */
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--card-bg-unselected);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.file-upload-box:hover {
    border-color: var(--primary);
    background-color: var(--primary-bg);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.upload-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

.upload-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.hidden-file-input {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Select */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-input {
    width: 100%;
    appearance: none;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    padding-right: 2.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
}

.select-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.select-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
}

/* Custom Number Toggle */
.toggle-group {
    display: flex;
    flex-wrap: wrap;
    background-color: var(--card-bg-unselected);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    gap: 0.25rem;
}

.toggle-btn {
    flex: 1 1 auto;
    text-align: center;
    border: none;
    background: transparent;
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.selected-toggle {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.unselected-toggle {
    color: var(--text-muted);
}

.unselected-toggle:hover {
    color: var(--text-main);
    background-color: #e5e7eb;
}

.locked-toggle {
    color: #9ca3af;
    background-color: transparent;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.lock-icon-sm {
    font-size: 14px;
}


/* Alerts & Banners */
.warning-banner {
    background-color: var(--warning-bg);
    color: var(--warning-text);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    margin-bottom: 1rem;
}

.warning-banner .material-symbols-rounded {
    font-size: 16px;
}

.error-message {
    color: var(--error-text);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Landing Page Specifics */
.landing-body {
    background-color: #f8fafc;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 30px 30px;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.dark-theme.landing-body {
    background-color: #0f172a;
    background-image: radial-gradient(#334155 1px, transparent 1px);
}

.landing-body::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 60%);
    z-index: -1;
}

.landing-body::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 60%);
    z-index: -1;
}

.landing-navbar {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.dark-theme .landing-navbar {
    background-color: rgba(30, 41, 59, 0.85);
    border-bottom: 1px solid #334155;
}

.landing-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 6rem 1rem 4rem 1rem;
    text-align: center;
    position: relative;
}

/* Background Decorations */
.bg-decoration {
    position: absolute;
    color: rgba(59, 130, 246, 0.15);
    /* Very faint primary blue */
    z-index: -1;
    animation: float 6s ease-in-out infinite;
}

.bg-decoration .material-symbols-rounded {
    font-size: 80px;
}

.icon-1 {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.icon-2 {
    top: 40%;
    right: 5%;
    animation-delay: 1.5s;
    color: rgba(168, 85, 247, 0.15);
    /* light purple */
}

.icon-3 {
    bottom: 20%;
    left: 10%;
    animation-delay: 3s;
    color: rgba(16, 185, 129, 0.15);
    /* light green */
}

.icon-4 {
    top: 20%;
    right: 15%;
    animation-delay: 4.5s;
    transform: rotate(15deg);
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

.hero-section {
    max-width: 800px;
    margin: 0 auto 5rem auto;
    position: relative;
    z-index: 1;
}

.student-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #eff6ff;
    /* light blue bg */
    color: #2563eb;
    /* primary blue text */
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid #bfdbfe;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.1);
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    /* Slate 900 */
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.hero-btn {
    display: inline-flex;
    width: auto;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: center;
    margin-top: 5rem;
    position: relative;
    z-index: 1;
}

.feature-card {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-border);
}

.feature-title {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.text-center {
    text-align: center;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.w-full {
    width: 100%;
}

/* Modal Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.login-modal-content {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    position: relative;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    animation: modalFadeIn 0.3s ease-out forwards;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.close-modal-btn:hover {
    background-color: var(--card-bg-unselected);
    color: var(--text-main);
}

.btn-google {
    width: 100%;
    background-color: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-google:hover {
    background-color: #f8f9fa;
    outline: 1px solid #dadce0;
}

.btn-email-toggle {
    width: 100%;
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-email-toggle:hover {
    background-color: var(--card-bg-unselected);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.google-icon {
    width: 20px;
    height: 20px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 0.75rem;
}

.rotating {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

/* Landing Footer */
.landing-footer {
    border-top: 1px solid var(--border-color);
    background-color: transparent;
    padding: 3rem 1rem 2rem 1rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* =========================================
   Quiz Active Interface & Results
   ========================================= */

.full-screen-app {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-color);
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.bg-gray-50 {
    background-color: #f9fafb;
}

/* --- Profile Dropdown & Modals (Premium) --- */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 240px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    z-index: 100;
    transform-origin: top right;
    animation: dropdownPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownPop {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.dropdown-user-info {
    overflow: hidden;
}

.dropdown-name {
    font-size: 0.9375rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-email {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: #f1f5f9;
    padding-left: 1rem;
}

.dropdown-item .material-symbols-rounded {
    font-size: 1.25rem;
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;

}

.premium-modal {
    background: white;
    width: 100%;
    max-width: 550px;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.modal-close:hover {
    background: #e2e8f0;
    color: var(--text-main);
    transform: rotate(90deg);
}

.modal-header {
    padding: 2.5rem 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.header-icon .material-symbols-rounded {
    font-size: 2rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.modal-body {
    padding: 0 2rem 2.5rem;
}

/* Specific Content UI */
.profile-card-premium {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.field-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.field-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
}

.empty-state-lux {
    padding: 4rem 2rem;
    text-align: center;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: var(--radius-lg);
}

.empty-state-lux .material-symbols-rounded {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.empty-state-lux p {
    color: var(--text-muted);
    font-weight: 500;
}

.settings-premium-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setting-luxury-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.setting-luxury-item:hover {
    border-color: var(--primary);
    background: white;
}

.setting-info {
    display: flex;
    flex-direction: column;
}

.setting-name {
    font-weight: 600;
    color: var(--text-main);
}

.setting-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.btn-toggle-lux {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toggle-lux:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left,
.header-right,
.footer-left,
.footer-right {
    flex: 1;
    display: flex;
}

.header-left,
.footer-left {
    justify-content: flex-start;
}

.header-right,
.footer-right {
    justify-content: flex-end;
    gap: 0.75rem;
}

.header-center,
.footer-center {
    display: flex;
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.gap-sm {
    gap: 0.5rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background-color: var(--card-bg-unselected);
    color: var(--text-main);
}

.timer-box {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background-color: var(--primary-bg);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.timer-box .material-symbols-rounded {
    font-size: 18px;
}

.bg-purple-light {
    background-color: #f3e8ff;
    color: #7e22ce;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-primary-sm {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary-sm:hover {
    background-color: var(--primary-hover);
}

.btn-success {
    background-color: #10b981;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-success:hover {
    background-color: #059669;
}

.outline-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.outline-btn:hover {
    background: var(--card-bg-unselected);
    color: var(--text-main);
}

.quiz-main {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem 1rem;
    margin-bottom: 5rem;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    margin-bottom: 2rem;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.q-number {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.q-text {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.6;
}

.mt-4 {
    margin-top: 2rem;
}

.option-btn {
    display: block;
    width: 100%;
    text-align: left;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover:not(:disabled) {
    background-color: #f9fafb;
    border-color: #cbd5e1;
}

.option-btn.selected-option {
    background-color: var(--primary-bg);
    border: 2px solid var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.option-btn.correct-option {
    background-color: #dcfce7;
    border: 2px solid #22c55e !important;
    color: #166534;
}

.option-btn.wrong-option {
    background-color: #fee2e2;
    border: 2px solid #ef4444 !important;
    color: #991b1b;
}

.explanation-box {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
}

.text-green {
    color: #16a34a;
}

.text-xs {
    font-size: 0.75rem;
}

.text-blue {
    color: var(--primary);
}

.quiz-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.quiz-footer .btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Advanced Results Analytics */
.analysis-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-main {
    max-width: 1000px;
}

.analysis-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

#close-results-btn-main {
    width: auto;
    padding: 0.75rem 1.5rem;
    margin-top: 0.5rem;
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.perf-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.perf-card:hover {
    box-shadow: var(--shadow);
}

.perf-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.perf-icon .material-symbols-rounded {
    font-size: 24px;
}

.bg-blue-100 {
    background-color: #dbeafe;
}

.bg-green-100 {
    background-color: #dcfce7;
}

.text-green {
    color: #16a34a;
}

.bg-purple-100 {
    background-color: #f3e8ff;
}

.bg-orange-100 {
    background-color: #ffedd5;
}

.text-warning {
    color: #ea580c;
}

.perf-data {
    display: flex;
    flex-direction: column;
}

.perf-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.perf-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

/* Question Breakdown Stats */
.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.breakdown-stat {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.border-green {
    border-left-color: #22c55e;
}

.border-red {
    border-left-color: #ef4444;
}

.border-gray {
    border-left-color: #9ca3af;
}

.stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.font-bold {
    font-weight: 700;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-correct {
    background-color: #dcfce7;
    color: #166534;
}

.badge-wrong {
    background-color: #fee2e2;
    color: #991b1b;
}

.review-answer-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Base Responsive updates */

/* Buttons */
.btn-primary {
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 2rem;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary .material-symbols-rounded {
    font-size: 20px;
}

.btn-secondary {
    background-color: var(--primary);
    /* Soft blue from screenshot for redeem button */
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* Specific Redeem Button override */
.redeem-input-group .btn-secondary {
    background-color: var(--primary);
    color: white;
    border: none;
}

.redeem-input-group .btn-secondary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary:hover {
    background-color: var(--primary);
}

/* Redeem Section */
.redeem-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.redeem-input-group {
    display: flex;
    gap: 0.5rem;
}

.redeem-input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.redeem-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive */

/* Responsive Overrides (See bottom of file) */



/* End of responsive cleaning */


/* =========================================
   Dark Mode Premium Theme Variables
   ========================================= */
body.dark-mode {
    --bg-color: #0f172a;
    /* Deep slate */
    --card-bg: #1e293b;
    --card-bg-unselected: #334155;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --border-color: #334155;

    /* Subtle overrides for backgrounds in dark mode */
    --primary-bg: rgba(59, 130, 246, 0.15);
    --primary-border: #3b82f6;

    --warning-bg: rgba(161, 98, 7, 0.2);
    --warning-text: #fde047;

    --math-bg: rgba(67, 56, 202, 0.2);
    --math-text: #a5b4fc;

    --science-bg: rgba(21, 128, 61, 0.2);
    --science-text: #86efac;

    --gk-bg: rgba(126, 34, 206, 0.2);
    --gk-text: #d8b4fe;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
}

/* Base modifications for Dark Mode */
body.dark-mode .dropdown-header {
    background-color: #1e293b;
}

body.dark-mode .select-input option {
    background-color: #1e293b;
}



/* =========================================
   Landing Page Premium Redesign
   ========================================= */
.landing-body {
    background-color: #f8fafc !important;
    /* Force sleek light for landing by default */
    color: #0f172a;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.05), transparent 25%);
    background-attachment: fixed;
}

body.dark-theme {
    background-color: #0f172a !important;
    color: #f8fafc;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.15), transparent 25%);
}

.landing-navbar {
    background-color: rgba(255, 255, 255, 0.8) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body.dark-theme .landing-navbar,
.dark-theme .landing-navbar {
    background-color: rgba(15, 23, 42, 0.8) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.landing-navbar .logo-text,
.landing-navbar .material-symbols-rounded {
    color: #0f172a !important;
}

body.dark-theme .landing-navbar .logo-text,
body.dark-theme .landing-navbar .material-symbols-rounded,
.dark-theme .landing-navbar .logo-text,
.dark-theme .landing-navbar .material-symbols-rounded {
    color: #f8fafc !important;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #000 0%, #334155 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
}

body.dark-theme .hero-title,
.dark-theme .hero-title {
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #475569;
    /* Darker gray for light mode */
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

body.dark-theme .hero-subtitle,
.dark-theme .hero-subtitle {
    color: #94a3b8;
}

.hero-btn {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.5);
}

.feature-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(59, 130, 246, 0.3);
}

.feature-title {
    color: #0f172a;
    /* Dark text for light mode */
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-sans);
    font-weight: 600;
}

body.dark-theme .feature-title,
.dark-theme .feature-title {
    color: #f8fafc;
}

.feature-desc {
    color: #475569;
    /* Darker gray for light mode */
    font-size: 0.95rem;
}

body.dark-theme .feature-desc,
.dark-theme .feature-desc {
    color: #94a3b8;
}

.student-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

/* Make the features grid 3 columns */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* Enhancing inputs for dark mode */
body.dark-mode .textarea-input,
body.dark-mode .select-input {
    background-color: var(--card-bg-unselected);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .textarea-input:focus,
body.dark-mode .select-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

body.dark-mode .file-upload-box {
    background-color: var(--card-bg-unselected);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .file-upload-box:hover {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
}

body.dark-mode .toggle-group {
    background-color: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .selected-toggle {
    background-color: var(--primary);
    color: #fff;
}

body.dark-mode .unselected-toggle {
    color: #cbd5e1;
    /* Lighter gray for better visibility */
}

body.dark-mode .unselected-toggle:hover {
    background-color: var(--card-bg-unselected);
    color: var(--text-main);
}


/* =========================================
   Robust Dark Mode Overrides for All Components
   ========================================= */

/* Modals & Dropdowns */
body.dark-mode .premium-modal,
body.dark-mode .profile-dropdown {
    background-color: var(--card-bg);
    /* #1e293b */
    border-color: var(--border-color);
    /* #334155 */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

body.dark-mode .modal-header,
body.dark-mode .dropdown-header {
    background: linear-gradient(135deg, var(--card-bg) 0%, #1e293b 100%) !important;
    border-bottom: 1px solid var(--border-color);
}

/* Modals header overrides for inline styles previously set */
body.dark-mode .modal-header[style*="background"] {
    background: linear-gradient(135deg, var(--card-bg) 0%, #0f172a 100%) !important;
}

body.dark-mode .dropdown-divider {
    background-color: var(--border-color);
}

body.dark-mode .dropdown-item,
body.dark-mode .modal-title,
body.dark-mode .dropdown-name {
    color: var(--text-main);
}

body.dark-mode .dropdown-item:hover {
    background-color: var(--card-bg-unselected);
}

body.dark-mode .dropdown-item.text-error-hover:hover {
    background-color: rgba(220, 38, 38, 0.1);
    /* red-tint */
}

/* Modal Content specifically */
body.dark-mode .profile-card-premium,
body.dark-mode .empty-state-lux,
body.dark-mode .setting-luxury-item,
body.dark-mode .settings-premium-list {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-mode .setting-luxury-item {
    border-bottom: 1px solid var(--border-color);
}

body.dark-mode .setting-luxury-item:last-child {
    border-bottom: none;
}

body.dark-mode .field-value {
    color: var(--text-main);
}

body.dark-mode .modal-subtitle,
body.dark-mode .dropdown-email,
body.dark-mode .setting-desc {
    color: var(--text-muted);
}

/* General Layouts & Backgrounds for Quiz / Results Interface */
body.dark-mode .full-screen-app,
body.dark-mode .bg-gray-50,
body.dark-mode .quiz-main,
body.dark-mode .results-main,
body.dark-mode .landing-body {
    background-color: #0f172a !important;
}

body.dark-mode .quiz-header,
body.dark-mode .quiz-footer {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

/* Performance Cards (Results) */
body.dark-mode .perf-card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-mode .perf-value,
body.dark-mode .stat-num {
    color: var(--text-main);
}

/* Stat text overrides based on classes */
body.dark-mode .stat-num.text-green {
    color: var(--science-text);
}

body.dark-mode .stat-num.text-error {
    color: #f87171;
}

body.dark-mode .stat-num.text-muted {
    color: var(--text-muted);
}

body.dark-mode .breakdown-stat {
    background-color: var(--card-bg);
}

body.dark-mode .breakdown-stat.border-green {
    border-color: rgba(21, 128, 61, 0.5);
}

body.dark-mode .breakdown-stat.border-red {
    border-color: rgba(220, 38, 38, 0.5);
}

body.dark-mode .breakdown-stat.border-gray {
    border-color: var(--border-color);
}

body.dark-mode .review-card {
    background-color: var(--card-bg);
}

body.dark-mode .explanation-box {
    background-color: var(--card-bg-unselected) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .review-card p.text-main {
    color: var(--text-main);
}

/* Modals overlays background dark tint */
body.dark-mode .modal-overlay,
body.dark-mode .login-overlay,
body.dark-mode .full-overlay {
    background-color: rgba(15, 23, 42, 0.85);
    /* Darker backdrop */
}

/* Buttons in dark mode that need love */
body.dark-mode .modal-close {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

body.dark-mode .modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
}

body.dark-mode .btn-secondary,
body.dark-mode .outline-btn {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

body.dark-mode .redeem-input-group .btn-secondary {
    background-color: var(--primary);
    color: white;
    border: none;
}

body.dark-mode .redeem-input-group .btn-secondary:hover {
    background-color: var(--primary-hover);
}

body.dark-mode .btn-secondary:hover {
    background-color: var(--card-bg-unselected);
}

body.dark-mode .q-number,
body.dark-mode .q-text {
    color: var(--text-main);
}

body.dark-mode .option-btn {
    background-color: var(--card-bg);
    color: var(--text-main);
    border-color: var(--border-color);
}

body.dark-mode .option-btn:hover:not(:disabled) {
    background-color: var(--card-bg-unselected);
    border-color: var(--primary);
}

body.dark-mode .option-btn.selected-option {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: var(--primary);
}

body.dark-mode .option-btn.correct-option {
    background-color: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

body.dark-mode .option-btn.wrong-option {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

body.dark-mode .btn-toggle-lux {
    background-color: var(--card-bg-unselected);
    color: var(--text-main);
}

/* Profile menu text inside navbar */
body.dark-mode .nav-links a {
    color: var(--text-muted);
}

body.dark-mode .nav-links a:hover {
    color: var(--text-main);
}

/* Select inputs inside grids */
body.dark-mode .option-card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-mode .option-card.selected,
body.dark-mode .option-card.selected-small {
    background-color: var(--primary-bg);
    border-color: var(--primary);
}

body.dark-mode .option-card.unselected,
body.dark-mode .option-card.unselected-small {
    background-color: var(--card-bg-unselected);
    border-color: transparent;
}

body.dark-mode .option-title,
body.dark-mode .option-title-sm {
    color: var(--text-main);
}

body.dark-mode .option-desc,
body.dark-mode .option-desc-sm {
    color: var(--text-muted);
}





/* =========================================
   Full Screen Loading Overlay Fix
   ========================================= */
.full-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

body.dark-mode .full-overlay {
    background-color: rgba(15, 23, 42, 0.95);
}

.rotating {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}


/* =========================================
   Loading Overlay Redesign (Box Overlay)
   ========================================= */
.full-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    /* Semi-transparent dark wash */
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem 4rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Dashboard Footer Styles */
.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem 0 3rem;
    margin-top: 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.footer-instagram-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.footer-instagram-link:hover {
    color: #e1306c;
    border-color: #e1306c;
    background: rgba(225, 48, 108, 0.08);
}

/* =========================================
   PRORITIZED MOBILE RESPONSIVENESS (FINAL)
   ========================================= */
@media (max-width: 768px) {

    /* Prevent sideways scroll and optimize inertial scrolling */
    html,
    body,
    .landing-body {
        overflow-x: hidden !important;
        width: 100% !important;
        /* Use 100% instead of 100vw to avoid vertical scrollbar jitters */
        position: relative !important;
        background-attachment: scroll !important;
        /* Fixed backgrounds are extremely heavy on mobile */
        -webkit-overflow-scrolling: touch !important;
        /* Legacy momentum scroll support */
    }

    .landing-main {
        padding: 2rem 1rem !important;
        overflow-x: hidden !important;
    }

    .hero-title {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
    }

    .hero-subtitle {
        font-size: 0.95rem !important;
        margin-bottom: 2rem !important;
    }

    .bg-decoration {
        display: none !important;
    }

    /* Features in Rows */
    .features-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        grid-template-columns: none !important;
        margin-top: 3rem !important;
    }

    .feature-card {
        display: flex !important;
        flex-direction: row !important;
        /* Horizontal layout */
        text-align: left !important;
        align-items: flex-start !important;
        gap: 1rem !important;
        padding: 1.15rem !important;
        width: 100% !important;
    }

    .feature-card .icon-circle {
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
        width: 44px !important;
        height: 44px !important;
    }

    .feature-title {
        font-size: 1.1rem !important;
        margin-bottom: 0.2rem !important;
    }

    .feature-desc {
        font-size: 0.85rem !important;
    }

    /* Compact UI elements */
    .nav-container {
        padding: 0 1rem !important;
        height: 60px !important;
    }

    .logo-text {
        font-size: 1rem !important;
    }

    .hero-btn {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.9rem 1.5rem !important;
    }

    /* Tighten Footer Space */
    .landing-footer {
        padding: 1.5rem 1rem !important;
        margin-top: 0 !important;
    }

    .footer {
        margin-top: 0 !important;
        padding-top: 1rem !important;
        padding-bottom: 1.5rem !important;
    }

    .login-modal-content {
        padding: 1.5rem 1rem !important;
        margin: 0.5rem !important;
        max-width: 95% !important;
    }

    /* Dashboard Prep For Grid - Mobile Only */
    #prep-for-grid .option-card {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 1.25rem 0.75rem !important;
    }

    #prep-for-grid .option-text {
        margin-left: 0 !important;
        margin-top: 0.5rem !important;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem !important;
    }

    .landing-main {
        padding-top: 1.5rem !important;
    }

    /* Coaching Style Mobile Refinement */
    .ai-coach-section .option-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
        padding: 1.25rem 1rem;
        gap: 0.75rem;
    }

    .ai-coach-section .option-title {
        font-weight: 800;
        /* Extra bold for 2nd row */
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .ai-coach-section .option-text {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Quiz Summary Mobile Refinement */
    .analysis-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }

    .analysis-hero-left h1 {
        font-size: 1.5rem !important;
    }

    .performance-grid,
    .breakdown-grid {
        grid-template-columns: 1fr;
    }

    #close-results-btn-main {
        width: 100%;
        margin-top: 0;
    }

    .breakdown-stat {
        padding: 1.25rem;
    }

    .review-card {
        padding: 1rem;
    }
}

/* =========================================
   Premium Features & Success Overlay
   ========================================= */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.success-card {
    background-color: var(--card-bg);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(59, 130, 246, 0.5);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.premium-expiry-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-weight: 500;
}

.success-icon-circle {
    width: 80px;
    height: 80px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.success-icon-circle .material-symbols-rounded {
    font-size: 40px;
}

.btn-premium-action {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1.5rem;
    width: 100%;
}

.btn-premium-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.4);
}