/* ==========================================================================
   Aptitude & Reasoning Main Hub - Stylesheet
   EduByte Design System (100% Mobile Responsive)
   ========================================================================== */

:root {
    --bg-main: #070f1e;
    --bg-card: #0d192e;
    --bg-card-hover: #142442;
    --bg-glass: linear-gradient(135deg, #1e1b4b 0%, #0f172a 60%, #1e3a8a 100%);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(56, 189, 248, 0.25);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-blue: #38bdf8;
    --accent-purple: #a855f7;
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #a855f7 100%);
    --accent-glow: rgba(56, 189, 248, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.2);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-glass: linear-gradient(135deg, #1e1b4b 0%, #0f172a 60%, #1e3a8a 100%);
    --border-color: #e2e8f0;
    --border-accent: rgba(14, 165, 233, 0.3);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
}

html,
body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

::-webkit-scrollbar {
    width: 0px !important;
    height: 0px !important;
    display: none !important;
}

*,
*:before,
*:after {
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    padding-top: 56px;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    padding-top: env(safe-area-inset-top, 0px);
    width: 100%;
    box-sizing: border-box;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.nav-container::after {
    display: none !important;
}

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

.back-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.45);
    color: #ffffff;
}

#header-saved-btn,
.header-saved-btn,
#theme-toggle,
.theme-btn {
    display: none !important;
}

.brand-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.theme-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

/* Main Hub Layout */
.app-container {
    max-width: 1200px;
    width: 100% !important;
    margin: 0 auto;
    padding: 14px 16px 32px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

.hero-header {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.2rem 16px;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    width: 100% !important;
    box-sizing: border-box !important;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent-glow);
    color: var(--accent-blue);
    border: 1px solid var(--border-accent);
    padding: 0.4rem 1.0rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

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

/* Two Big Category Cards Grid */
.hub-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

.hub-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color) !important;
    border-radius: var(--radius-xl);
    padding: 1.75rem 16px !important;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    gap: 1.25rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.hub-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.hub-card.quant:hover {
    border-color: rgba(56, 189, 248, 0.4);
}

.hub-card.logical:hover {
    border-color: rgba(168, 85, 247, 0.4);
}

.hub-card.verbal:hover {
    border-color: rgba(13, 148, 136, 0.4);
}

.card-icon-banner {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.card-icon-banner.quant-bg {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.card-icon-banner.logical-bg {
    background: rgba(168, 85, 247, 0.12);
    color: var(--accent-purple);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.card-icon-banner.verbal-bg {
    background: rgba(13, 148, 136, 0.12);
    color: #2dd4bf;
    border: 1px solid rgba(13, 148, 136, 0.3);
}

.card-badge-pill {
    position: absolute;
    top: 1.75rem;
    right: 1.75rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.hub-card.quant .card-badge-pill {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.hub-card.logical .card-badge-pill {
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.hub-card.verbal .card-badge-pill {
    background: rgba(13, 148, 136, 0.15);
    color: #2dd4bf;
    border: 1px solid rgba(13, 148, 136, 0.3);
}

.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.card-features-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}

.card-features-list li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-action-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.hub-card.quant .card-action-btn {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.hub-card.quant:hover .card-action-btn {
    background: var(--accent-blue);
    color: #ffffff;
}

.hub-card.logical .card-action-btn {
    background: rgba(168, 85, 247, 0.1);
    color: var(--accent-purple);
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.hub-card.logical:hover .card-action-btn {
    background: var(--accent-purple);
    color: #ffffff;
}

.hub-card.verbal .card-action-btn {
    background: rgba(13, 148, 136, 0.1);
    color: #0d9488;
    border: 1px solid rgba(13, 148, 136, 0.25);
}

.hub-card.verbal:hover .card-action-btn {
    background: #0d9488;
    color: #ffffff;
}

body.dark-theme .hub-card.verbal .card-action-btn {
    background: rgba(45, 212, 191, 0.1);
    color: #2dd4bf;
    border: 1px solid rgba(45, 212, 191, 0.3);
}

body.dark-theme .hub-card.verbal:hover .card-action-btn {
    background: #0d9488;
    color: #ffffff;
}

.card-action-btn .btn-arrow-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.card-action-btn .btn-arrow-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.6;
    transition: transform 0.25s ease;
}

.hub-card:hover .card-action-btn .btn-arrow-icon {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateX(5px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.hub-card:hover .card-action-btn .btn-arrow-icon svg {
    transform: translateX(1px);
}

body.light-theme .card-action-btn .btn-arrow-icon {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .hub-card:hover .card-action-btn .btn-arrow-icon {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    color: #ffffff;
}

/* Responsive Rules */
@media (max-width: 768px) {
    .app-container {
        padding: 1.25rem 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .hero-header {
        padding: 1.5rem 14px !important;
        margin-bottom: 1.25rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .hero-title {
        font-size: 1.5rem !important;
    }

    .hero-subtitle {
        font-size: 0.85rem !important;
        line-height: 1.6 !important;
    }

    .hub-grid {
        width: 100% !important;
        box-sizing: border-box !important;
        gap: 1.25rem !important;
    }

    .hub-card {
        padding: 1.25rem 14px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .card-title {
        font-size: 1.25rem !important;
    }

    .card-action-btn {
        font-size: 0.95rem !important;
    }
}


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

.btn-next-topic:hover:not(:disabled) {
    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;
}

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


/* 50 Practice Problems Text Justify */
.problem-statement,
.sol-step,
.sol-trick-highlight,
.problem-card p {
    text-align: justify !important;
    text-justify: inter-word !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;
}


        /* Mobile-First Single-Row Navbar Alignment */
        .navbar {
            position: sticky !important;
            top: 0 !important;
            left: 0 !important;
            right: 0 !important;
            width: 100% !important;
            z-index: 1000 !important;
            padding-top: var(--safe-area-top, 0px) !important;
            min-height: 56px !important;
            height: auto !important;
            box-sizing: border-box !important;
        }

        .nav-container {
            max-width: 1200px !important;
            margin: 0 auto !important;
            padding: 8px 12px !important;
            display: flex !important;
            flex-direction: row !important;
            align-items: center !important;
            justify-content: flex-start !important;
            width: 100% !important;
            box-sizing: border-box !important;
        }

        .nav-left {
            display: flex !important;
            flex-direction: row !important;
            align-items: center !important;
            gap: 10px !important;
            width: 100% !important;
            flex-wrap: nowrap !important;
            min-width: 0 !important;
        }

        .back-btn {
            width: 38px !important;
            height: 38px !important;
            min-width: 38px !important;
            min-height: 38px !important;
            border-radius: 10px !important;
            flex-shrink: 0 !important;
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
            text-decoration: none !important;
            border: none !important;
        }

        .nav-course-brand {
            display: flex !important;
            flex-direction: row !important;
            align-items: center !important;
            gap: 8px !important;
            flex-wrap: nowrap !important;
            min-width: 0 !important;
            flex: 1 !important;
            overflow: hidden !important;
        }

        .nav-course-title {
            font-family: 'Outfit', sans-serif !important;
            font-weight: 800 !important;
            font-size: 1.25rem !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            line-height: 1.1 !important;
            margin: 0 !important;
            padding: 0 !important;
            display: inline-block !important;
            flex-shrink: 1 !important;
        }

        .nav-course-badge {
            display: inline-block !important;
            padding: 3px 8px !important;
            border-radius: 6px !important;
            font-size: 0.68rem !important;
            font-weight: 700 !important;
            text-transform: uppercase !important;
            letter-spacing: 0.4px !important;
            line-height: 1 !important;
            white-space: nowrap !important;
            flex-shrink: 0 !important;
        }

        @media (max-width: 480px) {
            .nav-container {
                padding: 6px 10px !important;
            }
            .back-btn {
                width: 36px !important;
                height: 36px !important;
                min-width: 36px !important;
                min-height: 36px !important;
            }
            .nav-left {
                gap: 8px !important;
            }
            .nav-course-brand {
                gap: 6px !important;
            }
            .nav-course-title {
                font-size: 1.08rem !important;
            }
            .nav-course-badge {
                font-size: 0.65rem !important;
                padding: 2px 6px !important;
            }
        }

        @media (max-width: 360px) {
            .nav-course-title {
                font-size: 0.95rem !important;
            }
            .nav-course-badge {
                display: none !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, #0284c7 0%, #a855f7 100%) !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 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;
}
