/* =============================================================
   CBT System — Modern Clean Theme
   Color Palette:
     --primary:   #2563EB  (blue)
     --secondary: #0F172A  (dark navy)
     --accent:    #06B6D4  (cyan/teal)
     --bg:        #F1F5F9  (light gray)
     --text:      #1E293B
   ============================================================= */

:root {
    --primary:      #2563EB;
    --primary-dark: #1D4ED8;
    --accent:       #06B6D4;
    --sidebar-bg:   #0F172A;
    --sidebar-gradient: linear-gradient(160deg, #000000 0%, #0F172A 50%, #1E3A8A 100%);
    --sidebar-border: rgba(255,255,255,0.07);
    --sidebar-text: #CBD5E1;
    --sidebar-text-hover: #ffffff;
    --bg:           #F1F5F9;
    --text:         #1E293B;
    --text-muted:   #64748B;
    --danger:       #EF4444;
    --success:      #10B981;
    --answered:     #06B6D4;
    --current:      #2563EB;
    --card-bg:      #ffffff;
    --border:       #E2E8F0;
}

/* ── Base ────────────────────────────────────────────────── */
body {
    font-family: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    padding-top: 56px;
    color: var(--text);
    background-color: var(--bg);
}

@media (min-width: 992px) {
    body {
        padding-top: 0;
    }
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.5rem;
}

p.lead {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover, a:focus, a:active {
    color: var(--primary-dark);
    text-decoration: none;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    margin-left: 4px;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.18s ease;
    border: none;
}

.btn-primary, .btn-secondary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(37,99,235,0.25);
}

.btn-primary:hover, .btn-secondary:hover {
    background: var(--primary-dark);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,0.35);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #DC2626;
    color: #fff;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

/* ── Sidebar ─────────────────────────────────────────────── */
#sideNav {
    background: var(--sidebar-gradient) !important;
    border-right: 1px solid var(--sidebar-border);
}

#sideNav .navbar-brand {
    padding: 1.25rem 1rem 0.75rem;
    border-bottom: 1px solid var(--sidebar-border);
    width: 100%;
}

#sideNav .navbar-brand .img-profile {
    border: 3px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    object-fit: cover;
}

#sideNav .navbar-nav .nav-item {
    border-bottom: 1px solid var(--sidebar-border);
}

#sideNav .navbar-nav .nav-item .nav-link {
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.01rem;
    color: var(--sidebar-text);
    padding: 0.75rem 1.25rem;
    transition: background 0.15s ease, color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#sideNav .navbar-nav .nav-item .nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: var(--sidebar-text-hover);
}

#sideNav .navbar-nav .nav-item .nav-link i {
    width: 1rem;
    color: var(--accent);
}

#sideNav .navbar-toggler {
    border-color: rgba(255,255,255,0.2);
}

#sideNav .navbar-toggler:focus {
    outline-color: var(--accent);
    box-shadow: none;
}

/* Sidebar fixed layout */
@media (min-width: 992px) {
    #sideNav {
        text-align: left;
        position: fixed;
        top: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        width: 17rem;
        height: 100vh;
        overflow-y: auto;
    }

    #sideNav .navbar-collapse {
        display: flex;
        align-items: flex-start;
        flex-grow: 0;
        width: 100%;
        margin-bottom: auto;
    }

    #sideNav .navbar-collapse .navbar-nav {
        flex-direction: column;
        width: 100%;
    }

    #sideNav .navbar-collapse .navbar-nav .nav-item {
        display: block;
    }

    #sideNav .navbar-collapse .navbar-nav .nav-item .nav-link {
        display: flex;
    }
}

/* ── Bootstrap overrides ─────────────────────────────────── */
.bg-primary {
    background-color: var(--primary) !important;
}

.bg-secondary {
    background: var(--sidebar-gradient) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-secondary {
    color: var(--text-muted) !important;
}

/* ── Exam content layout ─────────────────────────────────── */
section.resume-section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
    max-width: 75rem;
}

@media (min-width: 768px) {
    section.resume-section {
        min-height: 100vh;
    }
}

@media (min-width: 992px) {
    section.resume-section {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
}

.resume-content {
    overflow-x: auto;
    overflow-wrap: break-word;
}

/* ── Question & Answer UI ────────────────────────────────── */
.question {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.qlinks {
    font-size: 0.9rem;
    list-style-type: none;
    line-height: 1;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 4px;
    padding: 0;
    margin: 0;
}

.qlinks li a,
.qlinks li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.15s ease;
}

.qlinks li a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.answered {
    background: var(--answered) !important;
    color: #fff !important;
    border-color: var(--answered) !important;
    border-radius: 6px;
    padding: 2px 6px;
}

.current {
    color: var(--current) !important;
    font-weight: 700;
}

/* ── Timer ───────────────────────────────────────────────── */
.time {
    display: inline-block;
    color: var(--danger) !important;
    font-weight: 700;
    font-size: 1.1rem;
    background: rgba(239,68,68,0.1);
    padding: 4px 10px;
    border-radius: 8px;
}

/* ── Word wrap utility ───────────────────────────────────── */
.word-wrap {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ── Logo / brand text ───────────────────────────────────── */
.logo-text {
    display: inline;
    color: #fff;
    font-weight: 600;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ── Form controls ───────────────────────────────────────── */
.form-control {
    border-radius: 8px;
    border-color: var(--border);
    color: var(--text);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

/* ── Radio/Checkbox option rows ──────────────────────────── */
.form-check {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
    background: var(--card-bg);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.form-check:hover {
    background: #EFF6FF;
    border-color: var(--primary);
}

.form-check input[type="radio"]:checked + label,
.form-check input[type="checkbox"]:checked + label {
    color: var(--primary);
    font-weight: 600;
}

/* ── Subheading ──────────────────────────────────────────── */
.subheading {
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--accent);
}

/* ── Dev/social icons ────────────────────────────────────── */
.social-icons a {
    display: inline-block;
    height: 3rem;
    width: 3rem;
    background-color: var(--primary);
    color: #fff !important;
    border-radius: 50%;
    text-align: center;
    font-size: 1.25rem;
    line-height: 3rem;
    margin-right: 0.75rem;
    transition: background 0.15s ease, transform 0.15s ease;
}

.social-icons a:last-child { margin-right: 0; }

.social-icons a:hover {
    background-color: var(--accent);
    transform: translateY(-2px);
}
