/**
 * Kid Theme - Tailored for 6-Year-Old Sri Lankan Grade 1 Students
 * High Contrast, Large Touch Targets, Cheerful Colors & Gentle Animations
 */

.kid-app {
    background: linear-gradient(180deg, #E0F2FE 0%, #FFFBEB 100%);
    min-height: 100vh;
}

/* Mascot Welcome Banner */
.mascot-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #FFFFFF;
    border: 3px solid #FCD34D;
    border-radius: 28px;
    padding: 18px 24px;
    margin: 20px 0;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
    position: relative;
    overflow: hidden;
}

.mascot-avatar {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.mascot-bubble {
    background: #FEF3C7;
    border: 2px solid #F59E0B;
    border-radius: 20px;
    padding: 14px 20px;
    position: relative;
    flex-grow: 1;
}

.mascot-bubble::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 12px 8px 0;
    border-style: solid;
    border-color: transparent #F59E0B transparent transparent;
}

.mascot-speech-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #92400E;
    margin-bottom: 6px;
}

/* Big Audio Repeat Button */
.btn-speaker-voice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #10B981;
    color: #FFFFFF;
    border: none;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: transform 0.2s;
}

.btn-speaker-voice:hover {
    transform: scale(1.05);
    background: #059669;
}

.btn-speaker-voice.playing {
    animation: pulse-ring 1.2s infinite;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 14px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Learning Roadmap / Lesson Grid */
.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.lesson-card {
    background: #FFFFFF;
    border-radius: 24px;
    padding: 20px;
    text-align: center;
    border: 3px solid #E2E8F0;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.lesson-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: #38BDF8;
    box-shadow: 0 14px 28px rgba(56, 189, 248, 0.2);
}

.lesson-card.completed {
    border-color: #10B981;
    background: #F0FDF4;
}

.lesson-card.completed::after {
    content: '⭐ සාර්ථකයි!';
    position: absolute;
    top: 12px;
    right: 12px;
    background: #FDE047;
    color: #854D0E;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 12px;
}

.lesson-number-badge {
    width: 44px;
    height: 44px;
    background: #FF6B4A;
    color: #FFFFFF;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.lesson-title-si {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1E293B;
    margin-bottom: 10px;
}

.btn-play,
.lesson-card .btn-play {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 14px;
    padding: 13px 18px !important;
    font-size: 1.25rem !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
    color: #FFFFFF !important;
    text-decoration: none !important;
    font-weight: 900 !important;
    cursor: pointer;
    border: 2px solid #FDE68A !important;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45) !important;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 52px;
}

.lesson-card .btn-play:hover {
    transform: translateY(-3px) scale(1.03);
    background: linear-gradient(135deg, #D97706 0%, #B45309 100%) !important;
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.6) !important;
    color: #FFFFFF !important;
}

.lesson-card .btn-play:active {
    transform: scale(0.97);
}

/* Interactive Lesson Slides Player */
.player-container {
    background: #FFFFFF;
    border: 3px solid #38BDF8;
    border-radius: 32px;
    padding: 24px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
    margin: 20px auto;
    max-width: 760px;
}

.step-image-wrap {
    text-align: center;
    margin: 20px 0;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-image-wrap img, .step-image-wrap svg {
    max-width: 280px;
    max-height: 240px;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.1));
}

.step-explanation {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1E293B;
    text-align: center;
    margin: 16px 0;
    line-height: 1.6;
}

/* Touch Choice Buttons in Quiz / Interaction */
.quiz-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.choice-btn {
    background: #F8FAFC;
    border: 3px solid #CBD5E1;
    border-radius: 20px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.choice-btn:hover {
    transform: scale(1.05);
    border-color: #38BDF8;
    background: #F0F9FF;
}

.choice-btn.correct {
    border-color: #10B981;
    background: #ECFDF5;
    animation: correct-wobble 0.6s;
}

.choice-btn.wrong {
    border-color: #EF4444;
    background: #FEF2F2;
    animation: wrong-shake 0.5s;
}

@keyframes correct-wobble {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(-3deg); }
    75% { transform: scale(1.1) rotate(3deg); }
}

@keyframes wrong-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* Bottom Lesson Controls */
.player-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 2px dashed #E2E8F0;
}

.btn-nav-step {
    padding: 12px 24px;
    border-radius: 18px;
    font-size: 1.2rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-prev { background: #E2E8F0; color: #475569; }
.btn-next { background: #3B82F6; color: #FFFFFF; }
.btn-finish { background: #10B981; color: #FFFFFF; }

/* Comprehensive Responsive Rules across Small Mobile, Tablets and Large Screens */
@media (max-width: 600px) {
    .mascot-banner {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        border-radius: 20px;
        margin: 12px 0;
    }
    .mascot-avatar {
        width: 60px;
        height: 60px;
    }
    .mascot-bubble {
        padding: 10px 14px;
        border-radius: 16px;
    }
    .mascot-speech-text {
        font-size: 1.05rem;
        margin-bottom: 4px;
    }
    .btn-speaker-voice {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    .lesson-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .lesson-card {
        padding: 18px 14px;
        border-radius: 20px;
    }
    .step-explanation {
        font-size: 1.15rem;
    }
    .player-container {
        padding: 14px;
        border-radius: 20px;
    }
    .player-nav {
        flex-wrap: wrap;
        gap: 10px;
    }
    .btn-nav-step {
        flex: 1 1 calc(50% - 10px);
        font-size: 1.05rem;
        padding: 10px 14px;
        justify-content: center;
    }
}

@media (max-width: 400px) {
    .mascot-banner {
        flex-direction: column;
        text-align: center;
    }
    .mascot-bubble::before {
        display: none;
    }
}

/* Cute Wrong Answer Animations & Danger Badges */
@keyframes cuteWobble {
    0%, 100% { transform: scale(1) rotate(0deg); }
    20% { transform: scale(1.08) rotate(-4deg); }
    40% { transform: scale(1.08) rotate(4deg); }
    60% { transform: scale(1.04) rotate(-2deg); }
    80% { transform: scale(1.04) rotate(2deg); }
}

@keyframes cutePopIn {
    0% { transform: scale(0.65) translateY(-20px); opacity: 0; }
    80% { transform: scale(1.05) translateY(2px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes cuteShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.cute-danger-banner {
    animation: cutePopIn 0.35s ease-out;
    background: #FFF1F2;
    border: 3px solid #F43F5E;
    border-radius: 20px;
    padding: 12px 18px;
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 8px 24px rgba(244, 63, 94, 0.2);
}

/* ========================================================
   DEDICATED 1280x800 TABLET VIEWPORT OPTIMIZATIONS
   Standard 10" WXGA Android Tablets (e.g., Tab A8/A9, Fire HD)
   Viewport height with browser bars is typically 680px - 740px
   ======================================================== */
@media (min-width: 768px) and (max-width: 1366px) and (max-height: 850px) {
    .container {
        max-width: 96% !important;
        padding-top: 6px !important;
        padding-bottom: 20px !important;
    }
    
    .navbar {
        padding: 6px 16px !important;
    }

    .mascot-banner {
        padding: 8px 16px !important;
        margin: 6px 0 12px 0 !important;
        gap: 12px !important;
        border-radius: 18px !important;
    }
    
    .mascot-avatar {
        width: 52px !important;
        height: 52px !important;
    }
    .mascot-avatar img {
        width: 52px !important;
        height: 52px !important;
    }
    
    .mascot-bubble {
        padding: 6px 14px !important;
        border-radius: 14px !important;
    }
    
    .mascot-speech-text {
        font-size: 1.05rem !important;
        margin-bottom: 2px !important;
    }
    
    .btn-speaker-voice {
        font-size: 0.85rem !important;
        padding: 4px 10px !important;
    }

    .player-container {
        padding: 12px 16px !important;
        border-radius: 20px !important;
        min-height: auto !important;
        max-height: calc(100vh - 110px) !important;
        overflow-y: auto !important;
    }

    .step-image-box {
        margin-bottom: 8px !important;
        max-height: 150px !important;
    }
    
    .step-image-box img {
        max-height: 140px !important;
    }

    .step-explanation {
        font-size: 1.15rem !important;
        margin-bottom: 8px !important;
    }

    .choice-btn {
        min-height: 65px !important;
        padding: 8px 12px !important;
        font-size: 1.05rem !important;
    }

    .baskets-grid {
        gap: 12px !important;
        margin-top: 10px !important;
    }

    .basket-card {
        padding: 10px !important;
        min-width: 110px !important;
    }

    .lesson-grid {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important;
        gap: 12px !important;
    }

    .lesson-card {
        padding: 12px 10px !important;
        border-radius: 16px !important;
    }
    
    .lesson-card img {
        max-height: 90px !important;
    }

    .player-nav {
        margin-top: 10px !important;
        padding-top: 8px !important;
    }

    .btn-nav-step {
        padding: 8px 18px !important;
        font-size: 1.05rem !important;
    }
}

