/* FFF Onboarding - Frontend Dashboard */

:root {
    --ob-primary: #2ABDCB;
    --ob-primary-light: #e0f7fa;
    --ob-dark: #060F40;
    --ob-bg: #f5f6fa;
    --ob-white: #ffffff;
    --ob-grey: #EBEDF2;
    --ob-text: #1a1a2e;
    --ob-text-muted: #6b7280;
    --ob-success: #22c55e;
    --ob-success-light: #dcfce7;
    --ob-warning: #f59e0b;
    --ob-warning-light: #fef3c7;
    --ob-locked: #9ca3af;
    --ob-error: #dc2626;
    --ob-radius: 16px;
    --ob-radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ---- Main ---- */
.fff-ob-loading { text-align: center; padding: 60px 0; color: var(--ob-text-muted); }

/* ---- Hero card ---- */
.fff-ob-hero {
    background: linear-gradient(135deg, var(--ob-primary), #1a9baa);
    border-radius: var(--ob-radius);
    padding: 36px 32px;
    color: #fff;
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.fff-ob-hero::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 160px; height: 160px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.fff-ob-hero-icon { font-size: 40px; margin-bottom: 12px; }
.fff-ob-hero h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.fff-ob-hero p { font-size: 14px; opacity: 0.85; margin-bottom: 20px; }

.fff-ob-hero-progress { max-width: 320px; margin: 0 auto; }
.fff-ob-hero-progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.25);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}
.fff-ob-hero-progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 4px;
    transition: width 0.4s ease;
}
.fff-ob-hero-progress-text { font-size: 13px; font-weight: 600; opacity: 0.9; }

/* ---- Module grid ---- */
.fff-ob-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ---- Module card ---- */
.fff-ob-card {
    background: var(--ob-white);
    border-radius: var(--ob-radius);
    padding: 24px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 2px solid transparent;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 140px;
}
.fff-ob-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

/* Current / available */
.fff-ob-card.current {
    background: var(--ob-warning-light);
    border-color: var(--ob-warning);
}

/* Completed */
.fff-ob-card.completed {
    background: var(--ob-success-light);
    border-color: var(--ob-success);
}

/* Locked */
.fff-ob-card.locked {
    border: 2px dashed var(--ob-primary);
    opacity: 0.6;
    cursor: not-allowed;
}
.fff-ob-card.locked:hover {
    transform: none;
    box-shadow: none;
}

.fff-ob-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    width: fit-content;
}
.fff-ob-card-badge.step {
    background: var(--ob-dark);
    color: #fff;
}
.fff-ob-card-badge.done {
    background: var(--ob-success);
    color: #fff;
}
.fff-ob-card-badge.lock {
    background: var(--ob-grey);
    color: var(--ob-text-muted);
}

.fff-ob-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}
.fff-ob-card-sub {
    font-size: 13px;
    color: var(--ob-text-muted);
}
.fff-ob-card-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 20px;
    opacity: 0.4;
}

/* ---- Module detail ---- */
#fff-ob-app { width: 100%; max-width: 100%; }
#fff-ob-app > * {
    width: min(100%, 720px);
    margin-left: auto;
    margin-right: auto;
}

.fff-ob-detail {
    background: var(--ob-white);
    border-radius: var(--ob-radius);
    padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 48px);
}
.fff-ob-detail-back {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--ob-primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}
.fff-ob-detail-back:hover { color: var(--ob-dark); }
.fff-ob-detail-content { font-size: 17px; line-height: 1.75; width: 100%; color: var(--ob-text); }
.fff-ob-detail-content > * { max-width: 100%; }
.fff-ob-detail-content p,
.fff-ob-detail-content li,
.fff-ob-detail-content a { font-size: 17px; }
.fff-ob-detail-content p { margin-bottom: 20px; }
.fff-ob-detail-content a { color: var(--ob-primary); text-decoration: underline; }
.fff-ob-detail-content a:hover { color: var(--ob-dark); }
.fff-ob-detail-content h1 { font-size: 28px; font-weight: 700; line-height: 1.3; margin: 8px 0 24px; }
.fff-ob-detail-content h2,
.fff-ob-detail-content h3,
.fff-ob-detail-content h4 { margin-top: 32px; margin-bottom: 16px; line-height: 1.3; }
.fff-ob-detail-content ul,
.fff-ob-detail-content ol { margin: 16px 0; padding-left: 24px; }
.fff-ob-detail-content li { margin-bottom: 8px; }
.fff-ob-detail-content .wp-block-video,
.fff-ob-detail-content .wp-block-embed { margin: 24px 0; width: 100%; }
.fff-ob-detail-content .wp-block-embed__wrapper { position: relative; padding-bottom: 56.25%; height: 0; }
.fff-ob-detail-content .wp-block-embed__wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 8px; }
.fff-ob-detail-content iframe { max-width: 100%; border-radius: 8px; }
.fff-ob-detail-content figure { margin: 24px 0; max-width: 100%; }
.fff-ob-detail-content figure.wp-block-video { max-width: 100%; }
.fff-ob-detail-content video { width: 100%; border-radius: 8px; }
.fff-ob-detail-content figcaption { font-size: 14px; color: var(--ob-text-muted); margin-top: 8px; }

/* Standalone <strong> -- whole paragraph/list-item is bold (no surrounding text) */
.fff-ob-detail-content .fff-ob-strong-block {
    background: var(--ob-primary-light);
    border-left: 4px solid var(--ob-primary);
    padding: 14px 18px;
    border-radius: 6px;
    margin: 20px 0;
}
.fff-ob-detail-content .fff-ob-strong-block strong { font-weight: 600; }

/* Image lightbox enhancement: parent (figure/p) becomes positioning host */
.fff-ob-img-host {
    position: relative !important;
}
.fff-ob-img-host > img { cursor: zoom-in; max-width: 100%; height: auto; }
.fff-ob-zoom {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: var(--f3-dark-blue, var(--ob-dark)) !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
    transition: transform 0.15s, background 0.15s;
    z-index: 10 !important;
    pointer-events: auto !important;
}
.fff-ob-zoom:hover { transform: scale(1.06); background: #f3f4f6 !important; }
.fff-ob-zoom svg { display: block; pointer-events: none; }

.fff-ob-lightbox {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    background: rgba(0,0,0,0.92) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2147483647 !important;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: zoom-out;
    padding: 20px;
    box-sizing: border-box;
    margin: 0 !important;
}
.fff-ob-lightbox.active { opacity: 1; }
.fff-ob-lightbox img {
    max-width: 95vw !important;
    max-height: 90vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}
.fff-ob-lightbox-close {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 1;
}
.fff-ob-lightbox-close:hover { background: rgba(255,255,255,0.22); }

.fff-ob-complete-btn {
    display: inline-block;
    margin-top: 28px;
    padding: 14px 36px;
    background: var(--ob-primary);
    color: #fff;
    border: none;
    border-radius: var(--ob-radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}
.fff-ob-complete-btn:hover { background: #1a9baa; }
.fff-ob-complete-btn:disabled { background: var(--ob-success); cursor: default; }
.fff-ob-complete-btn.done { background: var(--ob-success); cursor: default; }

.fff-ob-detail-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--ob-grey);
}

.fff-ob-next-btn {
    display: inline-block;
    padding: 14px 28px;
    background: var(--ob-dark);
    color: #fff;
    border: none;
    border-radius: var(--ob-radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}
.fff-ob-next-btn:hover { background: #0d1b5e; }

/* ---- Quiz start (inline in module detail) ---- */
.fff-ob-inline-quiz {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--ob-grey);
}

.fff-ob-quiz-start {
    background: linear-gradient(135deg, var(--ob-dark), #0d1b5e);
    color: #fff;
    border-radius: var(--ob-radius);
    padding: 32px;
    text-align: center;
}
.fff-ob-quiz-start h3 { font-size: 20px; margin-bottom: 8px; }
.fff-ob-quiz-start p { font-size: 14px; opacity: 0.8; margin-bottom: 20px; }
.fff-ob-quiz-start .fff-ob-badge { margin-bottom: 12px; }

/* ---- Quiz banner (standalone shortcode) ---- */
.fff-ob-quiz-banner {
    background: linear-gradient(135deg, var(--ob-dark), #0d1b5e);
    color: #fff;
    border-radius: var(--ob-radius);
    padding: 28px;
    text-align: center;
    margin-top: 28px;
}
.fff-ob-quiz-banner h3 { font-size: 18px; margin-bottom: 8px; }
.fff-ob-quiz-banner p { font-size: 14px; opacity: 0.8; margin-bottom: 16px; }
.fff-ob-quiz-btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--ob-primary);
    color: #fff;
    border: none;
    border-radius: var(--ob-radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
}
.fff-ob-quiz-btn:hover { background: #1a9baa; }

/* ---- Badge ---- */
.fff-ob-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--ob-success);
    color: #fff;
    font-size: 26px;
    margin-bottom: 16px;
}
.fff-ob-badge.large { width: 68px; height: 68px; font-size: 34px; margin-bottom: 20px; }

/* ---- Quiz interface ---- */
.fff-ob-quiz-wrap {
    background: var(--ob-white);
    border-radius: var(--ob-radius);
    padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 48px);
}
.fff-ob-quiz-progress { margin-bottom: 24px; }
.fff-ob-quiz-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ob-text-muted);
}
.fff-ob-progress-bar { height: 8px; background: var(--ob-grey); border-radius: 4px; overflow: hidden; }
.fff-ob-progress-fill { height: 100%; background: var(--ob-primary); border-radius: 4px; transition: width 0.4s ease; }

.fff-ob-timer {
    font-variant-numeric: tabular-nums;
    font-size: 18px;
    font-weight: 700;
    color: var(--ob-dark);
    padding: 4px 12px;
    background: var(--ob-grey);
    border-radius: 6px;
    min-width: 48px;
    text-align: center;
}
.fff-ob-timer.warning { background: #fef2f2; color: var(--ob-error); }

/* Timer bar at bottom of quiz question */
.fff-ob-timer-bar {
    margin-top: 24px;
    height: 6px;
    background: var(--ob-grey);
    border-radius: 3px;
    overflow: hidden;
}
.fff-ob-timer-bar-fill {
    height: 100%;
    background: var(--ob-primary);
    border-radius: 3px;
    transition: width 1s linear;
    width: 100%;
}
.fff-ob-timer-bar-fill.warning {
    background: var(--ob-error);
}

.fff-ob-quiz-type {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 4px;
    background: var(--ob-grey);
    color: var(--ob-text-muted);
    margin-bottom: 12px;
}
.fff-ob-quiz-question { font-size: 19px; line-height: 1.5; margin-bottom: 24px; }
.fff-ob-quiz-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.fff-ob-quiz-option {
    display: block;
    width: 100%;
    padding: 14px 18px;
    text-align: left;
    background: var(--ob-white);
    border: 2px solid var(--ob-grey);
    border-radius: var(--ob-radius-sm);
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.fff-ob-quiz-option:hover { border-color: var(--ob-primary); background: rgba(42,189,203,0.04); }
.fff-ob-quiz-option.selected { border-color: var(--ob-primary); background: rgba(42,189,203,0.08); font-weight: 600; }

.fff-ob-quiz-textarea {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-family: inherit;
    border: 2px solid var(--ob-grey);
    border-radius: var(--ob-radius-sm);
    resize: vertical;
    margin-bottom: 24px;
    min-height: 100px;
}
.fff-ob-quiz-textarea:focus { border-color: var(--ob-primary); outline: none; }
.fff-ob-quiz-actions { display: flex; justify-content: flex-end; }

/* ---- Quiz result ---- */
.fff-ob-quiz-result {
    background: var(--ob-white);
    border-radius: var(--ob-radius);
    padding: clamp(28px, 5vw, 48px) clamp(20px, 4vw, 48px);
    text-align: center;
}
.fff-ob-quiz-result h2 { font-size: 24px; margin-bottom: 8px; }
.fff-ob-quiz-result p { color: var(--ob-text-muted); margin-bottom: 24px; font-size: 15px; }
.fff-ob-score-circle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 140px; height: 140px;
    border-radius: 50%;
    margin: 0 auto 24px;
    border: 6px solid var(--ob-grey);
}
.fff-ob-score-circle.passed { border-color: var(--ob-success); }
.fff-ob-score-circle.failed { border-color: var(--ob-error); }
.fff-ob-score-number { font-size: 32px; font-weight: 700; line-height: 1; }
.fff-ob-score-circle.passed .fff-ob-score-number { color: var(--ob-success); }
.fff-ob-score-circle.failed .fff-ob-score-number { color: var(--ob-error); }
.fff-ob-score-label { font-size: 12px; color: var(--ob-text-muted); margin-top: 4px; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .fff-ob-grid { grid-template-columns: 1fr; }
    .fff-ob-hero { padding: 28px 20px; }
    .fff-ob-detail-content h1 { font-size: 24px; }
    .fff-ob-zoom { width: 36px; height: 36px; top: 8px; right: 8px; }
}
