/**
 * True/False Activity Styles
 * Quiz : une ou plusieurs affirmations, deux boutons (Vrai/Faux)
 * Mobile-first design
 *
 * @package Crowdaa_Challenges_Calendar
 * @since 4.12.330
 * @updated 4.12.360 - Multi-questions + Timer
 */

/* ========== CONTAINER ========== */

.true-false-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 16px;
}

/* ========== GAME INTERFACE ========== */

.tf-game {
    background: white;
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Header */
.tf-header {
    margin-bottom: 24px;
}

.tf-header-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.tf-header-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.tf-header-icon svg {
    color: white;
}

.tf-header-info {
    flex: 1;
    min-width: 0;
}

.tf-title {
    font-size: 20px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 4px 0;
}

.tf-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* Timer */
.tf-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #92400e;
    flex-shrink: 0;
}

.tf-timer svg {
    color: #f59e0b;
}

.tf-timer.tf-timer-warning {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    animation: tf-pulse 0.5s ease infinite;
}

.tf-timer.tf-timer-warning svg {
    color: #ef4444;
}

@keyframes tf-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Progress bar */
.tf-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tf-progress-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.tf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.tf-progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

/* Questions wrapper */
.tf-questions-wrapper {
    min-height: 200px;
}

/* Image */
.tf-image {
    margin-bottom: 20px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

/* Statement */
.tf-statement {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #86efac;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: center;
}

.tf-statement-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tf-statement-icon svg {
    color: #10b981;
}

.tf-statement-text {
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.5;
    margin: 0;
}

/* Choices */
.tf-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.tf-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    border: 3px solid #e5e7eb;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.tf-choice:hover:not(.tf-disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.tf-choice:active:not(.tf-disabled) {
    transform: scale(0.98);
}

.tf-choice-true:hover:not(.tf-disabled) {
    border-color: #10b981;
    background: #f0fdf4;
}

.tf-choice-false:hover:not(.tf-disabled) {
    border-color: #ef4444;
    background: #fef2f2;
}

.tf-choice-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.tf-choice-label {
    font-size: 18px;
    font-weight: 700;
    color: #374151;
}

/* States */
.tf-choice.tf-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tf-choice.tf-selected {
    border-width: 4px;
}

.tf-choice.tf-selected.tf-choice-true {
    border-color: #10b981;
    background: #d1fae5;
}

.tf-choice.tf-selected.tf-choice-false {
    border-color: #ef4444;
    background: #fee2e2;
}

.tf-choice.tf-correct-choice {
    border-color: #10b981 !important;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
}

.tf-choice.tf-incorrect-choice {
    border-color: #ef4444 !important;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
}

/* Points info */
.tf-points-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #fef3c7;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #92400e;
}

.tf-points-info svg {
    color: #f59e0b;
}

/* ========== RESULTS ========== */

.tf-results-header {
    text-align: center;
    margin-bottom: 24px;
}

.tf-results-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tf-results-icon.tf-correct {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.tf-results-icon.tf-correct svg {
    color: white;
}

.tf-results-icon.tf-incorrect {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.tf-results-icon.tf-incorrect svg {
    color: white;
}

.tf-results-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.tf-results-title.tf-correct {
    color: #059669;
}

.tf-results-title.tf-incorrect {
    color: #dc2626;
}

.tf-results-subtitle {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
}

/* Points badge */
.tf-results-points {
    margin-bottom: 24px;
    text-align: center;
}

.tf-points-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
}

.tf-points-badge.tf-has-points {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.tf-points-badge.tf-no-points {
    background: #f3f4f6;
    color: #6b7280;
}

.tf-points-value {
    font-size: 28px;
    font-weight: 700;
}

.tf-points-label {
    font-size: 14px;
}

/* ========== RECAP (Multi-questions) ========== */

.tf-results-recap {
    margin-top: 24px;
}

.tf-recap-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.tf-recap-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.tf-recap-item.tf-recap-correct {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
}

.tf-recap-item.tf-recap-incorrect {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
}

.tf-recap-number {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
}

.tf-recap-correct .tf-recap-number {
    background: #10b981;
}

.tf-recap-incorrect .tf-recap-number {
    background: #ef4444;
}

.tf-recap-content {
    flex: 1;
    min-width: 0;
}

.tf-recap-statement {
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.tf-recap-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 13px;
}

.tf-user-answer {
    color: #6b7280;
}

.tf-user-answer strong {
    color: #374151;
}

.tf-correct-answer {
    color: #059669;
}

.tf-correct-answer strong {
    color: #047857;
}

.tf-recap-explanation {
    margin: 10px 0 0 0;
    padding: 10px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    font-size: 12px;
    color: #374151;
    line-height: 1.5;
}

.tf-recap-status {
    flex-shrink: 0;
}

/* Legacy statement box (single question results) */
.tf-results-statement {
    margin-bottom: 20px;
}

.tf-statement-box {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.tf-statement-box .tf-statement-text {
    font-size: 16px;
    margin: 0;
}

.tf-correct-answer-legacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tf-answer-label {
    font-size: 14px;
    color: #6b7280;
}

.tf-answer-value {
    font-size: 16px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
}

.tf-answer-value.tf-true {
    background: #d1fae5;
    color: #059669;
}

.tf-answer-value.tf-false {
    background: #fee2e2;
    color: #dc2626;
}

/* Explanation */
.tf-explanation {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.tf-explanation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1d4ed8;
    margin-bottom: 8px;
}

.tf-explanation-header svg {
    color: #3b82f6;
}

.tf-explanation-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

/* Results image */
.tf-results-image {
    border-radius: 12px;
    overflow: hidden;
}

.tf-results-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 400px) {
    .tf-header-top {
        flex-wrap: wrap;
    }

    .tf-header-icon {
        width: 48px;
        height: 48px;
    }

    .tf-header-icon svg {
        width: 24px;
        height: 24px;
    }

    .tf-timer {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    .tf-choice-icon {
        font-size: 32px;
    }

    .tf-choice-label {
        font-size: 16px;
    }

    .tf-statement-text {
        font-size: 16px;
    }

    .tf-recap-item {
        flex-wrap: wrap;
    }

    .tf-recap-status {
        width: 100%;
        text-align: right;
        margin-top: 8px;
    }
}

@media (min-width: 480px) {
    .tf-game,
    .tf-results {
        padding: 32px 28px;
    }

    .tf-choice {
        padding: 28px 20px;
    }

    .tf-choice-icon {
        font-size: 48px;
    }

    .tf-header-icon {
        width: 64px;
        height: 64px;
    }

    .tf-title {
        font-size: 22px;
    }
}
