/* ============================================================
   GateHub - Candidate Workspace & CBT Engine Stylesheet
   Theme: GitHub Dark System
   ============================================================ */

:root {
    --transition: all 0.2s cubic-bezier(0.3, 0, 0.5, 1);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --font-title: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    
    --gh-canvas-default: #0d1117;
    --gh-canvas-subtle: #161b22;
    --gh-canvas-overlay: #21262d;
    --gh-border-default: #30363d;
    --gh-border-muted: #21262d;
    --gh-fg-default: #f0f6fc;
    --gh-fg-muted: #8b949e;
    --gh-btn-green: #238636;
    --gh-btn-green-hover: #2ea043;
    --gh-accent-blue: #58a6ff;
}

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

body {
    background-color: var(--gh-canvas-default);
    color: var(--gh-fg-default);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================================
   THEME STYLES - GITHUB DARK THEME
   ============================================================ */

body.glass-theme, body.official-theme, body {
    background-color: var(--gh-canvas-default);
    color: var(--gh-fg-default);
}

.app-header {
    background-color: var(--gh-canvas-subtle);
    border-bottom: 1px solid var(--gh-border-default);
    color: var(--gh-fg-default);
}

.logo-area span {
    font-weight: 600;
    color: var(--gh-fg-default);
}

.logo-area .accent {
    color: #3fb950;
    -webkit-text-fill-color: #3fb950;
}

.portal-hero h1 {
    font-family: var(--font-title);
    color: var(--gh-fg-default);
    font-weight: 700;
}

.portal-card {
    background-color: var(--gh-canvas-subtle);
    border: 1px solid var(--gh-border-default);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-header {
    border-bottom: 1px solid var(--gh-border-default);
    color: var(--gh-fg-default);
}

.paper-card {
    background-color: var(--gh-canvas-subtle);
    border: 1px solid var(--gh-border-default);
    border-radius: 8px;
    transition: var(--transition);
}

.paper-card:hover {
    transform: translateY(-2px);
    border-color: #58a6ff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.paper-badge {
    background: #21262d;
    border: 1px solid var(--gh-border-default);
    color: #58a6ff;
}

.filter-tab {
    background: transparent;
    border: 1px solid var(--gh-border-default);
    color: var(--gh-fg-muted);
}

.filter-tab.active {
    background: #238636;
    color: #fff;
    border-color: #2ea043;
}

select, input[type="text"], input[type="password"], input[type="email"] {
    background-color: var(--gh-canvas-default);
    border: 1px solid var(--gh-border-default);
    color: var(--gh-fg-default);
    border-radius: 6px;
}

select:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus {
    border-color: #58a6ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3);
}

/* ============================================================
   HEADER & CONTAINERS
   ============================================================ */
.app-header {
    height: 70px;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 1.4rem;
    font-family: var(--font-title);
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.theme-toggle-btn, .nav-dashboard-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle-btn:hover, .nav-dashboard-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.app-container {
    margin-top: 70px;
    padding: 30px;
    min-height: calc(100vh - 70px);
}

.view-section {
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease-out;
}

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

.hidden {
    display: none !important;
}

/* ============================================================
   1. PORTAL LANDING LAYOUT
   ============================================================ */
.portal-hero {
    text-align: center;
    margin: 20px 0 40px;
}

.portal-hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.portal-hero p {
    font-size: 1.15rem;
    opacity: 0.8;
}

.portal-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
}

.portal-card {
    padding: 25px;
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.card-header {
    padding-bottom: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.4rem;
    font-family: var(--font-title);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
}

.filter-tab {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

/* Papers List Directory Grid */
.papers-list-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-height: 700px;
    overflow-y: auto;
    padding-right: 8px;
}

.paper-card {
    padding: 20px;
}

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

.paper-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.paper-year {
    font-weight: 700;
    font-size: 1.1rem;
}

.paper-title {
    font-size: 1.15rem;
    margin-bottom: 10px;
    font-family: var(--font-title);
}

.paper-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 15px;
}

.paper-actions {
    display: flex;
    gap: 10px;
}

/* Custom Builder Settings Form */
.portal-sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group select {
    width: 100%;
    padding: 10px;
    font-size: 0.9rem;
}

.checkbox-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    cursor: pointer;
}

/* Upgraded LeetPractice Custom Test Creator Styling */
.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.topic-toggle-btns {
    font-size: 0.75rem;
    display: flex;
    gap: 6px;
    align-items: center;
}

.topic-toggle-btns .divider {
    opacity: 0.3;
}

.text-btn {
    background: transparent;
    border: none;
    color: #a78bfa;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0;
    transition: var(--transition);
}

body.official-theme .text-btn {
    color: #2563eb;
}

.text-btn:hover {
    color: #c084fc;
    text-decoration: underline;
}

body.official-theme .text-btn:hover {
    color: #1d4ed8;
}

.topics-checklist-container {
    max-height: 180px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.official-theme .topics-checklist-container {
    border: 1px solid #d1d5db;
    background: #f9fafb;
}

.topic-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
    color: #d1d5db;
    transition: var(--transition);
}

body.official-theme .topic-checkbox-label {
    color: #4b5563;
}

.topic-checkbox-label:hover {
    color: #fff;
}

body.official-theme .topic-checkbox-label:hover {
    color: #111827;
}

.topic-checkbox-label input[type="checkbox"] {
    cursor: pointer;
    accent-color: #8b5cf6;
}

body.official-theme .topic-checkbox-label input[type="checkbox"] {
    accent-color: #1e3a8a;
}

/* Pill Selectors */
.pill-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.pill-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    color: #9ca3af;
    transition: var(--transition);
}

body.official-theme .pill-btn {
    background: #f3f4f6;
    color: #4b5563;
    border-color: #d1d5db;
}

.pill-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

body.official-theme .pill-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.pill-btn.active {
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
    color: #fff;
    border-color: #8b5cf6;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

body.official-theme .pill-btn.active {
    background: #1e3a8a;
    color: #fff;
    border-color: #1e3a8a;
    box-shadow: 0 2px 5px rgba(30, 58, 138, 0.3);
}

/* Available Count Indicator */
.custom-count-row {
    margin: 15px 0;
    text-align: center;
}

.count-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    transition: var(--transition);
}

.count-badge.has-data {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
}

body.official-theme .count-badge.has-data {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.count-badge.empty {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

body.official-theme .count-badge.empty {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

/* Scoreboard attempts table list */
.table-container {
    max-height: 400px;
    overflow-y: auto;
}


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

.history-table th, .history-table td {
    padding: 12px;
    text-align: left;
}

body.glass-theme .history-table th {
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

body.glass-theme .history-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.official-theme .history-table th {
    border-bottom: 2px solid #e5e7eb;
}

body.official-theme .history-table td {
    border-bottom: 1px solid #e5e7eb;
}

/* ============================================================
   2. EXAM SIMULATOR TCS iON CONSOLE LAYOUT
   ============================================================ */
.exam-sub-header {
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    margin-bottom: 20px;
}

body.glass-theme .exam-sub-header {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

body.official-theme .exam-sub-header {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

.exam-title-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.exam-paper-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.exam-divider {
    opacity: 0.3;
}

.exam-layout-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}

/* Left Canvas Question Pane */
.exam-question-column {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 210px);
}

body.glass-theme .exam-question-column {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

body.official-theme .exam-question-column {
    background: #fff;
    border: 1px solid #d1d5db;
}

.question-header {
    height: 55px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.glass-theme .question-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.official-theme .question-header {
    background: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
}

.question-info-badge {
    display: flex;
    gap: 10px;
}

.q-index-tag {
    font-weight: 700;
}

.q-type-tag, .q-marks-tag {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
    opacity: 0.8;
}

body.glass-theme .q-type-tag, body.glass-theme .q-marks-tag {
    background: rgba(255, 255, 255, 0.06);
}

body.official-theme .q-type-tag, body.official-theme .q-marks-tag {
    background: #e2e8f0;
    color: #334155;
}

.active-section-tag {
    font-weight: 600;
    color: #3b82f6;
}

/* Question body content canvas */
.question-body {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    max-height: 550px;
}

.question-text-content {
    font-size: 1.1rem;
    margin-bottom: 25px;
    white-space: pre-wrap;
}

.question-diagram-wrapper {
    margin: 20px 0;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
}

body.glass-theme .question-diagram-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

body.official-theme .question-diagram-wrapper {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.question-diagram-wrapper img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 4px;
}

.response-container {
    margin-top: 30px;
    padding-top: 20px;
}

body.glass-theme .response-container {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

body.official-theme .response-container {
    border-top: 1px solid #e2e8f0;
}

.input-header {
    font-size: 1rem;
    margin-bottom: 15px;
}

/* Custom Styled Option list */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-label {
    display: flex;
    align-items: flex-start;
    padding: 14px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

body.glass-theme .option-label {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

body.glass-theme .option-label:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

body.official-theme .option-label {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.official-theme .option-label:hover {
    background: #f1f5f9;
}

.option-label input {
    display: none;
}

/* Styled option radio/checkbox buttons */
.option-styled-input {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 15px;
    margin-top: 2px;
    flex-shrink: 0;
    position: relative;
}

body.glass-theme .option-styled-input {
    border: 2px solid rgba(255, 255, 255, 0.2);
}

body.official-theme .option-styled-input {
    border: 2px solid #94a3b8;
}

.option-styled-input.checkbox {
    border-radius: 4px;
}

.option-label input:checked + .option-styled-input.radio::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.option-label input:checked + .option-styled-input.checkbox::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -2px;
    left: 2px;
    font-size: 0.75rem;
}

body.glass-theme .option-label input:checked + .option-styled-input {
    border-color: #8b5cf6;
}

body.glass-theme .option-label input:checked + .option-styled-input::after {
    background: #8b5cf6;
    color: #8b5cf6;
}

body.official-theme .option-label input:checked + .option-styled-input {
    border-color: #2563eb;
}

body.official-theme .option-label input:checked + .option-styled-input::after {
    background: #2563eb;
    color: #2563eb;
}

.option-text {
    font-size: 1rem;
}

/* NAT numerical input wrapper */
.nat-input-wrapper {
    margin-top: 15px;
}

.nat-input-row {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
}

.nat-input-row input {
    width: 250px;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.nat-help-text {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Question bottom navigation bar */
.question-footer {
    height: 65px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.glass-theme .question-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body.official-theme .question-footer {
    background: #f1f5f9;
    border-top: 1px solid #cbd5e1;
}

.footer-left {
    display: flex;
    gap: 10px;
}

/* Right Exam Sidebar (Profile, Timer, Palette) */
.exam-sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.candidate-detail-card {
    padding: 20px;
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 15px;
    align-items: center;
    border-radius: 12px;
}

body.glass-theme .candidate-detail-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.official-theme .candidate-detail-card {
    background: #fff;
    border: 1px solid #cbd5e1;
}

.candidate-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
}

body.glass-theme .candidate-photo {
    background: rgba(255, 255, 255, 0.05);
    color: #a78bfa;
}

body.official-theme .candidate-photo {
    background: #e2e8f0;
    color: #64748b;
}

.candidate-info {
    display: flex;
    flex-direction: column;
}

.candidate-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.candidate-subject {
    font-size: 0.8rem;
    opacity: 0.7;
}

.exam-timer-box {
    grid-column: 1 / -1;
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

body.glass-theme .exam-timer-box {
    background: rgba(0, 0, 0, 0.2);
}

body.official-theme .exam-timer-box {
    background: #f1f5f9;
}

.timer-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.timer-digits {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
}

.timer-alert {
    animation: flashRed 1s infinite alternate;
}

@keyframes flashRed {
    from { background: rgba(239, 68, 68, 0.1); color: inherit; }
    to { background: rgba(239, 68, 68, 0.4); color: #ef4444; }
}

/* Palette State Badges & Legends */
.palette-legends {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 0.8rem;
    padding: 15px;
    border-radius: 10px;
}

body.glass-theme .palette-legends {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

body.official-theme .palette-legends {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
}

.legend-badge {
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    border-radius: 4px;
    font-weight: 700;
    margin-right: 5px;
}

/* Grid of Palette Question Buttons */
.palette-grid-container {
    flex: 1;
    border-radius: 12px;
    padding: 15px;
}

body.glass-theme .palette-grid-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.official-theme .palette-grid-container {
    background: #fff;
    border: 1px solid #cbd5e1;
}

.palette-header {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.palette-buttons-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Question Palette Buttons States */
.palette-btn {
    height: 38px;
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 4px;
    position: relative;
    transition: var(--transition);
}

.palette-btn.active {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
}

.palette-btn .dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

/* Colors matching official GATE standards */
.palette-btn.not-visited, .legend-badge.state-not-visited {
    background: #e2e8f0;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.palette-btn.not-answered, .legend-badge.state-not-answered {
    background: #ef4444;
    color: #fff;
    clip-path: polygon(10% 0%, 90% 0%, 100% 100%, 0% 100%);
}

.palette-btn.answered, .legend-badge.state-answered {
    background: #10b981;
    color: #fff;
    clip-path: polygon(0% 0%, 100% 0%, 90% 100%, 10% 100%);
}

.palette-btn.marked, .legend-badge.state-marked {
    background: #8b5cf6;
    color: #fff;
    border-radius: 50%;
}

.palette-btn.answered-marked, .legend-badge.state-answered-marked {
    background: #8b5cf6;
    color: #fff;
    border-radius: 50%;
}

.palette-btn:hover {
    filter: brightness(0.9);
}

.palette-footer {
    margin-top: 10px;
}

/* ============================================================
   3. SCORECARD & ANALYTICS LAYOUT
   ============================================================ */
.scorecard-main-card {
    max-width: 1000px;
    margin: 30px auto;
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scorecard-hero-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 40px;
}

.score-radial-progress {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

body.glass-theme .score-radial-progress {
    background: conic-gradient(#8b5cf6 0% 75%, rgba(255, 255, 255, 0.05) 75% 100%);
    border: 8px solid rgba(255, 255, 255, 0.03);
}

body.official-theme .score-radial-progress {
    background: conic-gradient(#2563eb 0% 75%, #f1f5f9 75% 100%);
    border: 8px solid #e2e8f0;
}

.progress-info {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

body.glass-theme .progress-info {
    background: #090710;
}

body.official-theme .progress-info {
    background: #fff;
}

.score-marks {
    font-size: 1.8rem;
    font-weight: 700;
}

.score-label {
    font-size: 0.8rem;
    opacity: 0.7;
}

.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

body.glass-theme .stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

body.official-theme .stat-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.stat-num {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    font-family: var(--font-title);
}

.stat-lbl {
    font-size: 0.8rem;
    opacity: 0.7;
}

.stats-legend-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    padding-bottom: 20px;
}

body.glass-theme .stats-legend-bar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.official-theme .stats-legend-bar {
    border-bottom: 1px solid #e2e8f0;
}

.legend-pill {
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
}

.legend-pill.correct { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.legend-pill.incorrect { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.legend-pill.unanswered { background: rgba(100, 116, 139, 0.1); color: #64748b; }

/* Graded Review Table */
.detailed-review-section h3 {
    margin-bottom: 20px;
    font-family: var(--font-title);
}

.review-table {
    width: 100%;
    border-collapse: collapse;
}

.review-table th, .review-table td {
    padding: 12px 15px;
    text-align: left;
}

body.glass-theme .review-table th {
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

body.glass-theme .review-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.official-theme .review-table th {
    background: #f1f5f9;
    border-bottom: 2px solid #cbd5e1;
}

body.official-theme .review-table td {
    border-bottom: 1px solid #e2e8f0;
}

.review-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

.review-status.status-correct { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.review-status.status-incorrect { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.review-status.status-unanswered { background: rgba(100, 116, 139, 0.1); color: #64748b; }

.ans-code {
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: 4px;
}

body.glass-theme .ans-code {
    background: rgba(255, 255, 255, 0.05);
}

body.official-theme .ans-code {
    background: #e2e8f0;
}

/* ============================================================
   BUTTONS AND WIDGETS
   ============================================================ */
/* Buttons */
.primary-btn, .secondary-btn, .accent-btn, .danger-btn, .utility-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.btn-xs {
    padding: 5px 10px;
    font-size: 0.75rem;
    border-radius: 4px;
}

.primary-btn {
    background: #3b82f6;
    color: #fff;
}

.primary-btn:hover { background: #2563eb; }

.secondary-btn {
    background: rgba(100, 116, 139, 0.1);
    color: inherit;
}

.secondary-btn:hover { background: rgba(100, 116, 139, 0.2); }

.accent-btn {
    background: #fbbf24;
    color: #1e293b;
}

.accent-btn:hover { background: #f59e0b; }

.danger-btn {
    background: #ef4444;
    color: #fff;
}

.danger-btn:hover { background: #dc2626; }

.utility-btn {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.utility-btn:hover { background: rgba(59, 130, 246, 0.2); }

/* FLOATING WIDGET: VIRTUAL KEYPAD */
.keypad-modal {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 320px;
    border-radius: 12px;
    z-index: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease-out;
}

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

body.glass-theme .keypad-modal {
    background: rgba(18, 14, 33, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.official-theme .keypad-modal {
    background: #fff;
    border: 1px solid #cbd5e1;
}

.keypad-header {
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.9rem;
}

body.glass-theme .keypad-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.official-theme .keypad-header {
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.close-keypad-btn, .close-calc-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}

.close-keypad-btn:hover, .close-calc-btn:hover {
    opacity: 1;
}

.keypad-grid {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.keypad-btn {
    height: 42px;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
}

body.glass-theme .keypad-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

body.glass-theme .keypad-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.official-theme .keypad-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #333;
}

body.official-theme .keypad-btn:hover {
    background: #e2e8f0;
}

.keypad-btn.double-width {
    grid-column: span 2;
}

.keypad-btn.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.keypad-btn.btn-clear {
    background: rgba(100, 116, 139, 0.2);
    color: inherit;
}

/* FLOATING WIDGET: SCIENTIFIC CALCULATOR */
.calc-modal {
    position: fixed;
    bottom: 100px;
    right: 100px;
    width: 340px;
    border-radius: 12px;
    z-index: 600;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

body.glass-theme .calc-modal {
    background: rgba(18, 14, 33, 0.95);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.official-theme .calc-modal {
    background: #fff;
    border: 1px solid #cbd5e1;
}

.calc-header {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: move;
}

body.glass-theme .calc-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.official-theme .calc-header {
    background: #1d4ed8;
    color: #fff;
}

.calc-body {
    padding: 15px;
}

#calc-screen {
    width: 100%;
    height: 48px;
    padding: 0 10px;
    font-size: 1.3rem;
    font-family: var(--font-mono);
    text-align: right;
    border-radius: 6px;
    margin-bottom: 15px;
}

.calc-keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calc-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.calc-btn {
    height: 38px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

body.glass-theme .calc-btn {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

body.glass-theme .calc-btn:hover { background: rgba(255, 255, 255, 0.1); }
body.glass-theme .calc-btn.fn { color: #a78bfa; }
body.glass-theme .calc-btn.op { color: #fbbf24; }
body.glass-theme .calc-btn.double-width { grid-column: span 2; }

body.official-theme .calc-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #333;
}

body.official-theme .calc-btn:hover { background: #e2e8f0; }
body.official-theme .calc-btn.fn { background: #eff6ff; color: #1d4ed8; }
body.official-theme .calc-btn.op { background: #fffbeb; color: #d97706; }
body.official-theme .calc-btn.double-width { grid-column: span 2; }

/* CONFIRM MODAL OVERLAY */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.confirm-modal-box {
    width: 420px;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

body.glass-theme .confirm-modal-box {
    background: #120e21;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.official-theme .confirm-modal-box {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #333;
}

.confirm-modal-box h3 {
    margin-bottom: 12px;
}

.confirm-modal-box p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 25px;
}

.confirm-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* ============================================================
   RESPONSIVENESS AND UTILITIES
   ============================================================ */
.score-high { color: #10b981; font-weight: 700; }
.score-low { color: #ef4444; font-weight: 700; }

.loading-state, .error-state, .empty-state {
    padding: 40px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.7;
    width: 100%;
}

.loading-state i {
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: block;
}

@media (max-width: 1100px) {
    .portal-grid {
        grid-template-columns: 1fr;
    }
    
    .exam-layout-grid {
        grid-template-columns: 1fr;
    }
    
    .calc-modal {
        right: 20px;
        bottom: 20px;
    }
}

/* ============================================================
   PORTAL TABS NAV IN HEADER
   ============================================================ */
.portal-nav-tabs {
    display: flex;
    gap: 10px;
    margin-left: 30px;
    flex: 1;
}

.nav-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.7;
}

.nav-tab:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    opacity: 1;
}

body.glass-theme .nav-tab.active {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

body.official-theme .nav-tab.active {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid rgba(29, 78, 216, 0.15);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
}

body.glass-theme .user-profile-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.official-theme .user-profile-badge {
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2) !important;
}

/* ============================================================
   CHARTS & METRICS ROW
   ============================================================ */
.dashboard-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.chart-card {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chart-container {
    flex: 1;
    position: relative;
    height: 300px;
    padding: 10px;
}

/* ============================================================
   LEETCODE DIRECTORY LISTING
   ============================================================ */
.search-box {
    position: relative;
    width: 250px;
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px !important;
    font-size: 0.85rem;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
    font-size: 0.85rem;
}

.filters-row-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters-row-bar select {
    padding: 8px 12px;
    font-size: 0.85rem;
    min-width: 160px;
}

.large-table {
    max-height: 600px !important;
}

.leetcode-table {
    width: 100%;
    border-collapse: collapse;
}

.leetcode-table th, .leetcode-table td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
}

body.glass-theme .leetcode-table th {
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

body.glass-theme .leetcode-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

body.official-theme .leetcode-table th {
    background: #f8fafc;
    border-bottom: 2px solid #cbd5e1;
    color: #475569;
}

body.official-theme .leetcode-table td {
    border-bottom: 1px solid #e2e8f0;
}

.leetcode-q-title {
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

body.glass-theme .leetcode-q-title:hover {
    color: #a78bfa;
}

body.official-theme .leetcode-q-title:hover {
    color: #2563eb;
}

/* ============================================================
   SINGLE QUESTION SOLVE MODAL
   ============================================================ */
.leetcode-solve-box {
    width: 800px;
    max-width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: zoomIn 0.3s ease-out;
}

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

body.glass-theme .leetcode-solve-box {
    background: #120e21;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.official-theme .leetcode-solve-box {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #333;
}

.solve-box-header {
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

body.glass-theme .solve-box-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.official-theme .solve-box-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.solve-title {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-title);
}

.solve-badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
}

body.glass-theme .solve-badge {
    background: rgba(255, 255, 255, 0.05);
}

body.official-theme .solve-badge {
    background: #e2e8f0;
    color: #334155;
}

.solve-box-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.solve-q-text {
    font-size: 1.15rem;
    margin-bottom: 25px;
    white-space: pre-wrap;
}

.solve-response-area {
    margin: 25px 0;
}

.solve-box-footer {
    padding: 15px 25px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

body.glass-theme .solve-box-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.official-theme .solve-box-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* Feedback Box */
.solve-feedback-box {
    margin-top: 25px;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: left;
}

.solve-feedback-box.correct {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.solve-feedback-box.incorrect {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.solve-feedback-box p {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.solve-answer-key {
    font-size: 0.9rem !important;
    font-weight: 400 !important;
}

body.glass-theme .solve-answer-key {
    color: #a78bfa;
}

body.official-theme .solve-answer-key {
    color: #1d4ed8;
}

@media (max-width: 900px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-stats-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================================ */
/* PREMIUM STUDY RESOURCES HUB & CUSTOM COMPONENTS              */
/* ============================================================ */

/* Study Hub Layout */
.study-hub-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 25px;
    height: 750px;
    margin-top: 15px;
}

/* Sidebar topics */
.hub-sidebar {
    border-radius: 12px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

body.glass-theme .hub-sidebar {
    background: rgba(22, 18, 45, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
}

body.official-theme .hub-sidebar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.hub-sidebar-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-left: 10px;
}

body.glass-theme .hub-sidebar-title {
    color: var(--text-secondary);
}

body.official-theme .hub-sidebar-title {
    color: #64748b;
}

.topic-item-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-radius: 8px;
    border: none;
    text-align: left;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    width: 100%;
}

body.glass-theme .topic-item-btn {
    color: var(--text-primary);
}

body.glass-theme .topic-item-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.glass-theme .topic-item-btn.active {
    background: var(--accent-gradient);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.2);
}

body.official-theme .topic-item-btn {
    color: #334155;
}

body.official-theme .topic-item-btn:hover {
    background: #f1f5f9;
}

body.official-theme .topic-item-btn.active {
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
}

.topic-progress-badge {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 20px;
}

body.glass-theme .topic-progress-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

body.glass-theme .topic-item-btn.active .topic-progress-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

body.official-theme .topic-progress-badge {
    background: #e2e8f0;
    color: #1e3a8a;
}

/* Hub Main Content */
.hub-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: auto;
    padding-right: 5px;
}

.hub-subject-selector {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 5px;
}

.subject-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

body.glass-theme .subject-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

body.glass-theme .subject-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.35);
}

body.official-theme .subject-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
}

body.official-theme .subject-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.hub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 15px;
}

body.official-theme .hub-header {
    border-bottom: 1px solid #e2e8f0;
}

.hub-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
}

/* Grid of resources */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.resource-card {
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 15px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

body.glass-theme .resource-card {
    background: rgba(22, 18, 45, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.glass-theme .resource-card:hover {
    border-color: rgba(0, 240, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 240, 255, 0.05);
}

body.official-theme .resource-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

body.official-theme .resource-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.resource-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.resource-badge.video {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.resource-badge.material {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.resource-info h4 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
    padding-right: 50px; /* spacing for badge */
}

.resource-desc {
    font-size: 0.88rem;
    margin-bottom: 12px;
}

body.glass-theme .resource-desc {
    color: var(--text-secondary);
}

body.official-theme .resource-desc {
    color: #64748b;
}

.resource-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
}

body.glass-theme .resource-meta {
    color: rgba(255, 255, 255, 0.4);
}

body.official-theme .resource-meta {
    color: #94a3b8;
}

.resource-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 15px;
    margin-top: 5px;
}

body.official-theme .resource-actions {
    border-top: 1px solid #f1f5f9;
}

.progress-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}

.progress-toggle input {
    cursor: pointer;
}

.btn-watch, .btn-download {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

body.glass-theme .btn-watch {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent);
}

body.glass-theme .btn-watch:hover {
    background: var(--accent-gradient);
    color: #ffffff;
}

body.official-theme .btn-watch {
    background: #e0f2fe;
    color: #0369a1;
}

body.official-theme .btn-watch:hover {
    background: #0284c7;
    color: #ffffff;
}

body.glass-theme .btn-download {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

body.glass-theme .btn-download:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.official-theme .btn-download {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

body.official-theme .btn-download:hover {
    background: #cbd5e1;
}

/* YouTube Theatre Overlay */
.video-theater-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 5, 16, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.theater-content {
    width: 90%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
}

.youtube-iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.youtube-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.theater-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.theater-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
}

.close-theater-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-theater-btn:hover {
    background: rgba(255, 50, 50, 0.2);
    color: #ff5c75;
    transform: rotate(90deg);
}

/* Quick Quiz Card */
.quick-quiz-banner {
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 10px;
    background: linear-gradient(135deg, rgba(112, 0, 255, 0.2) 0%, rgba(0, 240, 255, 0.05) 100%);
    border: 1px solid rgba(112, 0, 255, 0.2);
}

body.official-theme .quick-quiz-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}

.quiz-banner-text h3 {
    font-size: 1.3rem;
    margin-bottom: 6px;
    font-weight: 700;
}

.quiz-banner-text p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.btn-quiz-start {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 15px rgba(112, 0, 255, 0.4);
    transition: var(--transition);
}

body.glass-theme .btn-quiz-start {
    background: var(--accent-gradient);
    color: #ffffff;
}

body.glass-theme .btn-quiz-start:hover {
    transform: scale(1.05);
}

body.official-theme .btn-quiz-start {
    background: #2563eb;
    color: #ffffff;
}

body.official-theme .btn-quiz-start:hover {
    background: #1d4ed8;
}

/* ============================================================ */
/* FOCUS TIMER (POMODORO) WIDGET                                */
/* ============================================================ */
.pomodoro-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 250px;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.glass-theme .pomodoro-widget {
    background: rgba(18, 14, 38, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
}

body.official-theme .pomodoro-widget {
    background: #ffffff;
    border: 1px solid #cbd5e1;
}

.pomodoro-widget.minimized {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.pomodoro-widget.minimized .pomodoro-full {
    display: none;
}

.pomodoro-mini-trigger {
    display: none;
    font-size: 1.3rem;
    color: var(--accent);
}

.pomodoro-widget.minimized .pomodoro-mini-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.pomodoro-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.pomodoro-header h4 {
    font-weight: 600;
    color: var(--accent);
}

.pomodoro-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pomodoro-timer-display {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    font-family: var(--font-mono);
    margin: 5px 0;
}

.pomodoro-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.pomo-btn {
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.pomo-btn.start {
    background: var(--success);
    color: #060510;
}

.pomo-btn.pause {
    background: var(--warning);
    color: #060510;
}

.pomo-btn.reset {
    background: var(--danger);
    color: #ffffff;
}

.ambient-noise-select {
    padding: 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: inherit;
    width: 100%;
}

body.glass-theme .ambient-noise-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

body.official-theme .ambient-noise-select {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
}

/* ============================================================ */
/* SPACED REPETITION FLASHCARDS                                 */
/* ============================================================ */
.flashcards-container {
    max-width: 650px;
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

/* 3D card layout */
.flashcard-wrapper {
    width: 100%;
    height: 320px;
    perspective: 1000px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 16px;
}

.flashcard-wrapper.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

body.glass-theme .flashcard-front, body.glass-theme .flashcard-back {
    background: rgba(22, 18, 45, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.official-theme .flashcard-front, body.official-theme .flashcard-back {
    background: #ffffff;
    border: 1px solid #cbd5e1;
}

.flashcard-back {
    transform: rotateY(180deg);
}

.card-topic-tag {
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 20px;
    font-weight: 500;
}

body.glass-theme .card-topic-tag {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent);
}

body.official-theme .card-topic-tag {
    background: #dbeafe;
    color: #1e40af;
}

.card-text {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.5;
}

.flashcard-back .card-text {
    font-size: 1.15rem;
    font-weight: 400;
    text-align: left;
    width: 100%;
}

.card-flip-prompt {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: 30px;
}

.flashcard-buttons {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
}

.flashcard-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.flashcard-btn.review-later {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.flashcard-btn.review-later:hover {
    background: #ef4444;
    color: #ffffff;
}

.flashcard-btn.know-it {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.flashcard-btn.know-it:hover {
    background: #10b981;
    color: #ffffff;
}

.flashcard-deck-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* ============================================================ */
/* DASHBOARD UPGRADES: WEAKNESS REC & HEATMAP                   */
/* ============================================================ */

.dashboard-upgrades-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 25px;
}

@media (max-width: 900px) {
    .dashboard-upgrades-grid {
        grid-template-columns: 1fr;
    }
}

.weakness-card-title {
    color: var(--danger) !important;
}

.weak-areas-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.weak-area-block {
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.glass-theme .weak-area-block {
    background: rgba(255, 92, 117, 0.04);
    border: 1px solid rgba(255, 92, 117, 0.1);
}

body.official-theme .weak-area-block {
    background: #fff5f5;
    border: 1px solid #fee2e2;
}

.weak-area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.weak-area-name {
    font-weight: 600;
    font-size: 1rem;
}

.weak-area-pct {
    color: var(--danger);
    font-weight: 700;
    font-size: 0.95rem;
}

.weak-area-recs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.rec-badge-item {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    transition: var(--transition);
}

body.glass-theme .rec-badge-item {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.glass-theme .rec-badge-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.official-theme .rec-badge-item {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

body.official-theme .rec-badge-item:hover {
    background: #e2e8f0;
}

/* Activity Heatmap */
.heatmap-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.heatmap-info {
    font-size: 0.85rem;
    opacity: 0.8;
}

.heatmap-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.heatmap-cell {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    position: relative;
    cursor: default;
}

body.glass-theme .heatmap-cell {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

body.official-theme .heatmap-cell {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

/* Heatmap intensity colors */
.heatmap-cell.level-0 {
    /* base color */
}

body.glass-theme .heatmap-cell.level-1 {
    background: rgba(0, 240, 255, 0.2);
    color: #ffffff;
    border-color: rgba(0, 240, 255, 0.3);
}
body.glass-theme .heatmap-cell.level-2 {
    background: rgba(0, 240, 255, 0.4);
    color: #ffffff;
    border-color: rgba(0, 240, 255, 0.5);
}
body.glass-theme .heatmap-cell.level-3 {
    background: rgba(112, 0, 255, 0.6);
    color: #ffffff;
    border-color: rgba(112, 0, 255, 0.8);
}

body.official-theme .heatmap-cell.level-1 {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}
body.official-theme .heatmap-cell.level-2 {
    background: #93c5fd;
    color: #1e3a8a;
    border-color: #60a5fa;
}
body.official-theme .heatmap-cell.level-3 {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
}

.heatmap-cell-tooltip {
    display: none;
    position: absolute;
    bottom: 38px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

body.glass-theme .heatmap-cell-tooltip {
    background: #0f0c20;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.1);
}

body.official-theme .heatmap-cell-tooltip {
    background: #334155;
    color: #ffffff;
}

.heatmap-cell:hover .heatmap-cell-tooltip {
    display: block;
}

