/* ==========================================================================
   FLASHCARD.CSS - Flashcard Mode, Focus Overlay
   ========================================================================== */

/* --- Flashcard Mode --- */
#flashcard-container {
    display: none;
    width: 100%;
    max-width: 1200px;
    padding-bottom: 2rem;
}

.fc-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    background: #1e293b;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border: 1px solid #334155;
}

#fc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.flashcard-wrapper {
    background-color: transparent;
    width: 100%;
    height: 300px;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.flashcard-wrapper:hover {
    transform: translateY(-8px) scale(1.02);
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-radius: 16px;
}

.flashcard-wrapper.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: hidden;
    border: 2px solid transparent;
    background: linear-gradient(var(--card-bg), var(--card-bg)) padding-box, var(--g) border-box;
}

.flashcard-back {
    transform: rotateY(180deg);
    justify-content: space-between;
}

.fc-q-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-q);
    max-height: 90%;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.fc-q-text::-webkit-scrollbar {
    display: none;
}

.fc-a-text {
    font-size: 1rem;
    color: #e2e8f0;
    margin-bottom: 1rem;
    overflow-y: auto;
    flex: 1;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid #334155;
    padding-bottom: 0.5rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.fc-a-text::-webkit-scrollbar {
    display: none;
}

.fc-a-correct {
    color: #22c55e;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.fc-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.fc-btn {
    flex: 1;
    padding: 0.5rem 0;
    border: none;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: transparent;
    color: #fff;
}

.fc-btn:hover {
    transform: scale(1.05);
}

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

.fc-btn.btn-new {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4), inset 0 0 20px rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.fc-btn.btn-fam {
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.4), inset 0 0 20px rgba(234, 179, 8, 0.1);
    color: #fde68a;
}

.fc-btn.btn-mas {
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4), inset 0 0 20px rgba(34, 197, 94, 0.1);
    color: #86efac;
}

.fc-status-dot {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--st-neu);
}

/* --- FOCUS OVERLAY --- */
#fc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#fc-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#fc-overlay .flashcard-wrapper {
    width: 600px;
    height: 400px;
    max-width: 90vw;
    font-size: 1.2rem;
    cursor: default;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#fc-overlay.active .flashcard-wrapper {
    transform: scale(1);
}

/* Larger text in focus mode */
#fc-overlay .fc-a-text {
    font-size: 1.15rem;
    padding-top: 1rem;
    line-height: 1.6;
}

#fc-overlay .fc-a-correct {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

#overlay-close-hint {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

#overlay-close-hint:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}