/* ── Loading progress ────────────────────────────────── */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto;
    opacity: 0.4;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ── Blazor error UI ─────────────────────────────────── */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ── App shell ───────────────────────────────────────── */
body {
    background: #f0f2f5;
    min-height: 100vh;
}

main {
    padding: 0;
}

/* ── Flashcard app container ─────────────────────────── */
.fc-app {
    max-width: 600px;
    margin: 2rem auto;
    padding: 1rem 1.25rem;
    outline: none;
}

.fc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.fc-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: #212529;
}

.fc-counter {
    font-size: 0.875rem;
    color: #6c757d;
    background: #e9ecef;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    white-space: nowrap;
}

/* ── Exam type tabs ──────────────────────────────────── */
.fc-exam-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.fc-exam-tab {
    flex: 1;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    background: #ffffff;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.fc-exam-tab:hover {
    border-color: #0d6efd;
    color: #0d6efd;
    background: #f0f5ff;
}

.fc-exam-tab.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
}

.fc-exam-tab.active .fc-pill-count {
    background: rgba(255,255,255,0.25);
    color: #ffffff;
}

/* ── Category pill filters ───────────────────────────── */
.fc-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
}

.fc-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1.5px solid #dee2e6;
    background: #ffffff;
    color: #495057;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    line-height: 1.4;
}

.fc-pill:hover {
    border-color: #0d6efd;
    color: #0d6efd;
    background: #f0f5ff;
}

.fc-pill.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
}

.fc-pill.active .fc-pill-count {
    background: rgba(255,255,255,0.25);
    color: #ffffff;
}

.fc-pill-count {
    font-size: 0.7rem;
    background: #e9ecef;
    color: #6c757d;
    border-radius: 999px;
    padding: 0.05rem 0.4rem;
    font-weight: 600;
}

/* ── Flip card ───────────────────────────────────────── */
.fc-card {
    perspective: 1200px;
    height: 280px;
    cursor: pointer;
    margin-bottom: 1.5rem;
    user-select: none;
}

.fc-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.fc-card.flipped .fc-inner {
    transform: rotateY(180deg);
}

.fc-front,
.fc-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}

.fc-front {
    background: #ffffff;
    border: 2px solid #dee2e6;
}

.fc-back {
    background: #f8f9ff;
    border: 2px solid #0d6efd;
    transform: rotateY(180deg);
}

.fc-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6c757d;
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.fc-word {
    font-size: 2.4rem;
    font-weight: 700;
    color: #212529;
    text-align: center;
    line-height: 1.2;
}

.fc-hint {
    font-size: 0.72rem;
    color: #adb5bd;
    margin-top: 1.25rem;
}

.fc-word-en {
    font-size: 2rem;
    font-weight: 600;
    color: #0d6efd;
    text-align: center;
    line-height: 1.2;
}

.fc-dutch-small {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.85rem;
    font-style: italic;
}

/* ── Controls ────────────────────────────────────────── */
.fc-controls {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* ── Progress bar ────────────────────────────────────── */
.fc-progress {
    height: 6px;
    background: #dee2e6;
    border-radius: 3px;
    overflow: hidden;
}

.fc-progress-bar {
    height: 100%;
    background: #0d6efd;
    border-radius: 3px;
    transition: width 0.25s ease;
}

/* ── Speak button ───────────────────────────────────── */
.fc-speak-btn {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 1.5px solid #dee2e6;
    background: rgba(255,255,255,0.85);
    color: #6c757d;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    z-index: 1;
}

.fc-speak-btn:hover {
    background: #f0f5ff;
    border-color: #0d6efd;
    color: #0d6efd;
}

.fc-back .fc-speak-btn {
    right: auto;
    left: 0.75rem;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 480px) {
    .fc-app {
        margin: 0.75rem auto;
        padding: 0.75rem;
    }

    .fc-word {
        font-size: 1.9rem;
    }

    .fc-word-en {
        font-size: 1.6rem;
    }

    .fc-card {
        height: 240px;
    }
}
