/* ==========================================================================
   Learn2Code / EduByte - English Grammar & Verbal Ability Stylesheet
   Modern Glassmorphism, Dark/Light Themes, Mobile-First Responsiveness
   ========================================================================== */

:root {
    --accent-primary: #0d9488;
    --accent-secondary: #2563eb;
    --accent-gradient: linear-gradient(135deg, #0d9488, #2563eb);
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
}

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

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Theme */
body.dark-theme {
    --bg-dark: #070e1b;
    --bg-card: #0f172a;
    --bg-card-sub: rgba(15, 23, 42, 0.7);
    --bg-sidebar: #0b1329;
    --header-bg: linear-gradient(135deg, #1e1b4b 0%, #0f172a 60%, #1e3a8a 100%);
    --text-main: #f8fafc;
    --text-title: #ffffff;
    --text-body: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(13, 148, 136, 0.35);
    --code-bg: #030712;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    background-color: var(--bg-dark);
    color: var(--text-main);
}

/* Light Theme */
body.light-theme {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-sub: #f1f5f9;
    --bg-sidebar: #f8fafc;
    --header-bg: linear-gradient(135deg, #1e1b4b 0%, #0f172a 60%, #1e3a8a 100%);
    --text-main: #0f172a;
    --text-title: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(13, 148, 136, 0.4);
    --code-bg: #1e293b;
    --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    background-color: var(--bg-dark);
    color: var(--text-main);
}

/* Header */
.app-header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45) !important;
    text-decoration: none;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.logo-icon:hover {
    transform: scale(1.05);
}

.brand-text {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.brand-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.32rem; font-weight: 800; letter-spacing: -0.015em;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.menu-toggle-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
}

.menu-toggle-btn .bar {
    width: 100%;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Transformed Into (X) Animation when menu is open */
.menu-toggle-btn.open .bar:nth-child(1),
.menu-toggle-btn.active .bar:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
    background: #38bdf8;
}

.menu-toggle-btn.open .bar:nth-child(2),
.menu-toggle-btn.active .bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle-btn.open .bar:nth-child(3),
.menu-toggle-btn.active .bar:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
    background: #38bdf8;
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 310px 1fr;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 63px);
}

/* Sidebar */
.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: calc(100vh - 63px);
    position: sticky;
    top: 63px;
    overflow-y: auto;
}

.sidebar-search-box {
    position: relative;
}

.sidebar-search-box input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px 10px 38px;
    color: var(--text-main);
    font-size: 0.88rem;
    outline: none;
    transition: all 0.2s ease;
}

body.light-theme .sidebar-search-box input {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

.sidebar-search-box input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.sidebar-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.topic-nav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.topic-nav-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
}

.topic-nav-btn:hover {
    background: rgba(13, 148, 136, 0.1);
    color: var(--text-main);
}

.topic-nav-btn.active {
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.25), rgba(37, 99, 235, 0.15));
    border: 1px solid var(--accent-primary);
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.2);
}

body.light-theme .topic-nav-btn.active {
    background: linear-gradient(90deg, #ccfbf1, #dbeafe);
    color: #0f766e !important;
}

.topic-status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
}

.topic-nav-btn.completed .topic-status-icon {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff;
}

.topic-nav-btn.completed .topic-status-icon::after {
    content: '✓';
    color: #fff;
    font-weight: 800;
}

.menu-utility-btn {
    background: rgba(13, 148, 136, 0.08);
    border: 1px dashed rgba(13, 148, 136, 0.3);
    color: var(--text-main);
}

/* Content Area */
.content-area {
    padding: 30px;
    max-width: 1040px;
    margin: 0 auto;
    width: 100%;
}

.topic-section-card {
    display: none;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 0 24px 0 !important;
    animation: fadeIn 0.3s ease;
}

.topic-section-card.active-topic {
    display: block;
}

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

.topic-header {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 18px;
}

.topic-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-title);
    margin-bottom: 10px;
}

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

.topic-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(13, 148, 136, 0.15);
    color: #2dd4bf;
    border: 1px solid rgba(13, 148, 136, 0.3);
}

.topic-description {
    font-size: 1rem;
    color: var(--text-body);
    line-height: 1.7;
    margin-bottom: 24px;
}

.subtopic-group {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: var(--card-shadow);
}

.subtopic-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-title);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Grids and Cards */
.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.concept-card {
    background: var(--bg-card-sub);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.concept-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

.concept-card-icon {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.concept-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-title);
    margin-bottom: 6px;
}

.concept-card-desc {
    font-size: 0.85rem;
    color: var(--text-body);
    line-height: 1.5;
}

/* Feature List */
.feature-list {
    list-style: none;
    margin: 14px 0;
}

.feature-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    font-size: 0.92rem;
    color: var(--text-body);
}

.feature-list li::before {
    content: '📌';
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.85rem;
}

/* Example Rules Box */
.example-box {
    background: rgba(13, 148, 136, 0.08);
    border-left: 4px solid var(--accent-primary);
    padding: 12px 16px;
    border-radius: 0 10px 10px 0;
    margin: 14px 0;
    font-size: 0.9rem;
}

.example-box strong {
    color: #2dd4bf;
}

body.light-theme .example-box strong {
    color: #0f766e;
}

/* Interactive Tense & Rule Simulator */
.interactive-grammar-box {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.08), rgba(37, 99, 235, 0.08));
    border: 1px solid rgba(13, 148, 136, 0.3);
    border-radius: 14px;
    padding: 18px;
    margin: 18px 0;
}

.grammar-sim-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-title);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.grammar-sim-select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 11px 12px;
    color: var(--text-main);
    font-size: 0.9rem;
    margin-bottom: 12px;
    outline: none;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.grammar-sim-result {
    padding: 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 0.9rem;
    color: #5eead4;
    line-height: 1.6;
}

body.light-theme .grammar-sim-result {
    background: #e2e8f0;
    color: #0f172a;
}

/* Quiz Section */
.quiz-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    margin-top: 24px;
}

.quiz-question-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-title);
    margin-bottom: 14px;
}

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

.quiz-opt-btn {
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    text-align: left;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-opt-btn:hover {
    background: rgba(13, 148, 136, 0.12);
    border-color: var(--accent-primary);
}

.quiz-opt-btn.correct {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: #10b981 !important;
    color: #34d399 !important;
    font-weight: 700;
}

.quiz-opt-btn.wrong {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    color: #f87171 !important;
}

.quiz-feedback {
    margin-top: 10px;
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 6px;
    display: none;
}

/* Topic Bottom Navigation Buttons */
.topic-bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    gap: 12px;
}

.btn-nav-topic {
    padding: 10px 18px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-nav-topic:hover {
    background: var(--accent-gradient);
    color: #ffffff;
    border-color: transparent;
}

.btn-complete-topic {
    padding: 10px 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 18px;
    width: 92%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    color: var(--text-main);
    padding: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}

/* Certificate Card */
.cert-card {
    background: linear-gradient(135deg, #090f1d, #0b172d);
    border: 3px double #d4af37;
    border-radius: 14px;
    padding: 30px;
    text-align: center;
    margin: 18px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    color: #ffffff;
}

.cert-badge-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.cert-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 2px;
    color: #facc15;
    font-weight: 800;
}

.cert-subtitle {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 8px 0;
}

.cert-user-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: #2dd4bf;
    margin: 10px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.2);
    display: inline-block;
    padding: 0 20px 4px 20px;
}

.cert-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    font-size: 0.8rem;
    color: #94a3b8;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 12px;
}

/* Cheat Sheet Table */
.cheat-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.86rem;
}

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

.cheat-table th {
    background: rgba(13, 148, 136, 0.1);
    color: var(--text-title);
    font-weight: 700;
}

/* Responsive & Mobile-First Styling */
@media (max-width: 900px) {
    .menu-toggle-btn {
        display: flex;
    }
    .main-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
        position: fixed;
        left: 0;
        top: 60px;
        width: 100%;
        height: calc(100vh - 60px);
        z-index: 99;
        background: var(--bg-dark);
        padding: 16px 14px;
    }
    .sidebar.open {
        display: flex;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 8px 14px;
        gap: 10px;
    }
    .brand-name { font-size: 1.18rem; }
    .logo-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }
    .menu-toggle-btn {
        width: 36px;
        height: 36px;
        padding: 7px;
    }
    .content-area {
        padding: 16px 12px;
    }
    .topic-title {
        font-size: 1.3rem;
        line-height: 1.3;
        margin-bottom: 8px;
    }
    .topic-header {
        margin-bottom: 16px;
        padding-bottom: 14px;
    }
    .badge-row {
        gap: 6px;
    }
    .topic-badge {
        font-size: 0.72rem;
        padding: 3px 8px;
    }
    .topic-description {
        font-size: 0.9rem;
        margin-bottom: 16px;
        line-height: 1.6;
    }
    .subtopic-group {
        padding: 14px 12px;
        margin-bottom: 18px;
        border-radius: 12px;
    }
    .subtopic-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    .concept-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .concept-card {
        padding: 13px 12px;
        border-radius: 10px;
    }
    .concept-card-title {
        font-size: 0.92rem;
    }
    .concept-card-desc {
        font-size: 0.84rem;
        line-height: 1.5;
    }
    .table-scroll-hint {
        display: flex;
    }
    .topic-bottom-nav {
        flex-direction: column-reverse;
        gap: 10px;
        margin-top: 20px;
        padding-top: 16px;
    }
    .btn-nav-topic, .btn-complete-topic {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
        font-size: 0.92rem;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
    }
    .quiz-box {
        padding: 14px 12px;
        border-radius: 12px;
        margin-top: 18px;
    }
    .quiz-question-title {
        font-size: 0.92rem;
        line-height: 1.4;
        margin-bottom: 12px;
    }
    .quiz-opt-btn {
        padding: 12px 12px;
        font-size: 0.95rem;
        min-height: 44px;
        line-height: 1.4;
    }
    .interactive-grammar-box {
        padding: 14px 12px;
        border-radius: 12px;
    }
    .grammar-sim-title {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    .grammar-sim-select {
        font-size: 0.86rem;
        padding: 10px 8px;
    }
    .grammar-sim-result {
        padding: 12px 10px;
        font-size: 0.86rem;
    }
    .drill-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .drill-card {
        padding: 14px 12px;
    }
    .drill-action-btn {
        padding: 10px 14px;
        min-height: 42px;
    }
    .simple-tip-box, .warning-box, .example-box, .info-banner {
        padding: 10px 12px;
        font-size: 0.86rem;
        border-radius: 0 8px 8px 0;
    }
}

@media (max-width: 420px) {
    .header-container {
        padding: 8px 10px;
    }
    .brand-name { font-size: 1.08rem; }
    .logo-icon {
        width: 30px;
        height: 30px;
    }
    .menu-toggle-btn {
        width: 34px;
        height: 34px;
        padding: 6px;
    }
    .content-area {
        padding: 12px 8px;
    }
    .subtopic-group {
        padding: 12px 10px;
    }
}


/* ==========================================================================
   Enhancements: Simple Rule Callouts, Badges, Tables, Drills
   ========================================================================== */
.simple-tip-box {
    background: rgba(16, 185, 129, 0.09);
    border-left: 4px solid #10b981;
    border-radius: 0 10px 10px 0;
    padding: 12px 16px;
    margin: 14px 0;
    font-size: 0.92rem;
    line-height: 1.6;
}

.simple-tip-box strong {
    color: #34d399;
}

body.light-theme .simple-tip-box strong {
    color: #059669;
}

.warning-box {
    background: rgba(239, 68, 68, 0.08);
    border-left: 4px solid #ef4444;
    border-radius: 0 10px 10px 0;
    padding: 12px 16px;
    margin: 14px 0;
    font-size: 0.92rem;
    line-height: 1.6;
}

.warning-box strong {
    color: #f87171;
}

body.light-theme .warning-box strong {
    color: #dc2626;
}

.info-banner {
    background: rgba(37, 99, 235, 0.08);
    border-left: 4px solid #2563eb;
    border-radius: 0 10px 10px 0;
    padding: 12px 16px;
    margin: 14px 0;
    font-size: 0.92rem;
    line-height: 1.6;
}

.info-banner strong {
    color: #60a5fa;
}

.formula-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(13, 148, 136, 0.2);
    border: 1px solid rgba(13, 148, 136, 0.4);
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #2dd4bf;
    margin: 4px 0;
}

body.light-theme .formula-tag {
    background: #e6fffa;
    border-color: #99f6e4;
    color: #0f766e;
}

.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 14px 0;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
    scrollbar-width: none !important;
    
}

body.light-theme .table-responsive-wrapper {
    background: #f8fafc;
}

.table-scroll-hint {
    display: none;
    font-size: 0.74rem;
    color: #2dd4bf;
    padding: 6px 12px;
    background: rgba(13, 148, 136, 0.08);
    border-bottom: 1px dashed var(--border-color);
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.comparison-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    margin: 0;
    border: none;
}

.comparison-table th, .comparison-table td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    font-size: 0.88rem;
    text-align: left;
}

.comparison-table th {
    background: rgba(13, 148, 136, 0.15);
    color: var(--text-title);
    font-weight: 700;
}

.comparison-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

body.light-theme .comparison-table tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.pill-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-main);
}

.drill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.drill-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--card-shadow);
}

.drill-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 700;
    color: #2dd4bf;
    font-size: 0.92rem;
}

.drill-card-question {
    font-size: 0.95rem;
    color: var(--text-title);
    margin-bottom: 12px;
    line-height: 1.5;
}

.drill-action-btn {
    width: 100%;
    padding: 8px 12px;
    background: rgba(13, 148, 136, 0.15);
    border: 1px solid rgba(13, 148, 136, 0.3);
    color: #2dd4bf;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drill-action-btn:hover {
    background: var(--accent-primary);
    color: #fff;
}

.drill-card-reveal {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    font-size: 0.88rem;
    display: none;
    line-height: 1.5;
}

body.light-theme .drill-card-reveal {
    background: #e2e8f0;
}

/* ==========================================================================
   5. Dynamic Tense Explorer & Rule System
   ========================================================================== */
.tense-dynamic-wrapper {
    margin-top: 18px;
    animation: fadeInTense 0.35s ease;
}

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

.tense-formula-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.tense-formula-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.tense-formula-pill strong {
    color: #2dd4bf;
    display: block;
    margin-bottom: 4px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tense-signal-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.tense-signal-tag {
    background: rgba(13, 148, 136, 0.12);
    color: #2dd4bf;
    border: 1px solid rgba(13, 148, 136, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
}

.tense-examples-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 14px 0;
}

.tense-example-item {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--accent-primary);
    border-radius: 0 10px 10px 0;
    padding: 12px 16px;
    font-size: 0.92rem;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tense-example-tag {
    font-size: 0.76rem;
    font-weight: 700;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tense-trap-card {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 12px;
    padding: 16px;
    margin: 14px 0;
}

.tense-trap-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #f87171;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.tense-trap-wrong {
    color: #fca5a5;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.tense-trap-right {
    color: #86efac;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.tense-trap-reason {
    font-size: 0.84rem;
    color: var(--text-muted);
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 8px;
    line-height: 1.5;
}

/* ==========================================================================
   6. 20-Question Interactive Quiz Engine
   ========================================================================== */
.interactive-quiz-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px;
    margin-top: 26px;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.quiz-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.quiz-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-title);
}

.quiz-title-badge span.badge-num {
    background: var(--accent-gradient);
    color: white;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 800;
}

.quiz-stats-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quiz-stat-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.quiz-stat-pill.score-pill {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.quiz-stat-pill.streak-pill {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.quiz-progress-track {
    width: 100%;
    height: 7px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 18px;
}

body.light-theme .quiz-progress-track {
    background: #e2e8f0;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0d9488, #2563eb, #10b981);
    border-radius: 10px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-question-box {
    margin-bottom: 16px;
}

.quiz-q-indicator {
    font-size: 0.8rem;
    font-weight: 700;
    color: #2dd4bf;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.quiz-question-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-title);
    line-height: 1.5;
    margin-bottom: 16px;
}

.quiz-options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.quiz-option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 0.92rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.quiz-option-item:hover:not(:disabled) {
    background: rgba(13, 148, 136, 0.12);
    border-color: var(--accent-primary);
    transform: translateX(3px);
}

.quiz-opt-letter {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
    color: var(--text-title);
    transition: background 0.2s;
}

.quiz-option-item.correct {
    background: rgba(16, 185, 129, 0.18) !important;
    border-color: #10b981 !important;
    color: #34d399 !important;
    font-weight: 700;
}

.quiz-option-item.correct .quiz-opt-letter {
    background: #10b981;
    color: white;
}

.quiz-option-item.wrong {
    background: rgba(239, 68, 68, 0.18) !important;
    border-color: #ef4444 !important;
    color: #f87171 !important;
}

.quiz-option-item.wrong .quiz-opt-letter {
    background: #ef4444;
    color: white;
}

.quiz-feedback-card {
    padding: 14px 16px;
    border-radius: 10px;
    margin: 12px 0 16px 0;
    font-size: 0.9rem;
    line-height: 1.5;
    animation: fadeInTense 0.25s ease;
}

.quiz-feedback-card.correct-feedback {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid #10b981;
    color: #34d399;
}

.quiz-feedback-card.wrong-feedback {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid #ef4444;
    color: #fca5a5;
}

.quiz-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.btn-quiz-nav {
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-quiz-prev {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-quiz-prev:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.btn-quiz-prev:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-quiz-next {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.btn-quiz-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.45);
}

.btn-quiz-toggle-all {
    background: none;
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
}

.btn-quiz-toggle-all:hover {
    color: var(--text-main);
    border-color: var(--accent-primary);
}

/* Quiz Completion Screen */
.quiz-results-card {
    text-align: center;
    padding: 30px 18px;
    animation: fadeInTense 0.4s ease;
}

.quiz-results-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
}

.quiz-results-score {
    font-size: 2.2rem;
    font-weight: 800;
    color: #2dd4bf;
    margin-bottom: 6px;
    font-family: 'Outfit', sans-serif;
}

.quiz-results-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-title);
    margin-bottom: 8px;
}

.quiz-results-desc {
    font-size: 0.92rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 20px auto;
    line-height: 1.5;
}

.quiz-results-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-quiz-retry {
    padding: 11px 22px;
    border-radius: 10px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

/* 20 Questions Review Sheet Accordion */
.quiz-review-drawer {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
    display: none;
}

.quiz-review-drawer.open {
    display: block;
    animation: fadeInTense 0.3s ease;
}

.review-item-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.review-q-num {
    font-weight: 800;
    color: #2dd4bf;
    margin-bottom: 4px;
}

.review-ans-row {
    margin-top: 6px;
    color: #86efac;
    font-weight: 600;
}

.review-expl-row {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==========================================================================
   Text Justifying for English Grammar & Verbal Ability Readability
   ========================================================================== */
p, .detail-title-group p, .explanation, .rule-card p, .concept-text,
.example-box p, .guide-paragraph, .concept-description, .rule-explanation,
.solution-detail, .formula-explanation, .quiz-explanation, .problem-explanation,
.detail-text, .reading-text, .vocab-meaning, .tab-content p, .grammar-card p,
.rule-box p, .lesson-content p, .example-meaning, .tip-box p, .vocab-example,
.passage-body, .rc-passage, .cloze-passage, .para-jumble-line, .review-expl-row {
    text-align: justify;
    text-justify: inter-word;
}

/* ==========================================================================
   MOBILE SAFE AREA & STATUS BAR TOP INSET
   Prevents battery, wifi, and network icons from overlapping the navbar
   ========================================================================== */
:root {
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

@media screen and (max-width: 768px) {
    :root {
        --safe-area-top: max(env(safe-area-inset-top, 0px), 28px);
    }
}

html.is-mobile-app,
html.is-mobile-device {
    --safe-area-top: max(env(safe-area-inset-top, 0px), 28px);
}

.app-header, .navbar, .studio-header {
    padding-top: var(--safe-area-top) !important;
    min-height: calc(56px + var(--safe-area-top)) !important;
    box-sizing: border-box !important;
}


/* Quiz Option Font Size Upgrade */
.quiz-opt-btn {
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
}
@media (max-width: 768px) {
    .quiz-opt-btn {
        font-size: 0.92rem !important;
    }
}

/* ==========================================================================
   INTERVIEW & QUIZ REFINEMENTS + MOBILE RIGHT-CUTOFF & MENU FIXES
   ========================================================================== */
/* 1. Big Unified Topic Container Card across All Courses */
.topic-section-card {
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.85) 0%, rgba(10, 17, 34, 0.95) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 18px !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45) !important;
    padding: 24px 22px 26px !important;
    margin-bottom: 24px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
}
body.light-theme .topic-section-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06) !important;
}
@media (max-width: 768px) {
    .topic-section-card {
        padding: 18px 14px 20px !important;
        border-radius: 14px !important;
        margin-bottom: 18px !important;
    }
}

/* 2. Standardized Font Sizes across All Courses */
.topic-title,
.topic-header h2,
.topic-header .topic-title {
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    color: #f8fafc !important;
    margin-top: 0 !important;
    margin-bottom: 10px !important;
}
body.light-theme .topic-title,
body.light-theme .topic-header h2,
body.light-theme .topic-header .topic-title {
    color: #0f172a !important;
}
@media (max-width: 768px) {
    .topic-title,
    .topic-header h2,
    .topic-header .topic-title {
        font-size: 1.25rem !important;
    }
}

.topic-description,
.topic-description p,
.subtopic-group p,
.concept-card p,
.concept-explanation,
.content-area p {
    font-size: 0.96rem !important;
    line-height: 1.65 !important;
    color: #cbd5e1 !important;
}
body.light-theme .topic-description,
body.light-theme .topic-description p,
body.light-theme .subtopic-group p,
body.light-theme .concept-card p,
body.light-theme .concept-explanation,
body.light-theme .content-area p {
    color: #334155 !important;
}

.subtopic-title,
.section-subheading,
.concept-title {
    font-size: 1.12rem !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    margin-top: 20px !important;
    margin-bottom: 12px !important;
}

/* 3. Standardized Previous & Next Navigation Buttons across All Courses */
.topic-bottom-nav,
.topic-footer-nav {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 28px !important;
    padding-top: 20px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
body.light-theme .topic-bottom-nav,
body.light-theme .topic-footer-nav {
    border-top-color: #e2e8f0 !important;
}

.btn-nav-step,
.btn-nav,
.btn-nav-topic,
.btn-prev-topic,
.btn-next-topic,
.btn-next-step {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 22px !important;
    min-height: 44px !important;
    border-radius: 10px !important;
    font-family: inherit !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}

.btn-nav-step:not(.btn-next-step),
.btn-prev-topic,
.btn-nav:first-child:not(.btn-next-topic) {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #e2e8f0 !important;
    box-shadow: none !important;
}
.btn-nav-step:not(.btn-next-step):hover,
.btn-prev-topic:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}
body.light-theme .btn-nav-step:not(.btn-next-step),
body.light-theme .btn-prev-topic {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

.btn-next-step,
.btn-next-topic,
.btn-nav.btn-next-topic {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    border: 1px solid #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35) !important;
}
.btn-next-step:hover,
.btn-next-topic:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%) !important;
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5) !important;
    transform: translateY(-1px) !important;
}

.btn-nav-step:disabled,
.btn-prev-topic:disabled,
.btn-next-step:disabled,
.btn-next-topic:disabled,
button[disabled] {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
    transform: none !important;
}

/* 4. Hide Triangle Dropdown Icons in All Interview Questions */
.interview-toggle-icon,
.accordion-arrow,
.interview-arrow,
.interview-question .accordion-arrow,
.interview-question .interview-arrow,
.interview-q-header .interview-toggle-icon,
.interview-card .accordion-arrow,
.interview-card .interview-arrow,
.interview-card .arrow-icon,
.interview-card .toggle-icon {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
}

/* 5. Remove Outer Boxes for Quiz & Interview Sections */
.interview-section,
.interview-qa-section,
.topic-interview-section,
.quiz-section,
.topic-quiz-section,
.quiz-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 20px !important;
}
body.light-theme .interview-section,
body.light-theme .interview-qa-section,
body.light-theme .topic-interview-section,
body.light-theme .quiz-section,
body.light-theme .topic-quiz-section,
body.light-theme .quiz-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* 6. Gap & Styling between Interview Cards (No Touching / Gap between cards) */
.interview-card,
.interview-item {
    margin-bottom: 14px !important;
    margin-top: 0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}
.interview-card:last-child,
.interview-item:last-child {
    margin-bottom: 0 !important;
}
.interview-question {
    border-radius: 10px !important;
    cursor: pointer !important;
}

/* 7. Text Justification for Quiz & Interview Answers (Clean, No Huge Gaps) */

/* Force Left Alignment on All Questions, Headers & Option Buttons (Eliminates Huge Word Gaps) */
.interview-card,
.interview-q-header,
.interview-q-header *,
.interview-q-text,
.interview-question,
.interview-question *,
.quiz-q-title,
.quiz-question,
.quiz-question *,
.quiz-opt-btn,
.quiz-opts-group,
.quiz-opts-group * {
    text-align: left !important;
    text-justify: auto !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
}

/* Clean Text Justification for Paragraphs & Explanations (No Huge Word Gaps / Natural Flow) */
.topic-description,
.topic-description p,
.analogy-body,
.analogy-body p,
.feature-list li,
.subtopic-group p,
.concept-card p,
.callout-content,
.callout-content p,
.quiz-ans-explanation,
.quiz-ans-explanation p,
.quiz-explanation,
.quiz-explanation p,
.interview-a-box,
.interview-a-box p,
.interview-answer,
.interview-answer p,
.problem-statement,
.sol-step,
.sol-trick-highlight,
.problem-card p {
    text-align: justify !important;
    text-justify: inter-word !important;
    text-align-last: left !important;
    -webkit-hyphens: auto !important;
    -ms-hyphens: auto !important;
    hyphens: auto !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
}

/* 8. Fix Menu First Topic Being Pushed Up Under Header */
@media (max-width: 900px) {
    .sidebar,
    .sidebar-panel,
    #sidebar-panel,
    .course-sidebar,
    .topics-drawer,
    .menu-drawer {
        top: calc(58px + var(--safe-area-top, 28px)) !important;
        height: calc(100vh - 58px - var(--safe-area-top, 28px)) !important;
        padding-top: 18px !important;
        box-sizing: border-box !important;
    }
    .topic-nav-list,
    .sidebar-topics,
    .topics-list,
    .nav-list {
        padding-top: 14px !important;
    }
    .topic-nav-list > .topic-nav-btn:first-child,
    .sidebar-topics > *:first-child,
    .topic-nav-list > *:first-child,
    .topics-list > *:first-child,
    .nav-list > *:first-child {
        margin-top: 12px !important;
    }
}

/* 9. Mobile Right-Side Content Cut-Off Prevention */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}
*, *::before, *::after {
    box-sizing: border-box !important;
}
.main-layout,
.content-area,
.subtopic-group,
.topic-description,
.concept-card,
.interview-card,
.analogy-box,
.code-compiler-widget,
.editor-container,
.code-editor,
.terminal-output-block,
.terminal-screen,
.live-preview-box,
.quiz-card {
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}
pre, code {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
}
table, .concept-table {
    max-width: 100% !important;
    width: 100% !important;
    display: block !important;
    overflow-x: auto !important;
    box-sizing: border-box !important;
}
@media (max-width: 768px) {
    .content-area {
        padding-left: 14px !important;
        padding-right: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
}


/* Zero-Lag Mobile GPU Acceleration: Eliminate heavy Gaussian blur on mobile WebView */
@media (max-width: 900px) {
    .app-header, .navbar, .studio-header,
    .sidebar, .sidebar-panel, #sidebar-panel,
    .modal-box, .modal-content, .card, .hub-card, .topic-section-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* ==========================================================================
   PERFECT NATURAL TEXT ALIGNMENT: JUSTIFIED INTERVIEW QUESTIONS & ANSWERS
   ========================================================================== */
.interview-q-header,
.interview-question {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 12px !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

.interview-q-text,
.interview-question span:first-child,
.interview-q-header span:first-child,
.question-text {
    display: block !important;
    flex: 1 !important;
    text-align: justify !important;
    text-justify: inter-word !important;
    text-align-last: left !important;
    -webkit-hyphens: auto !important;
    -ms-hyphens: auto !important;
    hyphens: auto !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    line-height: 1.55 !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
    box-sizing: border-box !important;
}

.interview-a-box,
.interview-a-box p,
.interview-answer,
.interview-answer p,
.interview-body,
.interview-body p {
    text-align: justify !important;
    text-justify: inter-word !important;
    text-align-last: left !important;
    -webkit-hyphens: auto !important;
    -ms-hyphens: auto !important;
    hyphens: auto !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    line-height: 1.65 !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
}

.interview-toggle-icon,
.accordion-arrow {
    flex-shrink: 0 !important;
    margin-left: auto !important;
    margin-top: 3px !important;
}

/* Quiz Questions & Options Left Aligned */
.quiz-q-title,
.quiz-question,
.quiz-opt-btn,
.quiz-opts-group {
    text-align: left !important;
    text-justify: auto !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
}

/* Ensure Navbar text is always crisp white on royal gradient */
.app-header .brand-name,
.navbar .brand-name,
.navbar .brand-title,
.brand-name,
.brand-title,
body.dark-theme .app-header .brand-name,
body.dark-theme .navbar .brand-name,
body.dark-theme .navbar .brand-title,
body.dark-theme .brand-name,
body.dark-theme .brand-title,
body.light-theme .app-header .brand-name,
body.light-theme .navbar .brand-name,
body.light-theme .navbar .brand-title {
    color: #ffffff !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45) !important;
}
body.light-theme .app-header .logo-icon,
body.light-theme .navbar .back-btn,
body.light-theme .menu-toggle-btn,
body.dark-theme .app-header .logo-icon,
body.dark-theme .navbar .back-btn,
body.dark-theme .menu-toggle-btn {
    color: #ffffff !important;
}


/* ==========================================================================
   Zero-Lag GPU Acceleration & Virtual Lazy Rendering (Smooth 60FPS)
   ========================================================================== */
.subtopic-item-card,
.analogy-box,
.quiz-card,
.interview-q-card,
.code-compiler-widget,
.hub-card,
.feature-card,
.project-card {
    content-visibility: auto;
    contain-intrinsic-size: 1px 320px;
}


/* ==========================================================================
   Zero-Bug High-Contrast Quiz Colors (Green Correct / Red Wrong)
   ========================================================================== */
.quiz-opt-btn.correct,
.quiz-opt-btn.correct:hover,
.quiz-opt-btn.correct:focus,
.quiz-opt-btn.correct:active {
    background: #10b981 !important;
    border: 2px solid #059669 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45) !important;
}

.quiz-opt-btn.wrong,
.quiz-opt-btn.wrong:hover,
.quiz-opt-btn.wrong:focus,
.quiz-opt-btn.wrong:active,
.quiz-opt-btn.incorrect,
.quiz-opt-btn.incorrect:hover,
.quiz-opt-btn.incorrect:focus,
.quiz-opt-btn.incorrect:active {
    background: #ef4444 !important;
    border: 2px solid #dc2626 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45) !important;
}

body.light-theme .quiz-opt-btn.correct,
body.light-theme .quiz-opt-btn.correct:hover,
body.light-theme .quiz-opt-btn.correct:focus {
    background: #10b981 !important;
    border: 2px solid #059669 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
}

body.light-theme .quiz-opt-btn.wrong,
body.light-theme .quiz-opt-btn.wrong:hover,
body.light-theme .quiz-opt-btn.wrong:focus,
body.light-theme .quiz-opt-btn.incorrect,
body.light-theme .quiz-opt-btn.incorrect:hover {
    background: #ef4444 !important;
    border: 2px solid #dc2626 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
}

/* Course Hub Matching Theme Back Button */
.back-btn {
background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%) !important;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.45) !important;
    color: #ffffff !important;
}
/* Classic Old Blue Back Button for Course Lesson Pages */
.logo-icon {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45) !important;
    color: #ffffff !important;
}
