/**
 * Flashcard Stack Block - Académie des Étoiles
 * Single-card stack with navigation for memory drills
 */

.ade-flashcard-stack {
    /* Removed bulky white wrapper - clean minimal style */

    margin: var(--ade-space-xl) 0;
}

/* Optional title */
.ade-flashcard-stack__title {
    font-size: var(--ade-font-size-medium);
    font-weight: 700;
    color: var(--ade-gray-dark);
    margin: 0 0 var(--ade-space-xl) 0;
    text-align: center;
}

/* Container */
.ade-flashcard-stack__container {
    display: flex;
    flex-direction: column;
    gap: var(--ade-space-xl);
}

/* Card wrapper */
.ade-flashcard-stack__card-wrapper {
    perspective: 1000px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card */
.ade-flashcard-stack__card {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 300px;
    text-align: center;
    transition: transform var(--ade-transition-slow) !important;
    transform-style: preserve-3d;
    cursor: pointer;
    border: none;
    padding: 0;
    background: transparent;
    display: block;
}

.ade-flashcard-stack__card:focus {
    outline: 3px solid var(--ade-primary);
    outline-offset: 4px;
    border-radius: 16px;
}

/* Flipped state */
.ade-flashcard-stack__card[aria-expanded="true"] {
    transform: rotateY(180deg);
}

/* Card faces */
.ade-flashcard-stack__card-front,
.ade-flashcard-stack__card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    padding: var(--ade-space-2xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

/* Front face */
.ade-flashcard-stack__card-front {
    background: linear-gradient(135deg, var(--ade-primary) 0%, var(--ade-primary-dark) 100%);
    color: var(--ade-white);
}

.ade-flashcard-stack__card-front .ade-flashcard-stack__card-content {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--ade-space-lg);
    line-height: 1.4;
}

.ade-flashcard-stack__flip-hint {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
}

/* Back face */
.ade-flashcard-stack__card-back {
    background: var(--ade-white);
    color: var(--ade-gray-dark);
    border: 3px solid var(--ade-primary);
    transform: rotateY(180deg);
}

.ade-flashcard-stack__card-back .ade-flashcard-stack__card-content {
    font-size: 18px;
    line-height: 1.7;
}

/* Navigation */
.ade-flashcard-stack__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ade-space-md);
}

.ade-flashcard-stack__nav-button {
    display: flex;
    align-items: center;
    gap: var(--ade-space-xs);
    padding: var(--ade-space-sm) var(--ade-space-lg);
    background: var(--ade-primary);
    color: var(--ade-white);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ade-transition-fast);
}

.ade-flashcard-stack__nav-button:hover:not(:disabled) {
    background: var(--ade-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(155, 81, 224, 0.3);
}

.ade-flashcard-stack__nav-button:focus {
    outline: 2px solid var(--ade-primary);
    outline-offset: 2px;
}

.ade-flashcard-stack__nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ade-flashcard-stack__nav-button svg {
    flex-shrink: 0;
}

/* Progress indicator */
.ade-flashcard-stack__progress {
    font-size: 18px;
    font-weight: 600;
    color: var(--ade-gray-dark);
    padding: var(--ade-space-sm) var(--ade-space-lg);
    background: linear-gradient(135deg, rgba(155, 81, 224, 0.05) 0%, rgba(202, 179, 255, 0.08) 100%);
    border-radius: 8px;
}

.ade-flashcard-stack__current {
    color: var(--ade-primary);
    font-size: 20px;
}

/* Hidden data */
.ade-flashcard-stack__data {
    display: none;
}

/* Responsive - tablet */
@media screen and (max-width: 768px) {
    .ade-flashcard-stack {
        padding: var(--ade-space-lg);
    }

    .ade-flashcard-stack__card-wrapper {
        height: 250px;
    }

    .ade-flashcard-stack__card {
        height: 250px;
    }

    .ade-flashcard-stack__card-front,
    .ade-flashcard-stack__card-back {
        padding: var(--ade-space-xl);
    }

    .ade-flashcard-stack__card-front .ade-flashcard-stack__card-content {
        font-size: 20px;
    }

    .ade-flashcard-stack__card-back .ade-flashcard-stack__card-content {
        font-size: 16px;
    }
}

/* Responsive - mobile */
@media screen and (max-width: 480px) {
    .ade-flashcard-stack {
        padding: var(--ade-space-md);
    }

    .ade-flashcard-stack__title {
        font-size: 18px;
    }

    .ade-flashcard-stack__card-wrapper {
        height: 220px;
    }

    .ade-flashcard-stack__card {
        height: 220px;
    }

    .ade-flashcard-stack__card-front,
    .ade-flashcard-stack__card-back {
        padding: var(--ade-space-lg);
    }

    .ade-flashcard-stack__card-front .ade-flashcard-stack__card-content {
        font-size: 18px;
    }

    .ade-flashcard-stack__card-back .ade-flashcard-stack__card-content {
        font-size: 15px;
    }

    .ade-flashcard-stack__nav {
        flex-direction: column;
    }

    .ade-flashcard-stack__nav-button {
        width: 100%;
        justify-content: center;
    }

    .ade-flashcard-stack__progress {
        order: -1;
        width: 100%;
        text-align: center;
    }
}

/* Print */
@media print {
    .ade-flashcard-stack {
        box-shadow: none;
        border: 1px solid var(--ade-gray);
    }

    .ade-flashcard-stack__card {
        transform: none !important;
    }

    .ade-flashcard-stack__card-front,
    .ade-flashcard-stack__card-back {
        position: relative;
        backface-visibility: visible;
        page-break-inside: avoid;
        margin-bottom: var(--ade-space-md);
    }

    .ade-flashcard-stack__card-front {
        background: transparent;
        color: var(--ade-gray-dark);
        border: 3px solid var(--ade-primary);
    }

    .ade-flashcard-stack__card-back {
        transform: none;
    }

    .ade-flashcard-stack__flip-hint {
        display: none;
    }

    .ade-flashcard-stack__nav {
        display: none;
    }
}
