/* ============================================
   FICHE FEATURES - Checkpoints, Countdown, Share
   TDAH-friendly gamification for fiches
   ============================================ */

/* --- CHECKPOINT MARKER (needs height for IntersectionObserver) --- */
.fiche-checkpoint {
    height: 4px;
    width: 100%;
    pointer-events: none;
}

/* --- CHECKPOINT OVERLAY --- */
.checkpoint-overlay {
    position: fixed;
    inset: 0;
    z-index: 9990;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.checkpoint-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.checkpoint-card {
    background: white;
    border-radius: 24px;
    padding: 28px 24px;
    max-width: 380px;
    width: 90vw;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.checkpoint-overlay.visible .checkpoint-card {
    transform: scale(1) translateY(0);
}

.checkpoint-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}
.checkpoint-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: background 0.3s, transform 0.3s;
}
.checkpoint-progress-dot.done {
    background: #10b981;
    transform: scale(1.1);
}
.checkpoint-progress-dot.current {
    background: #6366f1;
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(99,102,241,0.5);
}

.checkpoint-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6366f1;
    margin-bottom: 8px;
}

.checkpoint-question {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 20px;
}

.checkpoint-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkpoint-option {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.checkpoint-option:hover {
    border-color: #6366f1;
    background: #eef2ff;
}
.checkpoint-option:active {
    transform: scale(0.97);
}
.checkpoint-option.correct {
    border-color: #10b981;
    background: #d1fae5;
    color: #065f46;
}
.checkpoint-option.wrong {
    border-color: #ef4444;
    background: #fee2e2;
    color: #991b1b;
}

.checkpoint-hint {
    margin-top: 14px;
    padding: 12px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    display: none;
}
.checkpoint-hint.visible {
    display: block;
    animation: shake 0.4s ease;
}

.checkpoint-success {
    margin-top: 14px;
    font-size: 18px;
    font-weight: 800;
    color: #10b981;
    display: none;
}
.checkpoint-success.visible {
    display: block;
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- QUIZ COUNTDOWN --- */
.countdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 9991;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.countdown-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.countdown-message {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    margin-bottom: 24px;
    text-align: center;
    padding: 0 20px;
}

.countdown-circle-container {
    position: relative;
    width: 160px;
    height: 160px;
    margin-bottom: 32px;
}

.countdown-circle-bg {
    fill: none;
    stroke: rgba(255,255,255,0.2);
    stroke-width: 6;
}
.countdown-circle-progress {
    fill: none;
    stroke: white;
    stroke-width: 6;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 1s linear;
}

.countdown-number {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.countdown-skip {
    padding: 14px 32px;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 999px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}
.countdown-skip:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.3);
}

.countdown-tip {
    margin-top: 20px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 0 24px;
}

/* --- SCORE CARD --- */
.scorecard-wrap {
    margin: 24px auto 16px;
    max-width: 380px;
    animation: scorecardIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes scorecardIn {
    0% { opacity: 0; transform: scale(0.85) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.scorecard-preview {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}
.scorecard-preview:active {
    transform: scale(0.98);
}

.scorecard-img {
    width: 100%;
    height: auto;
    display: block;
}

.scorecard-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 14px;
}

.scorecard-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    color: white;
    font-family: 'Outfit', system-ui, sans-serif;
}
.scorecard-btn:active {
    transform: scale(0.93);
}

.scorecard-btn-download {
    background: #1E293B;
}
.scorecard-btn-whatsapp {
    background: #25D366;
}
.scorecard-btn-link {
    background: #6366F1;
}
.scorecard-btn-native {
    background: linear-gradient(135deg, #F472B6, #EC4899);
}

/* Legacy share buttons (kept for compatibility) */
.share-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    color: white;
}
.share-btn:active { transform: scale(0.95); }
.share-btn-whatsapp { background: #25D366; }
.share-btn-copy { background: #6366f1; }
.share-btn-native { background: #1e293b; }
.share-btn-copy.copied { background: #10b981; }
