/* ==========================================================================
   dsa.css — DSA section styles: section picker, category grid, question
              list, question detail, approach tabs, difficulty badges, etc.
   ========================================================================== */

/* ========== SECTION PICKER (Dev / DSA split cards) ========== */
#section-picker {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 40px;
}

#section-picker.hidden { display: none; }

/* Back to landing from section picker */
.picker-back-btn {
    position: absolute;
    top: 28px;
    left: 32px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 10px;
    background: #0a0a0a;
    border: 1px solid #1e1e1e;
    color: #525252;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Google Sans', 'DM Sans', sans-serif;
    z-index: 1;
}

.picker-back-btn:hover {
    background: #141414;
    color: #d4d4d8;
    border-color: #333;
}

.section-pick-card {
    position: relative;
    width: 380px;
    height: 440px;
    border-radius: 24px;
    background: #0a0a0a;
    border: 1px solid #1e1e1e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section-pick-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(ellipse at 50% 120%, var(--card-glow, rgba(250,204,21,0.06)) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.section-pick-card:hover {
    border-color: var(--card-border, rgba(250,204,21,0.25));
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 80px var(--card-shadow, rgba(250,204,21,0.06));
}

.section-pick-card:hover::before { opacity: 1; }

.section-pick-card .pick-icon {
    font-size: 64px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.section-pick-card .pick-title {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #fafafa;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.section-pick-card .pick-desc {
    font-size: 14px;
    color: #525252;
    text-align: center;
    max-width: 260px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.section-pick-card .pick-arrow {
    position: absolute;
    bottom: 28px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #333;
    transition: color 0.3s ease, transform 0.3s ease;
    z-index: 1;
}

.section-pick-card:hover .pick-arrow {
    color: var(--card-accent, #facc15);
    transform: translateX(4px);
}

/* ========== DSA CATEGORY GRID ========== */
#dsa-view {
    display: none;
}

#dsa-view.active {
    display: block;
}

/* DSA Home Branding */
.dsa-branding {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.dsa-branding:hover { opacity: 0.8; }

.dsa-branding .brand-title {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #fafafa;
    letter-spacing: -0.02em;
    transition: color 0.2s ease;
}

.dsa-branding:hover .brand-title {
    color: #facc15;
}

.dsa-branding .brand-sub {
    font-size: 11px;
    color: #525252;
    margin-top: 2px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.dsa-header {
    padding: 40px 48px 16px;
    margin: 0 auto;
}

.dsa-header-row {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
}

.dsa-header-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.dsa-header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
}

.dsa-header-center h1,
.dsa-header-center p {
    pointer-events: auto;
}

.dsa-header-center h1 {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 42px;
    font-weight: 800;
    color: #fafafa;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.dsa-header-center p {
    font-size: 15px;
    color: #525252;
    line-height: 1.6;
}

.dsa-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 10px;
    background: #0a0a0a;
    border: 1px solid #1e1e1e;
    color: #737373;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Google Sans', 'DM Sans', sans-serif;
    width: fit-content;
}

.dsa-back-btn:hover {
    background: #141414;
    color: #d4d4d8;
    border-color: #333;
}

.dsa-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    padding: 24px 48px 80px;
    margin: 0 auto;
}

.dsa-category-card {
    position: relative;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 14px;
    padding: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.dsa-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--cat-color, #facc15);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dsa-category-card:hover {
    border-color: color-mix(in srgb, var(--cat-color, #facc15) 25%, transparent);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px color-mix(in srgb, var(--cat-color, #facc15) 6%, transparent);
}

.dsa-category-card:hover::before { opacity: 1; }

.dsa-category-card .cat-icon {
    font-size: 30px;
    margin-bottom: 12px;
}

.dsa-category-card .cat-name {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #e5e5e5;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}

.dsa-category-card .cat-count {
    font-size: 11px;
    color: #525252;
    font-weight: 600;
}

.dsa-category-card .cat-difficulties {
    display: flex;
    gap: 5px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* ========== DIFFICULTY BADGES ========== */
.diff-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: 'Google Sans', 'DM Sans', sans-serif;
}

.diff-badge.easy {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.diff-badge.medium {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.diff-badge.hard {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ========== QUESTION LIST VIEW ========== */
.dsa-question-view {
    display: flex;
    min-height: 100vh;
}

.dsa-question-sidebar {
    width: 320px;
    min-width: 320px;
    background: #0a0a0a;
    border-right: 1px solid #1a1a1a;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dsa-question-sidebar .qs-header {
    padding: 22px 20px 14px;
    border-bottom: 1px solid #1a1a1a;
}

.dsa-question-sidebar .qs-cat-name {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fafafa;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.dsa-question-sidebar .qs-cat-count {
    font-size: 11px;
    color: #525252;
    font-weight: 600;
}

.dsa-question-sidebar .qs-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    color: #525252;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
    font-family: 'Google Sans', 'DM Sans', sans-serif;
    margin-bottom: 10px;
}

.dsa-question-sidebar .qs-back:hover { color: #a3a3a3; }

.dsa-question-sidebar .qs-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.dsa-question-sidebar .qs-list::-webkit-scrollbar { width: 3px; }
.dsa-question-sidebar .qs-list::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 99px; }

/* Difficulty group sections in sidebar */
.diff-group {
    padding: 6px 10px 8px;
    margin: 4px 8px;
}

.diff-group-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-family: 'Google Sans', 'DM Sans', sans-serif;
}

.diff-group-label.easy { color: #22c55e; }
.diff-group-label.medium { color: #eab308; }
.diff-group-label.hard { color: #ef4444; }

.qs-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    margin: 2px 0;
    cursor: pointer;
    color: #737373;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 10px;
    border: 1px solid transparent;
}

.qs-item:hover {
    color: #a3a3a3;
    background: #141414;
    border-color: #1e1e1e;
}

.qs-item.active {
    color: #fafafa;
}

.qs-item.active[data-diff="easy"] {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.20);
}

.qs-item.active[data-diff="medium"] {
    background: rgba(234, 179, 8, 0.08);
    border-color: rgba(234, 179, 8, 0.20);
}

.qs-item.active[data-diff="hard"] {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.20);
}

.qs-item .qs-diff-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.qs-diff-dot.easy { background: #22c55e; }
.qs-diff-dot.medium { background: #eab308; }
.qs-diff-dot.hard { background: #ef4444; }

.qs-item .qs-number {
    font-size: 11px;
    font-weight: 700;
    color: #333;
    min-width: 22px;
}

/* ========== QUESTION DETAIL VIEW ========== */
.dsa-question-detail {
    margin-left: 320px;
    flex: 1;
    padding: 48px;
    padding-top: 80px;
}

.dsa-question-detail .q-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.dsa-question-detail .q-title {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #fafafa;
    letter-spacing: -0.02em;
}

.dsa-question-detail .q-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 36px;
}

.dsa-question-detail .q-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 8px;
    background: #0a0a0a;
    border: 1px solid #1e1e1e;
    color: #525252;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Google Sans', 'DM Sans', sans-serif;
}

.dsa-question-detail .q-nav-btn:hover {
    background: #141414;
    color: #d4d4d8;
    border-color: #333;
}

.dsa-question-detail .q-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

/* ========== APPROACH TABS ========== */
.approach-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.approach-tab {
    padding: 7px 20px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    color: #525252;
    background: #0a0a0a;
    border: 1px solid #1e1e1e;
    transition: all 0.25s ease;
    font-family: 'Google Sans', 'DM Sans', sans-serif;
}

.approach-tab:hover {
    color: #a3a3a3;
    background: #141414;
}

.approach-tab.active {
    color: var(--cat-color, #facc15);
    background: color-mix(in srgb, var(--cat-color, #facc15) 8%, transparent);
    border-color: color-mix(in srgb, var(--cat-color, #facc15) 25%, transparent);
}

/* ========== APPROACH CONTENT ========== */

/* ========== QUESTION DESCRIPTION ========== */
.q-description {
    margin-bottom: 24px;
    padding: 24px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 14px;
}

.q-description-title {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #d4d4d8;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.q-description-title::before {
    content: '📋';
    font-size: 18px;
}

.q-description-body {
    font-size: 14px;
    line-height: 1.9;
    color: #a3a3a3;
}

.q-description-body strong {
    color: #d4d4d8;
}

.q-description-body code {
    background: #1a1a1a;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 12.5px;
    color: #c084fc;
    font-family: 'Google Sans Code', 'JetBrains Mono', monospace;
}

/* ========== TEST CASES ========== */
.q-test-cases {
    margin-bottom: 24px;
    padding: 24px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 14px;
}

.q-test-cases-title {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #d4d4d8;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.q-test-cases-title::before {
    content: '🧪';
    font-size: 18px;
}

.q-test-case {
    padding: 14px 16px;
    background: #111;
    border: 1px solid #1e1e1e;
    border-radius: 10px;
    margin-bottom: 10px;
}

.q-test-case:last-child {
    margin-bottom: 0;
}

.tc-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #525252;
    margin-bottom: 8px;
    font-family: 'Google Sans', 'DM Sans', sans-serif;
}

.tc-row {
    font-size: 13px;
    color: #a3a3a3;
    line-height: 1.7;
    margin-bottom: 2px;
}

.tc-row code {
    background: #1a1a1a;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 12px;
    color: #67e8f9;
    font-family: 'Google Sans Code', 'JetBrains Mono', monospace;
}

.tc-label {
    font-weight: 600;
    color: #737373;
}

.approach-content {
    animation: approachFadeIn 0.3s ease;
}

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

.approach-complexity {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.complexity-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    font-family: 'Google Sans Code', 'JetBrains Mono', monospace;
    font-size: 12.5px;
    color: #a3a3a3;
}

.complexity-badge .cb-label {
    font-family: 'Google Sans', 'DM Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #404040;
}

.approach-description {
    font-size: 14.5px;
    line-height: 1.85;
    color: #a3a3a3;
    margin-top: 24px;
    padding: 24px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 14px;
}

.approach-description-title {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #d4d4d8;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.approach-description-title::before {
    content: '💡';
    font-size: 18px;
}

.approach-description strong {
    color: #d4d4d8;
}

/* ========== CODE EXPLANATION ========== */
.code-explanation {
    margin-top: 20px;
    padding: 24px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 14px;
}

.code-explanation .explanation-title {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #d4d4d8;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-explanation .explanation-title::before {
    content: '📖';
    font-size: 18px;
}

.code-explanation .explanation-body {
    font-size: 14px;
    line-height: 1.9;
    color: #a3a3a3;
}

.code-explanation .explanation-body strong {
    color: #d4d4d8;
}

.code-explanation .explanation-body code {
    background: #1a1a1a;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 12.5px;
    color: #c084fc;
    font-family: 'Google Sans Code', 'JetBrains Mono', monospace;
}

/* ========== DSA TOPNAV (replaces main topnav when in DSA mode) ========== */
.dsa-topnav {
    position: fixed;
    top: 0;
    left: 320px;
    right: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid #171717;
    padding: 0 28px;
    display: flex;
    align-items: center;
    height: 52px;
    gap: 12px;
}

.dsa-topnav .dsa-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #525252;
    font-weight: 500;
}

.dsa-topnav .dsa-breadcrumb .bc-sep {
    color: #333;
}

.dsa-topnav .dsa-breadcrumb .bc-link {
    color: #525252;
    cursor: pointer;
    transition: color 0.2s ease;
}

.dsa-topnav .dsa-breadcrumb .bc-link:hover {
    color: #a3a3a3;
}

.dsa-topnav .dsa-breadcrumb .bc-current {
    color: var(--cat-color, #facc15);
    font-weight: 600;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .dsa-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .section-pick-card {
        width: 100%;
        max-width: 340px;
        height: 320px;
    }

    #section-picker {
        flex-direction: column;
        gap: 20px;
    }

    .dsa-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 24px 20px 80px;
    }

    .dsa-header {
        padding: 40px 20px 16px;
    }

    .dsa-question-sidebar {
        width: 260px;
        min-width: 260px;
    }

    .dsa-question-detail {
        margin-left: 260px;
        padding: 32px 24px;
    }

    .dsa-topnav {
        left: 260px;
    }
}

@media (max-width: 640px) {
    .dsa-question-sidebar {
        width: 100%;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #1a1a1a;
    }

    .dsa-question-view {
        flex-direction: column;
    }

    .dsa-question-detail {
        margin-left: 0;
        padding: 24px 16px;
    }

    .dsa-topnav {
        left: 0;
    }
}
