/* Flashcard Container */
.if-resource-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
}

.if-flashcard-app {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Header */
.if-flashcard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: #6c757d;
    font-weight: 600;
}

.if-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.if-btn-icon:hover {
    color: #0d6efd;
}

/* Stage & Card */
.if-flashcard-stage {
    perspective: 1000px;
    height: 400px;
    margin-bottom: 20px;
    cursor: pointer;
}

.if-flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

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

.if-card-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.if-card-front, .if-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.if-btn-audio {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
    padding: 10px;
}

.if-btn-audio:hover {
    color: #2563eb;
    transform: scale(1.1);
}

.if-card-back {
    transform: rotateY(180deg);
    background: #f0f9ff; /* Light blue tint for back */
    border-color: #bae6fd;
}

.if-card-content {
    font-size: 2rem;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.4;
}

.if-card-hint {
    position: absolute;
    bottom: 20px;
    font-size: 0.875rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Controls */
.if-flashcard-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.if-btn {
    padding: 10px 24px;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.if-btn-primary {
    background: #2563eb;
    color: white;
}

.if-btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.if-btn-secondary {
    background: white;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.if-btn-secondary:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Quiz Styles */
.if-quiz-question {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
    color: #1f2937;
}

.if-quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.if-quiz-option {
    padding: 1.5rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.if-quiz-option:hover:not(:disabled) {
    border-color: #2563eb;
    background: #eff6ff;
}

.if-quiz-option.correct {
    background: #dcfce7;
    border-color: #22c55e;
    color: #15803d;
}

.if-quiz-option.wrong {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
}

.if-quiz-results {
    text-align: center;
    padding: 2rem;
}

.if-final-score {
    font-size: 3rem;
    font-weight: 700;
    color: #2563eb;
    margin: 1rem 0 2rem;
}

/* Match Game Styles */
.if-match-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.if-match-card {
    aspect-ratio: 1;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
    user-select: none;
}

.if-match-card:hover {
    border-color: #9ca3af;
}

.if-match-card.selected {
    border-color: #2563eb;
    background: #eff6ff;
    transform: scale(1.05);
}

.if-match-card.matched {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.if-match-card.wrong {
    border-color: #ef4444;
    background: #fee2e2;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive */
@media (max-width: 640px) {
    .if-flashcard-stage {
        height: 300px;
    }
    .if-card-content {
        font-size: 1.5rem;
    }
    .if-quiz-options {
        grid-template-columns: 1fr;
    }
    .if-match-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
