/*
 * Flashcard deck player styles.
 * Rendered by renderFlashcardDeck in js/interactive.js. Used both embedded
 * on lesson pages (flashcard-deck TypeCode on Learning_Interactive) and on
 * the standalone /flashcards/due · /flashcards/lesson/{id} pages.
 */

.flashcard-deck {
    display: block;
    margin: 24px 0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: #111827;
}

.flashcard-deck__card {
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    background: #eef2ff;
    padding: 20px 22px;
}

.flashcard-deck__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.flashcard-deck__title {
    font-size: 15px;
    font-weight: 600;
    color: #312e81;
}

.flashcard-deck__meta {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.flashcard-deck__chip {
    background: #fff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 500;
}

.flashcard-deck__chip--muted {
    color: #6b7280;
    border-color: #e5e7eb;
    background: #f9fafb;
}

.flashcard-deck__face {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 22px 24px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    font-size: 17px;
    line-height: 1.55;
}

.flashcard-deck__face--back {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.flashcard-deck__hint {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.flashcard-deck__face-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flashcard-deck__face-body > * {
    max-width: 100%;
}

.flashcard-deck__source {
    display: inline-block;
    margin-top: 12px;
    font-size: 12px;
    color: #4338ca;
    text-decoration: none;
    border-bottom: 1px dashed #c7d2fe;
}

.flashcard-deck__source:hover {
    color: #312e81;
}

.flashcard-deck__nav {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.flashcard-deck__btn {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    min-width: 84px;
    transition: background 0.12s, border-color 0.12s;
}

.flashcard-deck__btn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

.flashcard-deck__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.flashcard-deck__btn--primary {
    background: #4338ca;
    color: #fff;
    border-color: #4338ca;
}
.flashcard-deck__btn--primary:hover:not(:disabled) {
    background: #3730a3;
    border-color: #3730a3;
}

.flashcard-deck__btn--again { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.flashcard-deck__btn--hard  { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.flashcard-deck__btn--good  { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.flashcard-deck__btn--easy  { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }

.flashcard-deck__summary {
    padding: 18px;
    text-align: center;
}

.flashcard-deck__summary-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #312e81;
}

.flashcard-deck__empty {
    padding: 28px 16px;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* Image-occlusion cards — front/back share the same img, boxes swap between
   opaque (front) and revealed (back with text label). Container is
   position:relative so the box overlay absolute-positions from image-native
   pixel origin. Author sizes the image to match the box coordinates. */
.flashcard-deck__io {
    position: relative;
    display: inline-block;
}

.flashcard-deck__io img {
    display: block;
    max-width: 100%;
    height: auto;
}

.flashcard-deck__io-box {
    position: absolute;
    background: #312e81;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.flashcard-deck__io-box--revealed {
    background: #fef9c3;
    color: #713f12;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 6px;
    line-height: 1.15;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Audio-recite: give the front a slightly warmer tint so the "say it out
   loud" gesture reads as distinct from a silent recall card. */
.flashcard-deck__face--audio-recite.flashcard-deck__face--front {
    background: #fff7ed;
    border-color: #fed7aa;
}

/* Standalone /flashcards/{...} page wrapper */
.flashcards-page {
    max-width: 720px;
    margin: 32px auto;
    padding: 0 16px;
}

.flashcards-page__title {
    font-size: 24px;
    margin: 0 0 8px 0;
    color: #111827;
}

.flashcards-page__blurb {
    color: #6b7280;
    margin: 0 0 20px 0;
    font-size: 14px;
}

.flashcards-page__host {
    display: block;
}

/* Dashboard "Due today" card */
.dash-card--flashcards .dash-card__pill--due {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
}

.dash-item--cta {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: #312e81;
}

.dash-item--cta:hover {
    background: #e0e7ff;
}
