:root {
    --swiper-navigation-size: 20px;
}

/* Flashcards Swiper UI (namespaced) */
.kq-flashcards {
    margin: 20px 0;
}

.kq-flashcards .swiper.kq-flashcards-swiper {
    display: flex;
    width: 100%;
    min-height: 400px;
}

/* Keep each card a reasonable max-width (centered) */
.kq-flashcards .swiper-slide {
    display: flex;
    justify-content: center;
}

.kq-flashcards .kq-card-container {
    perspective: 1000px;
    position: relative;
    width: 100%;
    max-width: 400px;
}

.kq-flashcards .kq-card-flip {
    width: 100%;
    height: 300px;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    position: relative;
}

.kq-flashcards .kq-card-side {
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    box-shadow: 1px 1px 16px 1px #000;
    position: absolute;
    top: 0;
    left: 0;
    color: #fff;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(rgb(0 0 0 / 75%), rgb(0 0 0 / 75%));
}

.kq-flashcards .kq-card-side.kq-front {
    z-index: 2;
}

.kq-flashcards .kq-card-side.kq-back {
    transform: rotateY(180deg);
}

.kq-flashcards .kq-card-container.kq-flipped .kq-card-flip {
    transform: rotateY(180deg);
}

.kq-flashcards .kq-card-header {
    border: none;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
}

.kq-flashcards .kq-card-header img {
    max-height: 28px;
    width: auto;
}

.kq-flashcards .kq-card-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100% - 96px);
    padding: 0 16px;
    text-align: center;
}

.kq-flashcards .kq-card-title {
    font-size: clamp(28px, 7vw, 42px);
    line-height: 1.1;
    margin: 0;
    color: #fff;
}

.kq-flashcards .kq-card-footer {
    padding: 0;
}

.kq-flashcards .kq-flip-button {
    width: 100%;
    background: #000;
    color: #fff;
    height: 44px;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.kq-flashcards .kq-hint-button {
    background: transparent;
    color: #fff;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 600;
}

/* Toolbar */
.kq-flashcards-toolbar {
    display: flex;
    width: 100%;
    justify-content: space-evenly;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    align-items: center;
}

.kq-flashcards-toolbar .kq-swiper-navigate {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.kq-flashcards-toolbar .kq-swiper-fraction {
    font-size: 18px;
    text-align: center;
    color: #000;
    min-width: 60px;
}

.kq-flashcards .swiper-button-next,
.kq-flashcards .swiper-button-prev {
    border: 2px solid #bebfbf;
    color: #586380;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    padding: 0 7px;
    align-items: center;
    justify-content: center;
    position: static;
    margin: 0;
}

.kq-flashcards .kq-swiper-btn {
    align-items: center;
    border: .125rem solid #d9dde8;
    border-radius: .5rem;
    box-sizing: border-box;
    cursor: pointer;
    display: inline-flex;
    height: 40px;
    padding: 6px 14px;
    justify-content: center;
    gap: 8px;
    transition: all .12s cubic-bezier(.47,0,.745,.715);
    background: transparent;
    color: #586380;
    user-select: none;
}

.kq-flashcards .kq-swiper-btn.kq-active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.kq-flashcards .kq-swiper-btn svg {
    width: 15px;
    height: 15px;
}

/* Progressbar spacing */
.kq-flashcards .swiper-pagination-progressbar {
    margin-top: 15px !important;
}

/* Print adjustments: keep existing `quiz.css` print rules; just hide our swiper UI too */
@media print {
    .kq-flashcards,
    .kq-flashcards-toolbar {
        display: none !important;
    }
}
