/*
 * Utility classes for the shared quiz + flashcard engines
 * (js/shared/quiz-engine.js, js/shared/flashcard-engine.js).
 *
 * Single source for both apps: Studio and Notebook each link this file.
 * These rules used to live in studio/style.css; nothing outside the two engines
 * ever referenced them, so they moved here rather than being duplicated.
 */

/* ── Flashcard 3D flip ──────────────────────────────────────────────── */
.perspective-1000 {
    perspective: 1000px;
}

.transform-style-3d {
    transform-style: preserve-3d;
}

.backface-hidden {
    backface-visibility: hidden;
}

.rotate-y-180 {
    transform: rotateY(180deg);
}

/* ── Flashcard slide transitions ────────────────────────────────────── */
@keyframes slideInRight {
    from {
        transform: translateX(100%) rotate(15deg);
        opacity: 0;
    }

    to {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }

    to {
        transform: translateX(-100%) rotate(-15deg);
        opacity: 0;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%) rotate(-15deg);
        opacity: 0;
    }

    to {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }

    to {
        transform: translateX(100%) rotate(15deg);
        opacity: 0;
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.1s ease-out forwards;
}

.animate-slide-out-left {
    animation: slideOutLeft 0.1s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.1s ease-out forwards;
}

.animate-slide-out-right {
    animation: slideOutRight 0.1s ease-out forwards;
}

/* ── Quiz option buttons ────────────────────────────────────────────── */
.quiz-opt-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #FAF8F5;
}

.dark .quiz-opt-btn {
    background-color: #232020;
}

.quiz-opt-btn:not(:disabled):hover {
    background-color: #E0E3E7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark .quiz-opt-btn:not(:disabled):hover {
    background-color: #2E2F2F;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.quiz-opt-btn:not(:disabled):active {
    transform: translateY(0);
}

/* Answered-state borders come from the engine's own utility classes, not from
   here — the old .quiz-opt-correct / .quiz-opt-incorrect rules were never
   applied by any code path and were dropped with the move out of studio/style.css. */

@media (prefers-reduced-motion: reduce) {

    .quiz-opt-btn,
    .animate-slide-in-right,
    .animate-slide-out-left,
    .animate-slide-in-left,
    .animate-slide-out-right {
        animation: none !important;
        transition: none !important;
    }
}
