/* =============================================
   FLASH CARDS - Estilos
   ============================================= */

/* --- Contenedor principal --- */
.flash-cards-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.fc-game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    min-height: 300px;
}

/* --- Tarjeta 3D --- */
.fc-card-container {
    perspective: 1000px;
    width: 100%;
    max-width: 340px;
    aspect-ratio: 3 / 4;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.fc-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 0.3s ease;
    border-radius: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.fc-card-container:hover .fc-card {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.fc-card-container:hover .fc-card.flipped {
    transform: rotateY(180deg) translateY(-2px);
}

.fc-card.flipped {
    transform: rotateY(180deg);
}

.fc-card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.fc-card-front {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #fff;
}

.fc-card-back {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    color: #fff;
    transform: rotateY(180deg);
}

.fc-word {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
}

/* Entrada animada de la tarjeta */
.fc-card-enter {
    animation: cardEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Feedback visual en la tarjeta */
.fc-card.correct-flash .fc-card-back {
    animation: correctFlash 0.6s ease;
}

.fc-card.wrong-flash .fc-card-back {
    animation: wrongFlash 0.6s ease;
}

@keyframes correctFlash {
    0%, 100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15); }
    50% { box-shadow: 0 8px 40px rgba(39, 174, 96, 0.5); }
}

@keyframes wrongFlash {
    0%, 100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15); }
    50% { box-shadow: 0 8px 40px rgba(231, 76, 60, 0.5); }
}

.fc-hint {
    position: absolute;
    top: 1rem;
    font-size: 0.8rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.fc-play-btn {
    margin-top: 1rem;
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}
.fc-play-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* --- Controles de evaluación --- */
.fc-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    animation: fadeInUp 0.3s ease-out;
}

.fc-controls-hint {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

.fc-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.fc-btn-eval {
    min-width: 140px;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}

.fc-btn-eval::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.15);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.fc-btn-eval:active {
    transform: scale(0.96);
}

.fc-btn-eval:active::after {
    opacity: 1;
}

.fc-btn-eval.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.35);
}

.fc-btn-eval.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.35);
}

/* --- Animaciones --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Horizontal (landscape) en móvil --- */
@media (max-height: 500px) and (orientation: landscape) {
    .fc-game-area {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        min-height: auto;
    }

    .fc-card-container {
        max-width: 260px;
        aspect-ratio: 4 / 3;
    }

    .fc-card-face {
        padding: 1.25rem;
    }

    .fc-word {
        font-size: 1.5rem;
    }

    .fc-controls {
        align-items: flex-start;
        width: auto;
    }

    .fc-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .fc-btn-eval {
        min-width: 160px;
    }
}

/* --- Pantallas más grandes --- */
@media (min-width: 576px) {
    .fc-card-container {
        max-width: 400px;
    }

    .fc-word {
        font-size: 2.4rem;
    }

    .fc-btn-eval {
        min-width: 160px;
        padding: 0.75rem 1.5rem;
        font-size: 1.1rem;
    }
}

/* --- Transiciones suaves para elementos que aparecen/desaparecen --- */
.fc-summary,
.fc-controls {
    transition: opacity 0.3s ease;
}

/* =============================================
   PROGRESO ANIMADO
   ============================================= */
.fc-progress-wrap {
    max-width: 340px;
    width: 100%;
    margin: 0 auto;
}

.fc-progress-bar-outer {
    height: 0.5rem;
    background-color: var(--border-color, #dee2e6);
    border-radius: 999px;
    overflow: hidden;
}

.fc-progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary, #3498db), var(--brand-success, #27ae60));
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   SUMMARY SCORE COLORS
   ============================================= */
.fc-summary-score.great { color: var(--brand-success, #27ae60); }
.fc-summary-score.good  { color: var(--brand-warning, #f39c12); }
.fc-summary-score.poor  { color: var(--brand-danger, #e74c3c); }

/* Stagger animation for summary items */
.fc-summary .gram-result-item {
    animation: fadeInUp 0.3s ease-out both;
}
