/* ==========================================================================
   EduByte Angular Masterclass - Custom Dark Theme & Interactive Editor Stylesheet
   ========================================================================== */

:root {
    --accent-purple: #dd0031;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
}

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

/* Dark Theme (Default Night Mode) */
body.dark-theme {
    --bg-dark: #070e1b;
    --bg-card: #0f172a;
    --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(221, 0, 49, 0.3);
    --widget-bg: #090d16;
    --widget-toolbar-bg: #0e1526;
    --editor-bg: #090d16;
    --editor-line-bg: #0d1424;
    --editor-text: #f1f5f9;
    --terminal-bg: #030712;
    --input-console-bg: #080f1e;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    background-color: var(--bg-dark);
    color: var(--text-main);
}

/* Light Theme (Day Mode) */
body.light-theme {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #f1f5f9;
    --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.1);
    --border-glow: rgba(221, 0, 49, 0.4);
    --widget-bg: #ffffff;
    --widget-toolbar-bg: #e2e8f0;
    --editor-bg: #ffffff;
    --editor-line-bg: #f8fafc;
    --editor-text: #0f172a;
    --terminal-bg: #1e293b;
    --input-console-bg: #e2e8f0;
    --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    background-color: var(--bg-dark);
    color: var(--text-main);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

/* ==========================================================================
   GLOBAL SCROLLBAR SUPPRESSION (REMOVE ALL BOTTOM & RIGHT SCROLL LINES)
   ========================================================================== */
::-webkit-scrollbar {
    width: 0px !important;
    height: 0px !important;
    display: none !important;
    background: transparent !important;
}

::-webkit-resizer {
    display: none !important;
}

html,
body,
.main-layout,
.content-area,
.sidebar,
.topic-nav-list,
.editor-container,
.code-editor,
.line-numbers,
.terminal-output-block,
.terminal-screen,
.modal-box,
.quiz-section,
.topic-quiz-section,
.topic-section-card {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.content-area::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.editor-container::-webkit-scrollbar,
.code-editor::-webkit-scrollbar,
.terminal-screen::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* --------------------------------------------------------------------------
   App Header & Brand - Fixed at Top
   -------------------------------------------------------------------------- */
.app-header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

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

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

.brand-text {
    display: flex;
    align-items: center;
}

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

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

.logo-icon:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.4) !important;
}

.logo-icon svg {
    color: #ffffff !important;
    stroke: #ffffff !important;
}

.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;
    line-height: 1;
}

.brand-badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid;
    font-weight: 600;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-color: var(--accent-purple);
}

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

/* Sidebar Styling */
.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    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-purple);
    box-shadow: 0 0 0 3px rgba(221, 0, 49, 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 14px;
    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: 10px;
}

body.light-theme .topic-nav-btn {
    color: #475569;
}

.topic-nav-btn:hover {
    background: rgba(168, 85, 247, 0.1) !important;
    color: var(--text-main) !important;
    border-color: rgba(168, 85, 247, 0.3) !important;
}

body.light-theme .topic-nav-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.topic-nav-btn.active {
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.3), rgba(59, 130, 246, 0.2)) !important;
    border: 1px solid rgba(168, 85, 247, 0.6) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.25) !important;
}

body.light-theme .topic-nav-btn.active {
    background: linear-gradient(90deg, #ffe4e6, #e0f2fe);
    border: 1px solid #e11d48;
    color: #881337 !important;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.15);
}

.topic-nav-btn.active span {
    color: inherit !important;
}

.topic-status-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    transition: all 0.25s ease;
    flex-shrink: 0;
    cursor: pointer;
}

body.light-theme .topic-status-icon {
    border-color: #cbd5e1;
}

.topic-status-icon:hover {
    border-color: #10b981;
    transform: scale(1.1);
}

.topic-nav-btn.completed .topic-status-icon {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.topic-nav-btn.completed .topic-status-icon::after {
    content: '✓';
    color: #ffffff !important;
    font-size: 0.8rem;
    font-weight: 900;
}

/* Mobile Toggle Bar removed */

/* Navigation Buttons Styling (Previous & Next Topic Glow) */
.topic-bottom-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.btn-nav-topic {
    padding: 10px 22px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.btn-prev-topic {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color, rgba(255,255,255,0.15));
    color: var(--text-title, #ffffff);
}

.btn-prev-topic:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-next-topic, .btn-complete-topic {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%) !important;
    border: 1px solid transparent !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 18px rgba(6, 182, 212, 0.4) !important;
    padding: 10px 22px;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.btn-next-topic:hover:not(:disabled), .btn-complete-topic:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(6, 182, 212, 0.6) !important;
    filter: brightness(1.1);
}

.btn-nav-topic:disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

/* --------------------------------------------------------------------------
   Top-Right 3-Line Hamburger Menu Button
   -------------------------------------------------------------------------- */
.menu-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
    padding: 0;
    z-index: 101;
}

.menu-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.menu-toggle-btn:active {
    transform: scale(0.94);
}

.menu-toggle-btn .bar {
    width: 20px;
    height: 2px;
    background-color: var(--text-main, var(--text-primary, #f8fafc));
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

body.light-theme .menu-toggle-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .menu-toggle-btn .bar {
    background-color: #0f172a;
}

/* Transformed X state when menu is open */
.menu-toggle-btn.open .bar-1 {
    transform: translateY(7px) rotate(45deg);
}

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

.menu-toggle-btn.open .bar-3 {
    transform: translateY(-7px) rotate(-45deg);
}

/* Desktop Collapsible Sidebar */
@media (min-width: 901px) {
    .main-layout.sidebar-collapsed {
        grid-template-columns: 1fr !important;
    }
    .main-layout.sidebar-collapsed .sidebar {
        display: none !important;
    }
}

/* Hide mobile-nav-toggle in favor of top-right hamburger menu */
.mobile-nav-toggle { display: none !important; }


/* ==========================================================================
   MASTER TOPIC CARD, BADGE & PLAYGROUND STYLING
   ========================================================================== */
.content-area {
    padding: 24px 32px;
    overflow-y: auto;
    width: 100%;
}

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

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

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

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    padding-bottom: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.topic-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-title, var(--text-main, #ffffff));
    line-height: 1.3;
}

.topic-badge {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #c084fc;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

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

.subtopic-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

.subtopic-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 12px;
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    margin: 0;
}

.feature-list li {
    position: relative;
    padding-left: 24px;
    color: var(--text-body, #cbd5e1);
    font-size: 0.9rem;
    line-height: 1.6;
}

.feature-list li::before {
    content: "⚡";
    position: absolute;
    left: 0;
    top: 0;
    color: #f59e0b;
}

.feature-list li strong, .feature-list li b {
    color: var(--text-title, #ffffff);
}

/* Code Compiler Widget */
.code-compiler-widget {
    background: #090d16;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.widget-toolbar {
    background: #0e1526;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.widget-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #38bdf8;
}

.widget-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
    color: var(--text-main, #f8fafc);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.btn-run {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}

.btn-run:hover {
    background: rgba(16, 185, 129, 0.35);
}

.btn-reset {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #f59e0b !important;
}

.btn-reset:hover {
    background: rgba(245, 158, 11, 0.3) !important;
    transform: translateY(-1px) !important;
}

.btn-copy {
    background: rgba(6, 182, 212, 0.15) !important;
    border-color: rgba(6, 182, 212, 0.3) !important;
    color: #38bdf8 !important;
}

.btn-copy:hover {
    background: rgba(6, 182, 212, 0.3) !important;
    transform: translateY(-1px) !important;
}

.editor-container {
    display: flex;
    position: relative;
    min-height: 140px;
    background: #090d16;
}

.line-numbers {
    width: 42px;
    padding: 12px 0;
    background: #0d1424;
    color: #64748b;
    font-family: 'Fira Code', monospace;
    font-size: 0.83rem;
    text-align: center;
    user-select: none;
    border-right: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.code-editor {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #38bdf8;
    font-family: 'Fira Code', monospace;
    font-size: 0.86rem;
    line-height: 1.5;
    outline: none;
    resize: none !important;
    white-space: pre;
    overflow-x: auto;
    overflow-y: auto;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.code-editor::-webkit-scrollbar,
.editor-container::-webkit-scrollbar {
    display: none !important;
    width: 0px !important;
    height: 0px !important;
    background: transparent !important;
}

.terminal-output-block {
    background: #030712;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.terminal-header {
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.3);
    font-size: 0.68rem;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
}

.terminal-screen {
    margin: 0;
    padding: 6px 10px;
    color: #4ade80;
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    white-space: pre-wrap;
    min-height: auto;
    background: #090d16;
}

/* Light Theme Support */
body.light-theme .app-header {
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 60%, #1e3a8a 100%) !important; border-bottom: 1px solid rgba(99, 102, 241, 0.25) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .brand-name {
    color: #0f172a !important;
}

body.light-theme .logo-icon {
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.25) !important;
}

body.light-theme .sidebar {
    background: #f8fafc !important;
    border-right: 1px solid #e2e8f0 !important;
}

body.light-theme .sidebar-search-box {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-theme #topic-search-input {
    color: #0f172a !important;
    background: transparent !important;
}

body.light-theme #topic-search-input::placeholder {
    color: #94a3b8 !important;
}

body.light-theme .topic-nav-btn {
    color: #475569 !important;
    background: transparent !important;
}

body.light-theme .topic-nav-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-theme .topic-nav-btn.active {
    background: linear-gradient(90deg, #ffe4e6, #e0f2fe) !important;
    border: 1px solid #e11d48 !important;
    color: #881337 !important;
    font-weight: 700 !important;
}

body.light-theme .topic-section-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

body.light-theme .topic-title {
    color: #0f172a !important;
}

body.light-theme .topic-badge {
    background: rgba(168, 85, 247, 0.1) !important;
    color: #7e22ce !important;
    border-color: rgba(168, 85, 247, 0.3) !important;
}

body.light-theme .topic-description {
    color: #334155 !important;
}

body.light-theme .subtopic-group {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .subtopic-title {
    color: #0284c7 !important;
}

body.light-theme .feature-list li {
    color: #475569 !important;
}

body.light-theme .feature-list li strong, body.light-theme .feature-list li b {
    color: #0f172a !important;
}

/* Light Theme Code Compiler Widget */
body.light-theme .code-compiler-widget {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .widget-toolbar {
    background: #f1f5f9 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .widget-title {
    color: #0284c7 !important;
}

body.light-theme .btn-action {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

body.light-theme .btn-action:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-theme .btn-run {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #047857 !important;
}

body.light-theme .btn-reset {
    background: rgba(2, 132, 199, 0.12) !important;
    border-color: rgba(2, 132, 199, 0.3) !important;
    color: #0284c7 !important;
}

body.light-theme .btn-copy {
    background: rgba(147, 51, 234, 0.12) !important;
    border-color: rgba(147, 51, 234, 0.3) !important;
    color: #7e22ce !important;
}

body.light-theme .editor-container {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .line-numbers {
    background: #f8fafc !important;
    color: #94a3b8 !important;
    border-right: 1px solid #e2e8f0 !important;
}

body.light-theme .code-editor {
    color: #0f172a !important;
    background: #ffffff !important;
}

body.light-theme .terminal-output-block {
    background: #0f172a !important;
}

body.light-theme .terminal-header {
    background: #0b1329 !important;
    color: #94a3b8 !important;
}

body.light-theme .terminal-screen {
    background: #0f172a !important;
    color: #4ade80 !important;
}

/* Light Theme Quiz Section */
body.light-theme .topic-quiz-section {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .quiz-section-header h3,
body.light-theme .quiz-title {
    color: #0f172a !important;
}

body.light-theme .quiz-question-box {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03) !important;
}

body.light-theme .quiz-q-text {
    color: #0f172a !important;
}

body.light-theme .quiz-opt-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

body.light-theme .quiz-opt-btn:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

body.light-theme .quiz-opt-btn.correct {
    background: rgba(34, 197, 94, 0.15) !important;
    border-color: #22c55e !important;
    color: #15803d !important;
    font-weight: 700 !important;
}

body.light-theme .quiz-opt-btn.wrong {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: #ef4444 !important;
    color: #b91c1c !important;
    font-weight: 700 !important;
}

body.light-theme .quiz-ans-explanation {
    background: rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    color: #92400e !important;
}

body.light-theme .btn-toggle-answers {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

/* Light Theme Interview Section */
body.light-theme .topic-interview-section {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .interview-section-title {
    color: #0f172a !important;
}

body.light-theme .interview-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .interview-header {
    color: #0f172a !important;
}

body.light-theme .interview-header:hover {
    background: #f8fafc !important;
}

body.light-theme .interview-q-title {
    color: #0f172a !important;
}

body.light-theme .interview-a-box {
    background: #ffffff !important;
    color: #334155 !important;
    border-top: 1px solid #e2e8f0 !important;
}

body.light-theme .interview-a-box b {
    color: #0f172a !important;
}

body.light-theme .interview-arrow {
    color: #64748b !important;
}

/* Light Theme Navigation Buttons */
body.light-theme .btn-nav-topic {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

body.light-theme .btn-prev-topic {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

body.light-theme .btn-prev-topic:hover:not(:disabled) {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-theme .btn-next-topic {
    background: linear-gradient(135deg, #0284c7, #2563eb) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35) !important;
}

/* Light Theme Tables */
body.light-theme table,
body.light-theme .concept-table {
    border-color: #cbd5e1 !important;
}

body.light-theme table th,
body.light-theme .concept-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

body.light-theme table td,
body.light-theme .concept-table td {
    color: #334155 !important;
    border-color: #e2e8f0 !important;
}

/* Responsive Overrides */
@media (max-width: 900px) {
    .content-area {
        padding: 16px;
    }

    .topic-section-card {
        padding: 0 0 16px 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .topic-title {
        font-size: 1.25rem;
    }

    .widget-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .widget-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .btn-action {
        flex: 1;
        text-align: center;
    }
}


/* --------------------------------------------------------------------------
   Mobile & Tablet Responsive Drawer Styles
   -------------------------------------------------------------------------- */
.mobile-nav-toggle {
    display: none !important;
}

/* Hide Hamburger Menu on Desktop - Sidebar is always visible on desktop! */
@media (min-width: 901px) {
    .menu-toggle-btn {
        display: none !important;
    }
    .sidebar {
        display: flex !important;
    }
    .main-layout {
        display: grid !important;
        grid-template-columns: 320px 1fr !important;
    }
}

/* Show Hamburger Menu and Drawer on Mobile */
@media (max-width: 900px) {
    .menu-toggle-btn {
        display: inline-flex !important;
    }

    .main-layout {
        display: block !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .sidebar {
        position: fixed !important;
        top: 64px !important;
        left: 0 !important;
        width: 100vw !important;
        height: calc(100vh - 64px) !important;
        background: var(--bg-sidebar) !important;
        z-index: 999 !important;
        display: none !important;
        flex-direction: column !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
        padding: 16px !important;
        overflow-y: auto !important;
    }

    .sidebar.open,
    .sidebar.mobile-active {
        display: flex !important;
    }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE FIX - ZERO HORIZONTAL OVERFLOW / NO RIGHT CUTOFF
   ========================================================================== */
html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
}

.main-layout,
.content-area,
.topic-section-card,
.subtopic-group,
.topic-description,
.feature-list,
.feature-list li,
.code-compiler-widget,
.editor-container,
.code-editor,
.terminal-output-block,
.terminal-screen,
.live-preview-box,
.topic-quiz-section,
.topic-interview-section {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.code-compiler-widget {
    min-width: 0 !important;
    overflow: hidden !important;
}

.editor-container {
    min-width: 0 !important;
    overflow-x: auto !important;
}

.code-editor {
    min-width: 0 !important;
    width: 100% !important;
}

.terminal-output-block,
.terminal-screen,
.live-preview-box {
    min-width: 0 !important;
    overflow-x: auto !important;
}

/* Tablet Optimizations (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .content-area {
        padding: 20px 20px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .topic-section-card {
        padding: 0 0 18px 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
    }

    .subtopic-group {
        padding: 16px 16px !important;
    }
}

/* Mobile Phone Optimizations (<= 768px) */
@media (max-width: 768px) {
    .content-area {
        padding: 12px 10px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .topic-section-card {
        padding: 0 0 16px 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        margin-bottom: 20px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .topic-header {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 8px !important;
        padding-bottom: 12px !important;
        margin-bottom: 14px !important;
        flex-wrap: wrap !important;
    }

    .topic-title {
        font-size: 1.15rem !important;
        line-height: 1.3 !important;
        flex: 1 1 auto !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .topic-badge {
        font-size: 0.70rem !important;
        padding: 3px 8px !important;
        flex-shrink: 0 !important;
    }

    .topic-description {
        font-size: 0.88rem !important;
        line-height: 1.55 !important;
        margin-bottom: 16px !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .subtopic-group {
        padding: 12px 10px !important;
        margin-bottom: 14px !important;
        border-radius: 10px !important;
    }

    .subtopic-title {
        font-size: 0.95rem !important;
        margin-bottom: 8px !important;
        word-break: break-word !important;
    }

    .feature-list {
        gap: 8px !important;
    }

    .feature-list li {
        font-size: 0.84rem !important;
        padding-left: 20px !important;
        line-height: 1.5 !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .widget-toolbar {
        padding: 8px 10px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .widget-title {
        font-size: 0.80rem !important;
        word-break: break-word !important;
    }

    .widget-actions {
        width: 100% !important;
        display: flex !important;
        gap: 6px !important;
    }

    .btn-action {
        flex: 1 !important;
        padding: 6px 8px !important;
        font-size: 0.72rem !important;
        text-align: center !important;
    }

    .line-numbers {
        width: 32px !important;
        font-size: 0.75rem !important;
        padding: 10px 0 !important;
    }

    .code-editor {
        padding: 10px 8px !important;
        font-size: 0.78rem !important;
    }

    .topic-quiz-section,
    .topic-interview-section {
        padding: 12px 10px !important;
        border-radius: 10px !important;
        margin: 16px 0 !important;
    }

    .quiz-section-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .btn-toggle-answers {
        width: 100% !important;
        text-align: center !important;
    }

    .quiz-opt-btn {
        font-size: 0.95rem !important;
        padding: 8px 10px !important;
        word-break: break-word !important;
    }

    .topic-footer-nav {
        flex-direction: row !important;
        gap: 8px !important;
    }

    .btn-nav-step {
        flex: 1 !important;
        padding: 8px 10px !important;
        font-size: 0.78rem !important;
        text-align: center !important;
    }
}

/* Modal Overlay & Certificate Popup */
.modal-overlay {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 9999 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    box-sizing: border-box !important;
}
.modal-overlay.open, .modal-overlay.active {
    display: flex !important;
    animation: fadeIn 0.25s ease;
}
.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 620px;
    padding: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    position: relative;
    max-height: 88vh;
    overflow-y: auto;
    box-sizing: border-box;
}
body.light-theme .modal-box {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}
.modal-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1.1rem;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}
.certificate-preview-card {
    background: linear-gradient(135deg, rgba(221, 0, 49, 0.1), rgba(195, 0, 47, 0.1));
    border: 2px dashed rgba(221, 0, 49, 0.4);
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    margin: 16px 0;
}
.cert-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: #dd0031;
    margin-top: 8px;
}
.cert-recipient {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-title);
    margin: 10px 0;
    text-decoration: underline;
    text-decoration-color: #dd0031;
}

/* ==========================================================================
   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;
}


/* ==========================================================================
   CODE EDITOR SCROLLBAR REMOVAL (HIDE BOTTOM & RIGHT SCROLLBAR LINES)
   ========================================================================== */
.code-editor,
.editor-container,
.code-compiler-widget textarea,
.terminal-screen,
.editor-textarea,
.sql-textarea,
.inline-preview-frame {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.code-editor::-webkit-scrollbar,
.editor-container::-webkit-scrollbar,
.code-compiler-widget textarea::-webkit-scrollbar,
.terminal-screen::-webkit-scrollbar,
.editor-textarea::-webkit-scrollbar,
.sql-textarea::-webkit-scrollbar,
.inline-preview-frame::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !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, #dc2626 0%, #991b1b 100%) !important;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 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;
}
