/* === CSS RESET (minimal) === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* === ROOT VARIABLES === */
:root {
    --bg: #f5f5f7;
    --bg-alt: #ffffff;
    --border: #e5e7eb;
    --text: #111827;
    --muted: #6b7280;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.1);
    --accent-hover: #1d4ed8;
    --danger: #dc2626;
    --success: #16a34a;
    --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.08);
    --radius-card: 10px;
    --radius-pill: 999px;
}

/* === GLOBAL STYLES === */
html {
    font-size: 16px;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* Utility container */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* === NAVBAR === */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.nav-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nav-title {
    font-weight: 600;
    font-size: 1.05rem;
}

/* Nav links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-link {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.95rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
    background-color: var(--accent-soft);
    color: var(--accent-hover);
}

.nav-link-cta {
    background-color: var(--accent);
    color: #ffffff;
}

.nav-link-cta:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    margin: 3px 0;
    background-color: var(--text);
    transition: transform 0.15s ease, opacity 0.15s ease;
}

/* === PAGE LAYOUT === */
.page {
    padding: 1.5rem 0 2.5rem;
}

@media (max-width: 640px) {
    .page {
        padding: 1rem 0 2rem;
    }
}


.page-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 0.98rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

/* === CARDS === */
.card {
    background-color: var(--bg-alt);
    border-radius: var(--radius-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 1.25rem;
}

/* Exam cards grid */
/* Exam cards grid: 1 col mobile, 2 cols tablet, 3 cols desktop */
.exam-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
    .exam-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .exam-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


.exam-card {
    background-color: var(--bg-alt);
    border-radius: var(--radius-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.exam-card-header {
    margin-bottom: 0.75rem;
}

.exam-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.exam-card-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.exam-card-description {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.exam-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    border: 1px solid var(--border);
    background-color: #f9fafb;
    color: var(--muted);
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    padding: 0.35rem 0.9rem;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-ghost {
    background-color: transparent;
    color: var(--muted);
    border-color: var(--border);
}

.btn-ghost:hover {
    background-color: var(--accent-soft);
    color: var(--accent-hover);
}

/* === FOOTER === */
.footer {
    border-top: 1px solid var(--border);
    background-color: var(--bg-alt);
    padding: 0.75rem 0;
    font-size: 0.85rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.footer-link {
    color: var(--muted);
    text-decoration: none;
}

.footer-link:hover {
    color: var(--accent-hover);
}

/* === RESPONSIVE NAV === */
@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 60px;
        right: 0;
        left: 0;
        background-color: var(--bg-alt);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: flex-start;
        padding: 0.5rem 1rem 0.75rem;
        display: none;
    }

    .nav-links.nav-links-open {
        display: flex;
    }

    .nav-toggle {
        display: inline-block;
    }
}

/* === PROJECT MANAGEMENT BOOTCAMP PROMO (BOTTOM AD) === */

.promo-bootcamp {
    padding: 1.5rem 0 2rem;
}

.promo-bootcamp-card {
    margin-top: 1.5rem;
}

.promo-bootcamp-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.promo-bootcamp-heading {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.promo-bootcamp-text {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Responsive 16:9 video embed */
.promo-bootcamp-video {
    margin-top: 0.5rem;
}

.promo-video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 ratio */
    border-radius: 10px;
    overflow: hidden;
    background-color: #000;
}

.promo-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.promo-bootcamp-cta {
    margin-top: 0.75rem;
}



/* === EXAM RUNNER PAGE === */

.exam-runner-card {
    margin-bottom: 2rem;
}

.exam-runner-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.exam-runner-exam-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.exam-runner-meta {
    font-size: 0.85rem;
    color: var(--muted);
}

.exam-runner-timer {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--muted);
    position: sticky;
    top: 0.75rem;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-pill);
    background-color: #f9fafb;
    border: 1px solid var(--border);
}

/* Exam runner: small-screen layout improvements */
@media (max-width: 640px) {
    .exam-runner-card {
        margin-top: 1.25rem;
        padding: 1rem;
    }

    .exam-runner-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .exam-runner-exam-title {
        font-size: 1.05rem;
    }

    .exam-question-stem {
        font-size: 0.98rem;
    }
}


.exam-question-stem {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.exam-question-tags {
    margin-bottom: 0.75rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.exam-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.exam-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.exam-option:hover {
    background-color: var(--accent-soft);
}

.exam-option input[type="radio"] {
    margin-top: 0.2rem;
}

.exam-option-text {
    font-size: 0.95rem;
}

/* Feedback block (practice mode) */
.exam-feedback {
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.exam-feedback-correct {
    background-color: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.25);
}

.exam-feedback-incorrect {
    background-color: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.25);
}

.exam-feedback-neutral {
    background-color: #f9fafb;
    border: 1px solid var(--border);
}

.exam-feedback-explanation {
    margin-top: 0.35rem;
}

/* Navigation row */
.exam-runner-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.25rem;
    gap: 0.75rem;
}

.exam-runner-nav-left,
.exam-runner-nav-center,
.exam-runner-nav-right {
    display: flex;
    align-items: center;
}

/* Stack nav buttons and make them touch-friendly on small screens */
@media (max-width: 640px) {
    .exam-runner-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .exam-runner-nav-left,
    .exam-runner-nav-center,
    .exam-runner-nav-right {
        width: 100%;
        justify-content: center;
    }

    .exam-runner-actions .btn {
        width: 100%;
        justify-content: center;
        padding: 0.6rem 1rem;
    }
}



/* === RESULT PAGE === */

.result-summary-card {
    margin-bottom: 1.5rem;
}

.result-summary-top {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.result-score-block {
    min-width: 200px;
}

.result-score-label {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.result-score-value {
    font-size: 2rem;
    font-weight: 700;
}

.result-score-pass {
    margin-top: 0.2rem;
    font-size: 0.95rem;
}

.result-score-pass-detail {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
}

.result-pass {
    color: var(--success);
}

.result-fail {
    color: var(--danger);
}

.result-meta-block {
    font-size: 0.9rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.result-domain-section {
    margin-top: 1.25rem;
}

.result-section-heading {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.result-domain-card {
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 0.6rem 0.75rem;
    background-color: #f9fafb;
}

.result-domain-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.result-domain-score {
    font-size: 1.1rem;
    font-weight: 600;
}

.result-domain-detail {
    font-size: 0.85rem;
    color: var(--muted);
}

.result-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Detailed review */

.result-detail-card {
    margin-bottom: 2rem;
}

.result-question-list {
    list-style: none;
    padding-left: 0;
}

.result-question-item {
    padding: 0.85rem 0;
    border-top: 1px solid var(--border);
}

.result-question-item:first-child {
    border-top: none;
}

.result-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.result-question-number {
    font-weight: 600;
}

.result-question-status {
    font-size: 0.85rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}

.rq-correct {
    background-color: rgba(22, 163, 74, 0.08);
    color: #166534;
}

.rq-incorrect {
    background-color: rgba(220, 38, 38, 0.06);
    color: #b91c1c;
}

.result-question-stem {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.result-question-meta {
    margin-bottom: 0.35rem;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.result-question-answers {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.result-question-answers > div {
    margin-bottom: 0.2rem;
}

.result-question-explanation {
    font-size: 0.9rem;
    color: var(--muted);
}

/* Responsive layout */
@media (max-width: 640px) {
    .result-summary-top {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* === AUTH / PROFILE FORMS === */

.auth-card {
    margin-bottom: 2rem;
}

.auth-form .form-group {
    margin-bottom: 0.75rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft);
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

.form-group-inline {
    margin-top: 0.5rem;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.auth-errors {
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(220, 38, 38, 0.25);
    background-color: rgba(220, 38, 38, 0.06);
    font-size: 0.9rem;
}

.auth-errors ul {
    padding-left: 1.1rem;
}

.auth-success {
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(22, 163, 74, 0.25);
    background-color: rgba(22, 163, 74, 0.08);
    font-size: 0.9rem;
}

.auth-actions {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-small-link {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* Profile */

.profile-subscription-form {
    margin-top: 0.35rem;
}


.profile-card {
    margin-bottom: 1.5rem;
}

.profile-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr);
    gap: 1.5rem;
}

.profile-heading {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.profile-attempts-card {
    margin-bottom: 2rem;
}

.profile-attempts-table-wrapper {
    overflow-x: auto;
}

.profile-attempts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.profile-attempts-table th,
.profile-attempts-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.profile-attempts-table th {
    font-weight: 600;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* badge variants */
.badge-success {
    border-color: rgba(22, 163, 74, 0.4);
    color: #166534;
    background-color: rgba(22, 163, 74, 0.1);
}

.badge-danger {
    border-color: rgba(220, 38, 38, 0.4);
    color: #b91c1c;
    background-color: rgba(220, 38, 38, 0.08);
}

@media (max-width: 768px) {
    .profile-columns {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* === ADMIN === */

.admin-actions {
    margin: 0.75rem 0 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-danger {
    border: 1px solid rgba(220, 38, 38, 0.6);
    background-color: rgba(220, 38, 38, 0.06);
    color: #b91c1c;
}

.btn-danger:hover {
    background-color: rgba(220, 38, 38, 0.12);
}

/* Result page: small-screen readability */
@media (max-width: 640px) {
    .result-summary-card,
    .result-detail-card {
        padding: 1rem;
    }

    .result-summary-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .result-domain-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .result-question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .result-question-answers {
        font-size: 0.88rem;
    }
}

@media (max-width: 640px) {
    .btn {
        font-size: 0.95rem;
    }
}
