/* WP Flashcards Frontend Styles */
:root {
    --wpfc-primary: #6366f1;
    --wpfc-primary-dark: #4f46e5;
    --wpfc-secondary: #8b5cf6;
    --wpfc-success: #10b981;
    --wpfc-warning: #f59e0b;
    --wpfc-danger: #ef4444;
    --wpfc-dark: #1f2937;
    --wpfc-gray: #6b7280;
    --wpfc-light: #f3f4f6;
    --wpfc-white: #ffffff;
    --wpfc-border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

/* Deck Container */
.wpfc-deck-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wpfc-deck-header {
    text-align: center;
    margin-bottom: 30px;
}

.wpfc-deck-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--wpfc-dark);
    margin-bottom: 10px;
}

.wpfc-deck-header p {
    color: var(--wpfc-gray);
    font-size: 16px;
}

/* Progress Bar */
.wpfc-progress-wrapper {
    margin-bottom: 30px;
}

.wpfc-progress-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--wpfc-gray);
}

.wpfc-progress-bar {
    height: 8px;
    background: var(--wpfc-light);
    border-radius: 10px;
    overflow: hidden;
}

.wpfc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--wpfc-primary), var(--wpfc-secondary));
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Flashcard */
.wpfc-flashcard-wrapper {
    perspective: 1000px;
    margin-bottom: 30px;
}

.wpfc-flashcard {
    position: relative;
    width: 100%;
    min-height: 350px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.wpfc-flashcard.flipped {
    transform: rotateY(180deg);
}

.wpfc-flashcard.flipped-vertical {
    transform: rotateX(180deg);
}

.wpfc-flashcard-front,
.wpfc-flashcard-back {
    position: absolute;
    width: 100%;
    min-height: 350px;
    backface-visibility: hidden;
    border-radius: 20px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.wpfc-flashcard-front {
    background: linear-gradient(135deg, var(--wpfc-white), var(--wpfc-light));
    border: 2px solid var(--wpfc-border);
}

.wpfc-flashcard-back {
    background: linear-gradient(135deg, var(--wpfc-primary), var(--wpfc-secondary));
    color: white;
    transform: rotateY(180deg);
}

.wpfc-flashcard.flipped-vertical .wpfc-flashcard-back {
    transform: rotateX(180deg);
}

.wpfc-flashcard-content {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.5;
    max-width: 100%;
    word-wrap: break-word;
}

.wpfc-flashcard-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 12px;
    margin-bottom: 20px;
    object-fit: contain;
}

.wpfc-flashcard-hint {
    position: absolute;
    bottom: 20px;
    font-size: 14px;
    color: var(--wpfc-gray);
    opacity: 0.7;
}

.wpfc-flashcard-back .wpfc-flashcard-hint {
    color: rgba(255, 255, 255, 0.7);
}

/* Controls */
.wpfc-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 30px;
}

.wpfc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.wpfc-btn-wrong {
    background: rgba(239, 68, 68, 0.1);
    color: var(--wpfc-danger);
}

.wpfc-btn-wrong:hover {
    background: var(--wpfc-danger);
    color: white;
    transform: translateY(-2px);
}

.wpfc-btn-hard {
    background: rgba(245, 158, 11, 0.1);
    color: var(--wpfc-warning);
}

.wpfc-btn-hard:hover {
    background: var(--wpfc-warning);
    color: white;
    transform: translateY(-2px);
}

.wpfc-btn-good {
    background: rgba(16, 185, 129, 0.1);
    color: var(--wpfc-success);
}

.wpfc-btn-good:hover {
    background: var(--wpfc-success);
    color: white;
    transform: translateY(-2px);
}

.wpfc-btn-easy {
    background: rgba(99, 102, 241, 0.1);
    color: var(--wpfc-primary);
}

.wpfc-btn-easy:hover {
    background: var(--wpfc-primary);
    color: white;
    transform: translateY(-2px);
}

.wpfc-btn-primary {
    background: var(--wpfc-primary);
    color: white;
}

.wpfc-btn-primary:hover {
    background: var(--wpfc-primary-dark);
    transform: translateY(-2px);
}

.wpfc-btn-secondary {
    background: var(--wpfc-light);
    color: var(--wpfc-dark);
}

.wpfc-btn-secondary:hover {
    background: var(--wpfc-border);
}

/* Navigation */
.wpfc-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpfc-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--wpfc-white);
    border: 2px solid var(--wpfc-border);
    border-radius: 10px;
    color: var(--wpfc-dark);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.wpfc-nav-btn:hover {
    border-color: var(--wpfc-primary);
    color: var(--wpfc-primary);
}

.wpfc-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wpfc-card-counter {
    font-size: 18px;
    font-weight: 700;
    color: var(--wpfc-dark);
}

.wpfc-card-counter span {
    color: var(--wpfc-gray);
    font-weight: 400;
}

/* Completion Screen */
.wpfc-complete {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--wpfc-white), var(--wpfc-light));
    border-radius: 20px;
    border: 2px solid var(--wpfc-border);
}

.wpfc-complete-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.wpfc-complete h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--wpfc-dark);
    margin-bottom: 10px;
}

.wpfc-complete p {
    font-size: 18px;
    color: var(--wpfc-gray);
    margin-bottom: 30px;
}

.wpfc-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.wpfc-stat {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.wpfc-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--wpfc-primary);
}

.wpfc-stat-label {
    font-size: 14px;
    color: var(--wpfc-gray);
}

/* Single Card */
.wpfc-single-card {
    max-width: 500px;
    margin: 20px auto;
}

/* Mode Selector */
.wpfc-mode-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}

.wpfc-mode-btn {
    padding: 10px 20px;
    background: var(--wpfc-light);
    border: 2px solid var(--wpfc-border);
    border-radius: 8px;
    font-weight: 600;
    color: var(--wpfc-gray);
    cursor: pointer;
    transition: all 0.2s;
}

.wpfc-mode-btn:hover,
.wpfc-mode-btn.active {
    border-color: var(--wpfc-primary);
    background: rgba(99, 102, 241, 0.1);
    color: var(--wpfc-primary);
}

/* Error */
.wpfc-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--wpfc-danger);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
}

/* Keyboard hint */
.wpfc-keyboard-hint {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--wpfc-gray);
}

.wpfc-keyboard-hint kbd {
    display: inline-block;
    padding: 4px 8px;
    background: var(--wpfc-light);
    border: 1px solid var(--wpfc-border);
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

/* Animations */
@keyframes cardEnter {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.wpfc-flashcard-wrapper {
    animation: cardEnter 0.3s ease;
}

/* Shuffle animation */
.wpfc-shuffling .wpfc-flashcard {
    animation: shuffle 0.5s ease;
}

@keyframes shuffle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-3deg);
    }

    75% {
        transform: rotate(3deg);
    }
}

/* Responsive */
@media (max-width: 600px) {

    .wpfc-flashcard-front,
    .wpfc-flashcard-back {
        min-height: 280px;
        padding: 30px 20px;
    }

    .wpfc-flashcard-content {
        font-size: 20px;
    }

    .wpfc-controls {
        flex-wrap: wrap;
    }

    .wpfc-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .wpfc-stats-grid {
        grid-template-columns: 1fr;
    }
}