/* ==========================================================================
   ESTILOS DE MÓDULO EXAMEN Q-BANK Y MODO ANKI 3D FLASHCARDS
   ========================================================================== */

/* Contenedor QBank */
.qbank-container {
    max-width: 850px;
    margin: 0 auto;
    width: 100%;
}

.qbank-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    background: var(--pastel-pink-bg, #fff0f3);
    border-bottom: 2px solid var(--pastel-pink-border, #ffb7b2);
    padding: 0.8rem 1.2rem;
}

.qbank-mode-pills {
    display: flex;
    gap: 0.5rem;
}

.qbank-timer-badge {
    background: #1a202c;
    color: #4ade80;
    font-family: monospace, sans-serif;
    font-weight: 900;
    font-size: 0.95rem;
    padding: 0.35rem 0.85rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.qbank-counter-badge {
    background: #ffffff;
    border: 1.5px solid #bae6fd;
    color: #0369a1;
    font-weight: 900;
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    border-radius: 16px;
}

/* Tarjeta Principal del Examen */
.qbank-card-body {
    padding: 1.5rem;
    background: #ffffff;
}

.qbank-lesson-badge {
    display: inline-block;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    margin-bottom: 0.8rem;
}

.qbank-question-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark, #2d3748);
    margin-bottom: 1.2rem;
    line-height: 1.45;
}

.qbank-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.qbank-opt-btn {
    text-align: left;
    background: #ffffff;
    border: 2px solid rgba(74, 85, 104, 0.15);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.qbank-opt-btn:hover:not(:disabled) {
    border-color: var(--pastel-pink-border, #ffb7b2);
    background: #fffafb;
    transform: translateX(4px);
}

.qbank-opt-btn.opt-selected {
    border-color: var(--pastel-pink-text, #d85d75);
    background: var(--pastel-pink-bg, #fff0f3);
    font-weight: 900;
}

.qbank-opt-btn.opt-correct {
    background: #f0fdf4 !important;
    border-color: #22c55e !important;
    color: #15803d !important;
    font-weight: 900;
}

.qbank-opt-btn.opt-incorrect {
    background: #fef2f2 !important;
    border-color: #ef4444 !important;
    color: #b91c1c !important;
}

/* Explicación Tutor */
.qbank-explanation-box {
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 1.2rem;
    display: flex;
    gap: 0.8rem;
    font-size: 0.88rem;
    line-height: 1.4;
}

.exp-success {
    background: #ecfdf5;
    border: 1.5px solid #a7f3d0;
    color: #065f46;
}

.exp-error {
    background: #fff1f2;
    border: 1.5px solid #fecdd3;
    color: #9f1239;
}

.qbank-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
}

/* Resultados QBank */
.qbank-results-box {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 16px;
}

.res-pass {
    background: #f0fdf4;
    border: 2px solid #86efac;
    color: #166534;
}

.res-fail {
    background: #fef2f2;
    border: 2px solid #fca5a5;
    color: #991b1b;
}

.qbank-score-big {
    font-size: 3.5rem;
    font-weight: 900;
    margin: 0.4rem 0;
}

.qbank-locked-box {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
}

.qbank-lock-icon {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

/* ==========================================================================
   ESTILOS DE MODO ANKI 3D VOLTEABLE EN FLASHCARDS
   ========================================================================== */
/* Ocultamiento de textos y pestañas redundantes en modo Anki */
#tab-flashcards.anki-active-view .flashcards-section-header p,
#tab-flashcards.anki-active-view .flashcards-section-header h2 {
    margin-bottom: 0.2rem;
}

#tab-flashcards.anki-active-view .flashcards-section-header p {
    font-size: 0.85rem;
    line-height: 1.25;
}

@media screen and (max-width: 768px) {
    #tab-flashcards.anki-active-view .flashcards-tabs-etsy {
        display: flex !important;
    }
}

/* Base Anki Container & 3D Flip System */
.anki-mode-container {
    max-width: 650px;
    margin: 1rem auto 0 auto;
    perspective: 1000px;
}

.anki-card-3d {
    width: 100%;
    min-height: 360px;
    height: auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-radius: 20px;
}

.anki-card-3d.flipped {
    transform: rotateY(180deg);
}

.anki-face {
    width: 100%;
    min-height: 360px;
    height: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 20px;
    padding: 1.8rem 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 5px 5px 0px rgba(74, 85, 104, 0.15);
    border: 2px solid var(--pastel-pink-border, #fecdd3);
    background: #ffffff;
    box-sizing: border-box;
}

.anki-face-front {
    position: relative;
    z-index: 2;
    transform: rotateY(0deg);
}

.anki-card-3d.flipped .anki-face-front {
    position: absolute;
    top: 0;
    left: 0;
}

.anki-face-back {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateY(180deg);
    z-index: 1;
    overflow: visible;
}

.anki-card-3d.flipped .anki-face-back {
    position: relative;
}

.anki-controls-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.srs-btn {
    border-radius: 12px;
    padding: 0.5rem 0.8rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 0.8rem;
    border: 1.5px solid rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.srs-hard { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.srs-review { background: #fefce8; color: #854d0e; border-color: #fef08a; }
.srs-easy { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }

.srs-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

/* Ajustes Responsivos Móvil (< 768px) */
@media screen and (max-width: 768px) {
    #tab-flashcards.anki-active-view .flashcards-section-header p {
        display: none !important; /* Ocultar subtítulo largo en celular */
    }

    #tab-flashcards.anki-active-view .flashcards-section-header h2 {
        font-size: 1.1rem;
    }

    .anki-mode-container {
        margin: 0.4rem auto 0 auto;
        padding: 0;
    }

    .anki-card-3d {
        height: 240px;
    }

    .anki-face {
        padding: 0.8rem 1rem;
        border-radius: 16px;
    }

    .anki-face-front h2 {
        font-size: 1.05rem !important;
        margin-top: 0.3rem !important;
    }

    .anki-face-front .card-note-tip {
        font-size: 0.82rem !important;
        margin-top: 0.3rem !important;
    }

    .anki-controls-row {
        gap: 0.3rem;
        margin-top: 0.5rem;
    }

    .anki-controls-row .scen-pill-btn,
    .srs-btn {
        padding: 0.35rem 0.4rem;
        font-size: 0.72rem;
        border-radius: 10px;
        flex: 1;
        min-height: 36px;
    }
}

/* ==========================================================================
   REDISEÑO ELEGANTE DE BOTONERA MODO ANKI 3D
   ========================================================================== */
.anki-controls-wrapper {
    margin-top: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.anki-action-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.anki-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid rgba(74, 85, 104, 0.2);
    background: #ffffff;
    color: #475569;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.anki-nav-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.anki-flip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.65rem 1.6rem;
    border-radius: 25px;
    border: 2px solid #334155;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #ffffff;
    font-family: var(--font-primary, 'Nunito', sans-serif);
    font-size: 0.95rem;
    font-weight: 850;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    flex-grow: 1;
    max-width: 280px;
}

.anki-flip-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.22);
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.anki-srs-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}

.srs-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 0.5rem;
    border-radius: 14px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
}

.srs-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.srs-dot.red { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); }
.srs-dot.yellow { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.5); }
.srs-dot.green { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.5); }

.srs-label-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.1;
}

.srs-title {
    font-family: var(--font-primary, 'Nunito', sans-serif);
    font-size: 0.88rem;
    font-weight: 850;
}

.srs-sub {
    font-family: var(--font-handwritten, 'Caveat', cursive);
    font-size: 0.8rem;
    font-weight: 700;
    opacity: 0.85;
}

.srs-btn.srs-hard {
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    border-color: #fecdd3;
    color: #9f1239;
}

.srs-btn.srs-hard:hover {
    transform: translateY(-2px);
    border-color: #fda4af;
    box-shadow: 0 5px 12px rgba(225, 29, 72, 0.12);
}

.srs-btn.srs-review {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
    color: #92400e;
}

.srs-btn.srs-review:hover {
    transform: translateY(-2px);
    border-color: #fcd34d;
    box-shadow: 0 5px 12px rgba(217, 119, 6, 0.12);
}

.srs-btn.srs-easy {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
    color: #166534;
}

.srs-btn.srs-easy:hover {
    transform: translateY(-2px);
    border-color: #86efac;
    box-shadow: 0 5px 12px rgba(22, 163, 74, 0.12);
}
