/* ================== FLASHCARD CSS - GIAO DIỆN TRẺ EM ================== */

/* Màu pastel cho trẻ mầm non */
:root {
    --pastel-mint: #B2DFDB;
    --pastel-pink: #F8BBD0;
    --pastel-yellow: #FFF9C4;
    --pastel-blue: #BBDEFB;
    --pastel-purple: #E1BEE7;
    --pastel-peach: #FFCCBC;
    --pastel-green: #C8E6C9;
    --white: #FFFFFF;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.2);
}

body.flashcard-page {
    font-family: 'Nunito', 'Comic Sans MS', 'Arial Rounded MT Bold', sans-serif;
    background: linear-gradient(135deg, var(--pastel-yellow) 0%, var(--pastel-mint) 100%);
    min-height: 100vh;
    padding: 20px;
}

/* ================== TRANG CHỦ - CHỌN ĐỘ TUỔI ================== */
.age-selection {
    text-align: center;
    padding: 40px 20px;
}

.age-selection h1 {
    font-size: 3rem;
    color: #333;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px var(--shadow);
}

.age-selection .subtitle {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 50px;
}

.age-cards {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.age-card {
    background: var(--white);
    border-radius: 30px;
    padding: 40px 30px;
    width: 300px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px var(--shadow);
    text-decoration: none;
    color: #333;
}

.age-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 40px var(--shadow-dark);
}

.age-card.age-1-3 { background: linear-gradient(135deg, var(--pastel-pink), var(--white)); }
.age-card.age-3-5 { background: linear-gradient(135deg, var(--pastel-blue), var(--white)); }
.age-card.age-5-7 { background: linear-gradient(135deg, var(--pastel-purple), var(--white)); }

.age-card .icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.age-card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.age-card p {
    font-size: 1.1rem;
    color: #666;
}

/* ================== DANH SÁCH BỘ THẺ ================== */
.deck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.deck-card {
    background: var(--white);
    border-radius: 25px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px var(--shadow);
    text-decoration: none;
    color: #333;
}

.deck-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px var(--shadow-dark);
}

.deck-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.deck-card-body {
    padding: 20px;
}

.deck-card-body h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.deck-card-body p {
    color: #666;
    font-size: 1rem;
}

.deck-card-body .card-count {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #999;
}

/* ================== CHI TIẾT BỘ THẺ - CHỌN CHẾ ĐỘ ================== */
.deck-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
}

.deck-header {
    background: var(--white);
    border-radius: 25px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 8px 20px var(--shadow);
    text-align: center;
}

.deck-header img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 20px;
}

.deck-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.deck-header .description {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
}

.mode-selection {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-card {
    background: var(--white);
    border-radius: 25px;
    padding: 30px;
    width: 250px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px var(--shadow);
    text-decoration: none;
    color: #333;
    text-align: center;
}

.mode-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 30px var(--shadow-dark);
}

.mode-card.flash-mode { border: 4px solid var(--pastel-pink); }
.mode-card.quiz-mode { border: 4px solid var(--pastel-blue); }
.mode-card.audio-mode { border: 4px solid var(--pastel-purple); }

.mode-card .icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.mode-card h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.mode-card p {
    font-size: 1rem;
    color: #666;
}

/* ================== FLASHCARD - CHẾ ĐỘ HỌC ================== */
.flashcard-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.flashcard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: var(--white);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 10px var(--shadow);
}

.progress-bar {
    flex: 1;
    height: 20px;
    background: #E0E0E0;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pastel-green), var(--pastel-mint));
    transition: width 0.3s ease;
}

.card-counter {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

/* Thẻ flashcard chính */
.flashcard {
    background: var(--white);
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 15px 40px var(--shadow-dark);
    margin-bottom: 30px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.flashcard img.card-image {
    max-width: 100%;
    max-height: 350px;
    border-radius: 20px;
    margin-bottom: 30px;
    object-fit: contain;
    box-shadow: 0 8px 20px var(--shadow);
}

.flashcard .card-text {
    font-size: 3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.flashcard .card-subtext {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 30px;
}

/* Nút phát âm thanh lớn */
.sound-btn {
    background: linear-gradient(135deg, var(--pastel-pink), var(--pastel-peach));
    border: none;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    font-size: 3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px var(--shadow);
    margin: 20px;
}

.sound-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px var(--shadow-dark);
}

.sound-btn:active {
    transform: scale(0.95);
}

/* Nút điều khiển */
.controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-control {
    padding: 15px 40px;
    font-size: 1.3rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px var(--shadow);
    font-weight: bold;
}

.btn-control:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--shadow-dark);
}

.btn-prev {
    background: linear-gradient(135deg, #E0E0E0, #BDBDBD);
    color: #333;
}

.btn-next {
    background: linear-gradient(135deg, var(--pastel-green), var(--pastel-mint));
    color: #333;
}

.btn-finish {
    background: linear-gradient(135deg, var(--pastel-blue), var(--pastel-purple));
    color: white;
}

/* ================== QUIZ MODE ================== */
.quiz-container {
    max-width: 900px;
    margin: 0 auto;
}

.quiz-question {
    background: var(--white);
    border-radius: 25px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px var(--shadow);
    text-align: center;
}

.quiz-question h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 20px;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.quiz-option {
    background: var(--white);
    border: 4px solid #E0E0E0;
    border-radius: 20px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px var(--shadow);
}

.quiz-option:hover {
    transform: scale(1.05);
    border-color: var(--pastel-blue);
}

.quiz-option img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 15px;
}

.quiz-option p {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
}

.quiz-option.correct {
    border-color: #4CAF50;
    background: linear-gradient(135deg, var(--pastel-green), var(--white));
    animation: bounce 0.5s;
}

.quiz-option.wrong {
    border-color: #F44336;
    background: linear-gradient(135deg, #FFCDD2, var(--white));
    animation: shake 0.5s;
}

/* Score display */
.score-display {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--white);
    padding: 20px 30px;
    border-radius: 20px;
    box-shadow: 0 8px 20px var(--shadow);
    font-size: 1.5rem;
    font-weight: bold;
}

.score-display .stars {
    color: #FFD700;
    font-size: 2rem;
}

/* ================== AUDIO MODE ================== */
.audio-mode-container {
    text-align: center;
}

.audio-player {
    background: linear-gradient(135deg, var(--pastel-purple), var(--white));
    border-radius: 30px;
    padding: 50px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px var(--shadow);
}

.audio-player .icon {
    font-size: 6rem;
    margin-bottom: 20px;
}

.audio-player h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 30px;
}

.btn-replay {
    background: linear-gradient(135deg, var(--pastel-peach), var(--pastel-pink));
    border: none;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    font-size: 3.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px var(--shadow);
}

.btn-replay:hover {
    transform: scale(1.1) rotate(360deg);
}

/* ================== REWARDS SCREEN ================== */
.rewards-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 20px;
}

.rewards-animation {
    font-size: 8rem;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.rewards-container h1 {
    font-size: 3.5rem;
    color: #333;
    margin-bottom: 30px;
}

.rewards-card {
    background: var(--white);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 15px 40px var(--shadow-dark);
    margin-bottom: 30px;
}

.reward-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    margin: 15px 0;
    background: linear-gradient(135deg, var(--pastel-yellow), var(--white));
    border-radius: 15px;
}

.reward-item .icon {
    font-size: 3rem;
}

.reward-item .label {
    font-size: 1.5rem;
    flex: 1;
    text-align: left;
    margin-left: 20px;
}

.reward-item .value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

/* ================== ANIMATIONS ================== */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

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

@keyframes flip {
    0% { transform: rotateY(0); }
    100% { transform: rotateY(180deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* ================== RESPONSIVE ================== */
@media (max-width: 768px) {
    .age-cards {
        flex-direction: column;
        align-items: center;
    }
    
    .deck-grid {
        grid-template-columns: 1fr;
    }
    
    .mode-selection {
        flex-direction: column;
        align-items: center;
    }
    
    .flashcard .card-text {
        font-size: 2rem;
    }
    
    .quiz-options {
        grid-template-columns: 1fr;
    }
}

/* ================== BACK BUTTON ================== */
.btn-back {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--white);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 6px 15px var(--shadow);
    transition: all 0.3s ease;
    z-index: 1000;
}

.btn-back:hover {
    transform: scale(1.1);
}
