/* ==========================================================================
   THINK2FINISH SAMURAI TEST PORTAL — PREMIUM BOOTSTRAP STYLING
   ========================================================================== */

/* Portal Wrapper */
.samurai-portal-wrapper {
    min-height: 80vh;
    padding-bottom: 3rem;
}

/* Exam Mode (distraction-free mode) */
body.in-exam-mode .site-header,
body.in-exam-mode footer {
    display: none !important;
}

body.in-exam-mode {
    padding-top: 0 !important;
    background-color: #f8fafc;
}

/* Hero Section */
.samurai-hero {
    background: linear-gradient(135deg, rgba(255, 109, 0, 0.08) 0%, rgba(255, 143, 61, 0.03) 100%);
    padding: 3.5rem 1rem 2.5rem;
    border-bottom: 1px solid var(--border, rgba(255, 109, 0, 0.12));
    margin-bottom: 2rem;
}

.samurai-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff4eb;
    color: #ff6d00;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 109, 0, 0.2);
    margin-bottom: 1rem;
}

.samurai-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.75rem);
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.25;
    margin-bottom: 1rem;
}

.samurai-hero .hero-desc {
    font-size: 1.1rem;
    color: #4a4a5a;
    max-width: 720px;
    margin: 0 auto;
}

/* Level Grid & Level Cards */
.samurai-level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.75rem;
    margin-top: 1.5rem;
}

.level-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1.25rem;
    padding: 1.75rem;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.level-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(255, 109, 0, 0.12);
    border-color: rgba(255, 109, 0, 0.3);
}

.level-card.locked {
    background: #f8fafc;
    opacity: 0.85;
}

.level-badge {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.active-badge {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.locked-badge {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.level-icon {
    width: 52px;
    height: 52px;
    border-radius: 1rem;
    background: #fff4eb;
    color: #ff6d00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.level-card h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
}

.level-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ff6d00;
    margin-bottom: 0.75rem;
}

.level-card p {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.55;
    flex-grow: 1;
    margin-bottom: 1.25rem;
}

.level-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border-radius: 0.85rem;
    margin-bottom: 1.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
}

.level-stats span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.level-stats i {
    color: #ff6d00;
}

/* Exam Mode Sticky Header Bar */
.exam-header-bar {
    position: sticky;
    top: 0;
    z-index: 1050;
    background: #ffffff;
    border-bottom: 2px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    padding: 0.75rem 0;
}

.exam-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.candidate-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    padding: 0.4rem 0.85rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

.candidate-badge i {
    font-size: 1.25rem;
    color: #ff6d00;
}

.candidate-badge strong {
    display: block;
    font-size: 0.9rem;
    color: #0f172a;
    line-height: 1.2;
}

.candidate-badge span {
    font-size: 0.75rem;
    color: #64748b;
}

.division-title-badge {
    background: #fff4eb;
    color: #ea580c;
    border: 1px solid #ffedd5;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timer-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #0f172a;
    color: #ffffff;
    padding: 0.45rem 1rem;
    border-radius: 0.75rem;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.timer-card i {
    color: #ff6d00;
}

.timer-card.timer-warning {
    background: #dc2626;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.85; transform: scale(1.03); }
}

/* Division Stepper Bar */
.division-stepper-bar {
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.6rem 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.division-steps-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.div-step-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.div-step-btn .step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
}

.div-step-btn:hover {
    background: #fff4eb;
    border-color: #ff6d00;
    color: #ff6d00;
}

.div-step-btn.active {
    background: #ff6d00;
    border-color: #ff6d00;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 109, 0, 0.3);
}

.div-step-btn.active .step-num {
    background: #ffffff;
    color: #ff6d00;
}

.div-step-btn.completed {
    border-color: #10b981;
    color: #047857;
}

.div-step-btn.completed .step-num {
    background: #10b981;
    color: #ffffff;
}

/* Exam Questions Container */
.exam-container {
    max-width: 960px;
    margin: 1.5rem auto;
}

.division-content-box {
    background: #ffffff;
    border-radius: 1.25rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.division-box-header {
    background: linear-gradient(135deg, #fff4eb 0%, #ffffff 100%);
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid #ffedd5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.division-box-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.text-accent {
    color: #ff6d00 !important;
}

.div-question-count-badge {
    background: #ff6d00;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
}

.division-questions-list {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.division-q-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: border-color 0.2s ease;
}

.division-q-card:hover {
    border-color: #cbd5e1;
}

.div-q-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.div-q-num {
    font-size: 0.8rem;
    font-weight: 800;
    color: #ff6d00;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fff4eb;
    padding: 0.2rem 0.65rem;
    border-radius: 0.4rem;
}

.div-q-sec-tag {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
}

.div-q-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.45;
    margin-bottom: 1rem;
}

.q-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-x: auto;
    margin-bottom: 1.25rem;
    border-left: 4px solid #ff6d00;
}

/* Option Cards */
.options-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.option-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 1.15rem;
    border-radius: 0.85rem;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.option-card input[type="radio"] {
    display: none;
}

.option-card .opt-key {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    font-weight: 800;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.option-card .opt-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
    line-height: 1.4;
    padding-top: 0.1rem;
}

.option-card:hover {
    border-color: #ff8f3d;
    background: #fffbf7;
}

.option-card.selected {
    border-color: #ff6d00;
    background: #fff4eb;
    box-shadow: 0 0 0 1px #ff6d00;
}

.option-card.selected .opt-key {
    background: #ff6d00;
    color: #ffffff;
}

.option-card.selected .opt-text {
    color: #0f172a;
    font-weight: 700;
}

/* Division Footer Navigation Bar */
.division-footer-nav {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Results & Scorecard Dashboard */
.scorecard-card {
    background: #ffffff;
    border-radius: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.scorecard-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 2.5rem 1.5rem;
    position: relative;
}

.scorecard-header .badge-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6d00 0%, #ff8f3d 100%);
    color: #ffffff;
    font-size: 1.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 6px 20px rgba(255, 109, 0, 0.4);
}

.scorecard-header h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.scorecard-header .subtitle {
    color: #94a3b8;
    font-size: 1rem;
}

.scorecard-body {
    padding: 2rem;
}

.candidate-meta-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1.25rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.candidate-meta-row .meta-lbl {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.candidate-meta-row strong {
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 700;
    word-break: break-word;
}

.score-display-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fff4eb 0%, #ffffff 100%);
    border-radius: 1.25rem;
    border: 1px solid #ffedd5;
}

.score-circle-wrapper {
    text-align: center;
}

.score-value {
    font-size: 3.5rem;
    font-weight: 900;
    color: #ff6d00;
    line-height: 1;
}

.score-value small {
    font-size: 1.5rem;
    color: #94a3b8;
    font-weight: 600;
}

.score-pct {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 0.25rem;
}

.score-verdict-box {
    max-width: 450px;
    text-align: left;
}

.verdict-tag {
    display: inline-block;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.verdict-pass {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.verdict-fail {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.score-verdict-box h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.4rem;
}

.score-verdict-box p {
    font-size: 0.92rem;
    color: #475569;
    line-height: 1.5;
    margin: 0;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.metric-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.metric-box .m-val {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    color: #0f172a;
}

.metric-box .m-lbl {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Section Breakdown */
.section-breakdown-box {
    background: #f8fafc;
    border-radius: 1.25rem;
    padding: 1.75rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.section-breakdown-box h4 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-bars-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sec-bar-row {
    background: #ffffff;
    padding: 0.85rem 1.15rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

.sec-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.4rem;
}

.sec-bar-track {
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.sec-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s ease;
}

.sec-bar-fill.high { background: #10b981; }
.sec-bar-fill.med { background: #ff6d00; }
.sec-bar-fill.low { background: #ef4444; }

.scorecard-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Detailed Review Section */
.review-section-card {
    background: #ffffff;
    border-radius: 1.5rem;
    border: 1px solid #e2e8f0;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.review-header {
    margin-bottom: 2rem;
}

.review-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.review-header p {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.review-filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.4rem 1rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #f1f5f9;
}

.filter-btn.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.review-questions-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-card {
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    background: #ffffff;
}

.review-card.status-correct { border-left: 5px solid #10b981; }
.review-card.status-incorrect { border-left: 5px solid #ef4444; }
.review-card.status-unanswered { border-left: 5px solid #f59e0b; }

.rv-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.rv-num {
    font-weight: 800;
    color: #0f172a;
    font-size: 0.95rem;
    margin-right: 0.5rem;
}

.rv-sec {
    font-size: 0.78rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.2rem 0.6rem;
    border-radius: 0.4rem;
    font-weight: 600;
}

.rv-badge {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.rv-pass { background: #dcfce7; color: #15803d; }
.rv-fail { background: #fee2e2; color: #b91c1c; }
.rv-un { background: #fef3c7; color: #b45309; }

.rv-qtext {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
    line-height: 1.45;
}

.rv-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.review-opt {
    padding: 0.65rem 1rem;
    border-radius: 0.6rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.9rem;
    color: #334155;
}

.review-opt.correct-opt {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
    font-weight: 700;
}

.review-opt.wrong-opt {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
    font-weight: 700;
}

.rv-explanation {
    background: #fff4eb;
    border: 1px solid #ffedd5;
    border-radius: 0.75rem;
    padding: 0.85rem 1.15rem;
    font-size: 0.88rem;
    color: #7c2d12;
    line-height: 1.5;
}

/* Modal Enhancements */
.modal-header-samurai {
    background: linear-gradient(135deg, #fff4eb 0%, #ffffff 100%);
    border-bottom: 1px solid #ffedd5;
}

@media print {
    body { background: #ffffff !important; color: #000000 !important; }
    .site-header, footer, .scorecard-actions, .review-filter-bar, .review-section-card { display: none !important; }
    .scorecard-card { border: none !important; box-shadow: none !important; }
}
