/**
 * Estimation Activity Styles
 *
 * @package Crowdaa_Challenges_Calendar
 * @since   4.12.122
 */

/* Container principal */
.estimation-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 24px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
}

/* Question */
.estimation-question {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
    border: 2px solid #0ea5e9;
}

.estimation-question svg {
    flex-shrink: 0;
    color: #0ea5e9;
}

.estimation-question span {
    font-size: 16px;
    line-height: 1.5;
    color: #1e293b;
    font-weight: 500;
}

/* Indice */
.estimation-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 24px;
    border-left: 4px solid #f59e0b;
}

.estimation-hint svg {
    flex-shrink: 0;
    color: #f59e0b;
}

.estimation-hint span {
    font-size: 14px;
    color: #92400e;
}

/* Zone de saisie */
.estimation-input-area {
    margin-bottom: 20px;
}

.estimation-input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 3px solid #bae6fd;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.estimation-input-wrapper:focus-within {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

.estimation-input {
    flex: 1;
    padding: 16px 20px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    border: none;
    outline: none;
    background: transparent;
    color: #0369a1;
}

.estimation-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.estimation-unit {
    padding: 16px 20px;
    background: #f0f9ff;
    font-size: 18px;
    font-weight: 500;
    color: #0ea5e9;
    border-left: 2px solid #e0f2fe;
}

.estimation-help {
    text-align: center;
    font-size: 12px;
    color: #64748b;
    margin: 8px 0 0 0;
}

/* Message de feedback */
.estimation-message {
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.estimation-message.visible {
    opacity: 1;
}

.estimation-message.success {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
}

.estimation-message.error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

.estimation-message.info {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    color: #0369a1;
}

/* Bouton valider */
.estimation-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.estimation-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
}

.estimation-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.estimation-submit-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.estimation-submit-btn.loading {
    pointer-events: none;
}

.estimation-submit-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Info scoring */
.estimation-scoring-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    font-size: 13px;
    color: #64748b;
}

.estimation-scoring-info svg {
    flex-shrink: 0;
    color: #0ea5e9;
}

/* ========== RESULTATS ========== */

.estimation-completed {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

/* Spécificité maximale pour écraser .crowdaa-modal .results-icon et .quiz-completed-results .results-icon */
.estimation-container.estimation-completed .results-header {
    margin-bottom: 24px;
    text-align: center;
}

.estimation-container.estimation-completed .results-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

/* Triple sélecteur pour écraser tous les contextes (page, modal, quiz) */
.estimation-container .results-icon,
.estimation-container .estimation-results-icon,
.crowdaa-modal .estimation-container .results-icon,
.crowdaa-modal .estimation-container .estimation-results-icon,
.quiz-completed-results .estimation-container .results-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    border-radius: 50%;
    margin-bottom: 16px;
    color: white;
    font-size: 0; /* Cache le texte, seul le SVG sera visible */
    animation: none;
}

/* SVG dans l'icône de résultat */
.estimation-container .results-icon svg,
.estimation-container .estimation-results-icon svg,
.crowdaa-modal .estimation-container .results-icon svg {
    width: 48px;
    height: 48px;
    stroke: white;
}

/* Solution */
.estimation-solution {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
    border: 2px solid #bae6fd;
}

.estimation-solution p {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #64748b;
}

.solution-value {
    font-size: 36px;
    font-weight: 700;
    color: #0ea5e9;
}

.solution-unit {
    font-size: 20px;
    font-weight: 500;
    color: #0284c7;
    margin-left: 4px;
}

.user-guess {
    margin-top: 16px !important;
    padding-top: 16px;
    border-top: 1px solid #e0f2fe;
    font-size: 15px !important;
    color: #475569 !important;
}

.user-guess strong {
    color: #0369a1;
}

/* Stats de résultat */
.estimation-results-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.estimation-container .result-card {
    background: white;
    border: 2px solid #bae6fd;
}

.estimation-container .result-card .result-icon {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd) !important;
}

.estimation-container .result-card .result-icon svg {
    stroke: #0284c7 !important;
}

.estimation-container .result-card .result-value {
    color: #0284c7;
}

/* ========== CONTEXTE MODAL ========== */

/* result-card icons dans modal */
.crowdaa-modal .estimation-container .result-card .result-icon {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    font-size: 0;
}

.crowdaa-modal .estimation-container .result-card .result-icon svg {
    width: 32px;
    height: 32px;
    stroke: #0284c7;
}

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

@media (max-width: 480px) {
    .estimation-container {
        padding: 16px;
    }

    .estimation-question {
        padding: 16px;
    }

    .estimation-question span {
        font-size: 15px;
    }

    .estimation-input {
        font-size: 20px;
        padding: 14px 16px;
    }

    .estimation-unit {
        font-size: 16px;
        padding: 14px 16px;
    }

    .solution-value {
        font-size: 28px;
    }

    .estimation-results-stats {
        flex-direction: column;
        align-items: center;
    }
}

/* Touch devices - disable hover */
@media (hover: none), (pointer: coarse) {
    .estimation-submit-btn:hover:not(:disabled) {
        transform: none;
        box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    }
}
