/* training.css — Training Mode styles */

:root {
    --training: #E65100;
    --training-light: #FFF3E0;
    --training-border: #FB8C00;
    --success: #2E7D32;
    --success-light: #E8F5E9;
    --failure: #C62828;
    --failure-light: #FFEBEE;
    --locked: #9E9E9E;
    --locked-bg: #F5F5F5;
}

/* ─── Training-specific header ─── */
.training-header {
    background: var(--training);
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ─── Banner injected into dashboard ─── */
#training-banner {
    background: var(--training);
    color: white;
    text-align: center;
    padding: 8px 15px;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    padding-left: 70px;
    padding-right: 70px;
}

#training-banner i {
    font-size: 14px;
}

/* ─── Login view ─── */
.training-login-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.training-login-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.btn-training {
    width: 100%;
    padding: 18px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    color: white;
    background: var(--training);
    cursor: pointer;
    text-transform: uppercase;
}

.btn-training:active {
    opacity: 0.9;
    transform: scale(0.98);
}

.btn-training:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.training-back-link {
    text-align: center;
    color: var(--training);
    font-size: 14px;
    text-decoration: none;
    padding: 5px;
    display: block;
}

/* ─── Mission Hub ─── */
#hub-view {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#hub-view.visible {
    display: flex;
}

/* Progress bar */
.training-progress-bar-wrap {
    padding: 12px 20px 0;
    flex-shrink: 0;
}

.training-progress-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.training-progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.training-progress-fill {
    height: 100%;
    background: var(--training);
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* Hub tabs */
.hub-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
    margin-top: 10px;
}

.hub-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    background: #f5f5f5;
    font-size: 14px;
    font-weight: bold;
    color: #666;
    border: none;
}

.hub-tab.active {
    background: white;
    border-bottom: 3px solid var(--training);
    color: var(--training);
}

/* Hub content panels */
.hub-panel {
    display: none;
    flex-direction: column;
    overflow-y: auto;
    flex: 1;
    padding: 15px;
    gap: 12px;
}

.hub-panel.active {
    display: flex;
}

/* ─── Mission Cards ─── */
.mission-card {
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 2px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: default;
}

.mission-card.available {
    border-color: var(--training-border);
    background: var(--training-light);
    cursor: pointer;
}

.mission-card.available:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(230, 81, 0, 0.2);
}

.mission-card.completed {
    border-color: #A5D6A7;
    background: var(--success-light);
}

.mission-card.locked {
    background: var(--locked-bg);
    border-color: #E0E0E0;
    opacity: 0.7;
}

.mission-icon {
    font-size: 26px;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    color: var(--training);
}

.mission-card.completed .mission-icon {
    color: var(--success);
}

.mission-card.locked .mission-icon {
    color: #999;
}

.mission-status-icon {
    font-size: 20px;
    color: #ccc;
    flex-shrink: 0;
}

.mission-card.available .mission-status-icon {
    color: var(--training);
}

.mission-card.completed .mission-status-icon {
    color: var(--success);
}

.mission-info {
    flex: 1;
}

.mission-number {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 2px;
    color: #888;
}

.mission-card.available .mission-number { color: var(--training); }
.mission-card.completed .mission-number { color: var(--success); }

.mission-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
}

.mission-status-text {
    font-size: 13px;
    color: #888;
}

.mission-card.available .mission-status-text { color: var(--training); font-weight: bold; }
.mission-card.completed .mission-status-text { color: var(--success); }

.mission-chevron {
    color: #ccc;
    font-size: 14px;
    flex-shrink: 0;
}

.mission-card.available .mission-chevron { color: var(--training); }

/* ─── Mission Briefing Sheet (bottom-sheet style) ─── */
#briefing-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 900;
    justify-content: flex-end;
    flex-direction: column;
    align-items: center;
}

#briefing-overlay.visible {
    display: flex;
}

#briefing-sheet {
    background: white;
    width: 100%;
    max-width: 480px;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.briefing-handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 0 auto 6px;
}

.briefing-label {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--training);
}

.briefing-title {
    font-size: 20px;
    font-weight: bold;
    color: #222;
    margin: 0;
}

.briefing-scenario {
    background: var(--training-light);
    border-left: 4px solid var(--training-border);
    border-radius: 6px;
    padding: 14px;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.briefing-hint {
    font-size: 13px;
    color: #888;
    line-height: 1.5;
}

/* ─── Feedback Overlay (injected into dashboard by interceptor) ─── */
#training-feedback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 800;
    box-sizing: border-box;
}

#training-feedback.success-bg {
    background: rgba(46, 125, 50, 0.95);
}

#training-feedback.failure-bg {
    background: rgba(198, 40, 40, 0.95);
}

.training-feedback-card {
    background: white;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    width: 100%;
    max-width: 340px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.feedback-icon {
    font-size: 56px;
    line-height: 1;
}

.feedback-title {
    font-size: 24px;
    font-weight: bold;
    color: #222;
    margin: 0;
}

.feedback-body {
    font-size: 15px;
    color: #555;
    line-height: 1.5;
    margin: 0;
}

/* ─── Quiz Panel ─── */
.quiz-section-title {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #888;
    padding: 4px 0 8px;
    border-bottom: 1px solid #eee;
}

.quiz-question-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-question-text {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    line-height: 1.4;
}

.quiz-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quiz-option {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
    display: flex;
    flex-direction: column;
}

.quiz-option:active {
    transform: scale(0.97);
}

.quiz-option.selected-correct {
    border-color: var(--success);
    background: var(--success-light);
}

.quiz-option.selected-wrong {
    border-color: var(--failure);
    background: var(--failure-light);
}

.quiz-option.reveal-correct {
    border-color: var(--success);
}

/* Mini mockup phone screen */
.quiz-mockup {
    background: #f9f9f9;
    padding: 8px;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 9px;
}

.mock-header {
    background: #2E7D32;
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 9px;
}

.mock-btn {
    border-radius: 4px;
    padding: 5px 6px;
    font-weight: bold;
    font-size: 9px;
    text-align: center;
    color: white;
}

.mock-btn-green  { background: #2E7D32; }
.mock-btn-amber  { background: #E65100; }
.mock-btn-red    { background: #C62828; }
.mock-btn-grey   { background: #757575; }

.mock-input {
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 4px 5px;
    background: white;
    color: #999;
    font-size: 8px;
}

.mock-label {
    font-size: 8px;
    color: #888;
}

.mock-highlight {
    outline: 2px solid var(--training-border);
    outline-offset: 1px;
}

.quiz-option-label {
    padding: 5px 8px 7px;
    font-size: 11px;
    font-weight: bold;
    color: #444;
    text-align: center;
    border-top: 1px solid #eee;
    background: white;
}

/* Quiz result summary */
.quiz-result {
    background: var(--training-light);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    font-weight: bold;
    color: var(--training);
    font-size: 16px;
    display: none;
}

.quiz-result.visible {
    display: block;
}

/* ─── Quiz Locked State ─── */
.quiz-locked-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    color: var(--locked);
}

.quiz-locked-icon {
    font-size: 40px;
    margin-bottom: 16px;
    color: #bdbdbd;
}

.quiz-locked-title {
    font-size: 17px;
    font-weight: 700;
    color: #757575;
    margin-bottom: 8px;
}

.quiz-locked-body {
    font-size: 14px;
    color: #9e9e9e;
    max-width: 260px;
}

/* ─── Quiz tab locked appearance ─── */
.hub-tab.locked {
    color: #bdbdbd;
    cursor: default;
}

.hub-tab.locked.active {
    border-bottom-color: #bdbdbd;
    color: #9e9e9e;
}

/* ─── All Missions Done Prompt ─── */
.all-done-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.all-done-sheet {
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 32px 24px 36px;
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.all-done-icon {
    font-size: 44px;
    color: var(--training);
    margin-bottom: 14px;
}

.all-done-title {
    font-size: 20px;
    font-weight: 700;
    color: #1B5E20;
    margin: 0 0 8px;
}

.all-done-body {
    font-size: 14px;
    color: #555;
    margin-bottom: 24px;
}

.all-done-cta {
    width: 100%;
    margin-bottom: 4px;
}

.all-done-later {
    background: none;
    border: none;
    color: #9e9e9e;
    font-size: 14px;
    cursor: pointer;
    padding: 10px;
}

/* ─── Certification Screen ─── */
.cert-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 48px 28px;
    text-align: center;
    background: linear-gradient(160deg, #E8F5E9 0%, #fff 60%);
}

.cert-badge-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    margin-bottom: 24px;
}

.cert-badge-icon {
    font-size: 96px;
    color: #FBC02D;
    line-height: 1;
}

.cert-badge-check {
    position: absolute;
    bottom: 2px;
    right: -4px;
    font-size: 28px;
    color: #2E7D32;
    background: #fff;
    border-radius: 50%;
    padding: 2px;
}

.cert-title {
    font-size: 24px;
    font-weight: 700;
    color: #1B5E20;
    margin: 0 0 6px;
}

.cert-name {
    font-size: 16px;
    color: #555;
    margin: 0 0 28px;
}

.cert-number-box {
    background: #fff;
    border: 2px solid #A5D6A7;
    border-radius: 14px;
    padding: 16px 28px;
    margin-bottom: 28px;
    width: 100%;
    max-width: 300px;
}

.cert-number-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 6px;
}

.cert-number {
    font-family: monospace;
    font-size: 22px;
    font-weight: 700;
    color: #1B5E20;
    letter-spacing: 2px;
}

.cert-msg {
    font-size: 14px;
    color: #666;
    max-width: 300px;
    line-height: 1.6;
    margin: 0;
}

/* ─── Feedback Time Display ─── */
.feedback-time {
    font-size: 14px;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.feedback-time i {
    color: var(--training);
}

/* ─── Workflow Guide Cards ─── */
.guide-panel-intro {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    padding: 4px 0 10px;
    border-bottom: 1px solid #eee;
    margin: 0 0 4px;
}

.guide-card {
    border-radius: 12px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1.5px solid #E0E0E0;
    background: white;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.guide-card:active {
    border-color: var(--training-border);
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(230, 81, 0, 0.15);
}

.guide-card-icon {
    font-size: 20px;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--training-light);
    color: var(--training);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guide-card-info {
    flex: 1;
    min-width: 0;
}

.guide-card-title {
    font-size: 15px;
    font-weight: bold;
    color: #222;
    margin-bottom: 2px;
}

.guide-card-desc {
    font-size: 12px;
    color: #777;
    line-height: 1.4;
    margin-bottom: 4px;
}

.guide-card-steps {
    font-size: 11px;
    color: var(--training);
    font-weight: bold;
}

.guide-card-arrow {
    color: #ccc;
    font-size: 14px;
    flex-shrink: 0;
}

/* ─── Workflow Step Viewer Overlay ─── */
#workflow-viewer {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 900;
    justify-content: flex-end;
    flex-direction: column;
    align-items: center;
}

#workflow-viewer.visible {
    display: flex;
}

#workflow-sheet {
    background: white;
    width: 100%;
    max-width: 480px;
    border-radius: 20px 20px 0 0;
    padding: 20px 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideUp 0.25s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.wv-title-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.wv-step-label {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--training);
    margin-bottom: 2px;
}

.wv-title {
    font-size: 16px;
    font-weight: bold;
    color: #222;
    line-height: 1.3;
}

.wv-close-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 4px;
    flex-shrink: 0;
    line-height: 1;
}

.wv-close-btn:active {
    color: #555;
}

/* Enlarged mockup screen for step viewer */
.guide-mockup {
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 14px;
    padding: 12px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-shrink: 0;
}

/* Scale up mock elements inside guide-mockup */
.guide-mockup .mock-header {
    font-size: 11px;
    padding: 6px 9px;
}

.guide-mockup .mock-btn {
    font-size: 11px;
    padding: 7px 9px;
}

.guide-mockup .mock-input {
    font-size: 11px;
    padding: 6px 8px;
}

.guide-mockup .mock-label {
    font-size: 10px;
}

.wv-instruction {
    font-size: 16px;
    font-weight: bold;
    color: #222;
    line-height: 1.45;
    text-align: center;
    padding: 2px 4px;
}

/* Step dots */
.wv-dots-row {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding: 2px 0;
    flex-shrink: 0;
}

.wv-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.wv-dot.active {
    background: var(--training);
    transform: scale(1.25);
}

/* Step nav buttons */
.wv-nav {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.wv-back-btn {
    flex: 1;
    font-size: 15px;
    padding: 14px;
}

.wv-next-btn {
    flex: 2;
}
