/* =================================================================
   InterviewPrep — Attractive Modern Styles
   ================================================================= */

/* ── Variables ──────────────────────────────────────────── */
:root {
    --sidebar-w: 290px;
    --nav-h: 60px;
    --angular: #dd0031;
    --angular-light: #ff5252;
    --node: #339933;
    --node-light: #66bb6a;
    --glass: rgba(255,255,255,.08);
    --surface: #ffffff;
    --surface-2: #f6f8fb;
    --text: #1e293b;
    --text-muted: #64748b;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.06), 0 6px 16px rgba(0,0,0,.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
    --transition: .25s cubic-bezier(.4,0,.2,1);
    --gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    --gradient-alt: linear-gradient(135deg, #3b82f6, #6366f1);
}

/* ── Reset / Global ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--surface-2);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.fw-500 { font-weight: 500; }

::selection {
    background: #8b5cf6;
    color: #fff;
}

/* ── Navbar ──────────────────────────────────────────────── */
#mainNavbar {
    height: var(--nav-h);
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 1px solid rgba(255,255,255,.06);
    backdrop-filter: blur(12px);
    z-index: 1040;
    padding: 0;
}

.navbar-brand {
    color: #fff !important;
    font-size: 1.25rem;
    letter-spacing: -.5px;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--gradient);
    font-size: 1.1rem;
    color: #fff;
}

.brand-accent { color: #a78bfa; }

#mainNavbar .nav-link {
    color: rgba(255,255,255,.8) !important;
    transition: color var(--transition);
}
#mainNavbar .nav-link:hover { color: #fff !important; }

#mainNavbar .dropdown-menu {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius-sm);
    padding: 6px;
}
#mainNavbar .dropdown-item {
    color: rgba(255,255,255,.85);
    border-radius: 6px;
    padding: 8px 14px;
}
#mainNavbar .dropdown-item:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

/* search */
.search-wrap {
    position: relative;
    width: 100%;
    max-width: 320px;
}
.search-icon {
    position: absolute;
    left: 14px; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,.4);
    font-size: .85rem;
    pointer-events: none;
    z-index: 2;
}
.search-input {
    background: rgba(255,255,255,.07) !important;
    border: 1px solid rgba(255,255,255,.1) !important;
    color: #fff !important;
    border-radius: 50px !important;
    padding: 8px 16px 8px 38px !important;
    font-size: .88rem;
    transition: var(--transition);
}
.search-input::placeholder { color: rgba(255,255,255,.35); }
.search-input:focus {
    background: rgba(255,255,255,.12) !important;
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 3px rgba(139,92,246,.25) !important;
}

@media (max-width: 991.98px) {
    #mainNavbar { height: auto; padding: 10px 0; }
    .search-wrap { max-width: 100%; margin-top: 10px; }
    #navbarContent { padding: 10px 0; }
}

/* ── App Layout ──────────────────────────────────────────── */
.app-wrapper {
    display: flex;
    min-height: calc(100vh - var(--nav-h));
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid #e5e7eb;
    position: sticky;
    top: var(--nav-h);
    height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d4d4d8 transparent;
    transition: transform var(--transition);
    z-index: 1030;
}

.sidebar-head {
    padding: 20px 20px 12px;
    border-bottom: 1px solid #f1f1f4;
}
.sidebar-head h6 {
    margin: 0;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
}

.sidebar-links {
    list-style: none;
    padding: 10px 10px 20px;
    margin: 0;
}

.sidebar-links .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .88rem;
    font-weight: 450;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.sidebar-links .nav-link:hover {
    background: var(--surface-2);
    color: #6366f1;
}

.sidebar-links .nav-link.active {
    background: var(--gradient);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(99,102,241,.3);
}

.sidebar-links .nav-link .topic-count {
    margin-left: auto;
    font-size: .7rem;
    font-weight: 600;
    opacity: .7;
}

.sidebar-links .nav-link.active .topic-count {
    background: rgba(255,255,255,.2) !important;
    color: #fff;
}

/* mobile sidebar */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        box-shadow: none;
        z-index: 1060;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 1055;
        backdrop-filter: blur(2px);
    }
    .sidebar-backdrop.show { display: block; }
}

@media (min-width: 992px) {
    .sidebar-backdrop { display: none !important; }
}

/* ── Content Area ────────────────────────────────────────── */
.content-area {
    flex: 1;
    min-width: 0;
    padding: 30px 40px;
}

@media (max-width: 767.98px) {
    .content-area { padding: 16px; }
}

/* mobile bar */
.mobile-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid #e5e7eb;
}

.btn-glass {
    background: var(--surface-2);
    border: 1px solid #e5e7eb;
    font-weight: 500;
    font-size: .82rem;
}

.mobile-badge {
    font-size: .72rem;
    font-weight: 600;
}

/* ── Hero Section ────────────────────────────────────────── */
.hero {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    padding: 70px 30px 60px;
    margin-bottom: 40px;
}

.hero-glow {
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(139,92,246,.35) 0%, transparent 70%);
    top: -150px; right: -100px;
    pointer-events: none;
}
.hero::before {
    content: '';
    position: absolute;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(99,102,241,.25) 0%, transparent 70%);
    bottom: -100px; left: -50px;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50px;
    color: #c4b5fd;
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -.5px;
}

.gradient-text {
    background: linear-gradient(135deg, #a78bfa, #f472b6, #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.1rem;
    color: rgba(255,255,255,.6);
    max-width: 520px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-cta {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    color: #fff;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.cta-angular {
    background: linear-gradient(135deg, #dd0031, #c3002f);
    box-shadow: 0 4px 20px rgba(221,0,49,.35);
}
.cta-angular:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(221,0,49,.45);
    color: #fff;
}
.cta-node {
    background: linear-gradient(135deg, #339933, #2d8a2d);
    box-shadow: 0 4px 20px rgba(51,153,51,.35);
}
.cta-node:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(51,153,51,.45);
    color: #fff;
}

/* ── Feature Cards ───────────────────────────────────────── */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.fcard {
    background: var(--surface);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 28px 22px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.fcard:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #c7d2fe;
}

.fcard-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 16px;
}
.fi-angular { background: #fef2f2; color: var(--angular); }
.fi-node    { background: #f0fdf4; color: var(--node); }
.fi-topics  { background: #eef2ff; color: #6366f1; }
.fi-code    { background: #faf5ff; color: #a855f7; }

.fcard h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.fcard p {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.55;
}
.fcard-tag {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #8b5cf6;
}

/* ── SEO Block ───────────────────────────────────────────── */
.seo-block {
    background: var(--surface);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
}
.seo-block h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}
.seo-block p {
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

/* ── Questions Section ───────────────────────────────────── */
.qs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.qs-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.qs-badge {
    padding: 6px 16px;
    border-radius: 50px;
    font-size: .78rem;
    font-weight: 600;
    background: var(--gradient);
    color: #fff;
}

/* ── Accordion ───────────────────────────────────────────── */
.accordion { --bs-accordion-border-radius: var(--radius-sm); }

.accordion-item {
    border: 1px solid #e5e7eb;
    margin-bottom: 8px;
    border-radius: var(--radius-sm) !important;
    overflow: hidden;
    background: var(--surface);
    transition: var(--transition);
}
.accordion-item:hover {
    border-color: #c7d2fe;
}

.accordion-button {
    font-weight: 600;
    font-size: .92rem;
    border-radius: var(--radius-sm) !important;
    padding: 16px 20px;
    gap: 0;
    background: var(--surface);
    color: var(--text);
}
.accordion-button:not(.collapsed) {
    background: #eef2ff;
    color: #4338ca;
    box-shadow: none;
}
.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.accordion-button::after {
    width: 1rem; height: 1rem;
    background-size: 1rem;
}

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px; height: 28px;
    border-radius: 8px;
    background: var(--gradient);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    margin-right: 12px;
    flex-shrink: 0;
}

.accordion-body {
    font-size: .9rem;
    line-height: 1.75;
    color: #475569;
    padding: 14px 20px 20px;
}

.accordion-body code {
    font-family: 'Fira Code', monospace;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: .82rem;
    color: #7c3aed;
}

.accordion-body pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: .82rem;
    margin: 14px 0;
    border: 1px solid #1e293b;
}
.accordion-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

.accordion-body ul,
.accordion-body ol { padding-left: 1.2rem; }
.accordion-body li { margin-bottom: 5px; }

.accordion-body table {
    width: 100%;
    font-size: .85rem;
}

.accordion-body strong { color: var(--text); }

/* ── Search Results ──────────────────────────────────────── */
.search-result-item {
    border-left: 4px solid #6366f1;
    padding: 16px 20px;
    margin-bottom: 10px;
    background: var(--surface);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: pointer;
    transition: var(--transition);
    border-top: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}
.search-result-item:hover {
    box-shadow: var(--shadow);
    transform: translateX(3px);
}
.search-result-item .badge { font-size: .68rem; }

/* ── Footer ──────────────────────────────────────────────── */
.app-footer {
    text-align: center;
    padding: 30px 0 20px;
    margin-top: 50px;
    border-top: 1px solid #e5e7eb;
    color: var(--text-muted);
    font-size: .82rem;
}
.app-footer p { margin: 0; }

/* ── Back to Top ─────────────────────────────────────────── */
.btn-totop {
    position: fixed;
    bottom: 28px; right: 28px;
    width: 44px; height: 44px;
    border-radius: 12px;
    border: none;
    background: var(--gradient);
    color: #fff;
    font-size: 1.1rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
    cursor: pointer;
    transition: var(--transition);
    z-index: 1050;
}
.btn-totop:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(99,102,241,.45);
}
.btn-totop.show { display: flex; }

/* ── Theme: Angular ──────────────────────────────────────── */
body.theme-angular .sidebar-links .nav-link.active {
    background: linear-gradient(135deg, var(--angular), var(--angular-light));
    box-shadow: 0 2px 10px rgba(221,0,49,.3);
}
body.theme-angular .question-number {
    background: linear-gradient(135deg, var(--angular), var(--angular-light));
}
body.theme-angular .qs-badge {
    background: linear-gradient(135deg, var(--angular), var(--angular-light));
}
body.theme-angular .accordion-button:not(.collapsed) {
    background: #fef2f2;
    color: #be123c;
}
body.theme-angular .search-result-item { border-left-color: var(--angular); }
body.theme-angular .mobile-badge {
    background: var(--angular);
    color: #fff;
}

/* ── Theme: Node ─────────────────────────────────────────── */
body.theme-node .sidebar-links .nav-link.active {
    background: linear-gradient(135deg, var(--node), var(--node-light));
    box-shadow: 0 2px 10px rgba(51,153,51,.3);
}
body.theme-node .question-number {
    background: linear-gradient(135deg, var(--node), var(--node-light));
}
body.theme-node .qs-badge {
    background: linear-gradient(135deg, var(--node), var(--node-light));
}
body.theme-node .accordion-button:not(.collapsed) {
    background: #f0fdf4;
    color: #166534;
}
body.theme-node .search-result-item { border-left-color: var(--node); }
body.theme-node .mobile-badge {
    background: var(--node);
    color: #fff;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .hero { padding: 50px 18px 40px; border-radius: var(--radius); }
    .hero-title { font-size: 1.7rem; }
    .hero-sub { font-size: .95rem; }
    .btn-cta { padding: 12px 24px; font-size: .92rem; }
    .features { grid-template-columns: 1fr 1fr; gap: 12px; }
    .fcard { padding: 18px 16px; }
    .fcard h3 { font-size: .92rem; }
    .fcard p { font-size: .78rem; }
    .accordion-button { font-size: .85rem; padding: 12px 14px; }
    .question-number { min-width: 24px; height: 24px; font-size: .68rem; margin-right: 8px; }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-title { font-size: 2.2rem; }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
    #mainNavbar, .sidebar, .mobile-bar, .btn-totop { display: none !important; }
    .content-area { padding: 0 !important; }
}

/* ── Scrollbar ────────────────────────────────────────────── */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 4px; }
