/* Kids-friendly Math Practice Website Styles */

/* Import Comic Sans style font */
@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@300;400;700&display=swap');

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Neue', 'Comic Sans MS', cursive;
    background: linear-gradient(135deg, #FFE5F1 0%, #E5F3FF 50%, #F0FFE5 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Header Styles */
.main-header {
    background: linear-gradient(90deg, #FF6B9D, #4ECDC4, #45B7D1);
    padding: 1rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navigation {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.brand-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    transition: transform 0.3s ease;
}

.brand-link:hover {
    transform: scale(1.05);
}

.brand-icon {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    background: rgba(255,255,255,0.2);
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.5);
}

/* Main Content Styles */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Homepage Styles */
.homepage {
    text-align: center;
}

.welcome-section {
    margin-bottom: 3rem;
}

.welcome-title {
    font-size: 3rem;
    color: #FF6B9D;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    animation: fadeInDown 1s ease-out;
}

.welcome-message {
    font-size: 1.3rem;
    color: #555;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.mascot {
    display: inline-block;
    position: relative;
    margin: 2rem 0;
}

.mascot-face {
    font-size: 4rem;
    animation: float 3s ease-in-out infinite;
}

.speech-bubble {
    background: #4ECDC4;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    margin-top: 1rem;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 300px;
    font-weight: 600;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-bottom-color: #4ECDC4;
}

.section-title {
    font-size: 2.5rem;
    color: #45B7D1;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

/* Grade Selection Buttons */
.grade-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.grade-btn {
    text-decoration: none;
    background: linear-gradient(135deg, #FF6B9D, #FF8E9B);
    color: white;
    padding: 2rem 1rem;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.3);
    border: 3px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.grade-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 107, 157, 0.4);
    border-color: rgba(255,255,255,0.5);
}

.grade-btn.grade-2 { background: linear-gradient(135deg, #FF6B9D, #FF8E9B); }
.grade-btn.grade-3 { background: linear-gradient(135deg, #4ECDC4, #45B7D1); }
.grade-btn.grade-4 { background: linear-gradient(135deg, #96CEB4, #FFEAA7); }
.grade-btn.grade-5 { background: linear-gradient(135deg, #FFEAA7, #FFBE76); }
.grade-btn.grade-6 { background: linear-gradient(135deg, #A29BFE, #6C5CE7); }

.grade-number {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.grade-text {
    font-size: 1.5rem;
    font-weight: 600;
}

.grade-skills {
    font-size: 1rem;
    opacity: 0.9;
    font-style: italic;
}

/* Quick Actions */
.quick-actions {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.action-btn {
    text-decoration: none;
    background: linear-gradient(135deg, #45B7D1, #4ECDC4);
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(69, 183, 209, 0.3);
    border: none;
    cursor: pointer;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(69, 183, 209, 0.4);
}

.encouragement {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
    margin-top: 1rem;
}

/* Quiz Page Styles */
.quiz-page {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #E8F5FF, #FFF5E8);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.quiz-title {
    font-size: 2.5rem;
    color: #45B7D1;
    margin-bottom: 1rem;
}

.quiz-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 1.1rem;
    color: #666;
}

.timer {
    font-weight: 600;
    color: #FF6B9D;
}

.questions-container {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.question-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.question-card:hover {
    border-color: #4ECDC4;
    transform: translateY(-2px);
}

.question-number {
    font-size: 1rem;
    color: #45B7D1;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1rem;
    font-weight: 600;
}

.answer-field {
    width: 100%;
    max-width: 150px;
    padding: 0.8rem;
    font-size: 1.5rem;
    border: 3px solid #E0E0E0;
    border-radius: 10px;
    text-align: center;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s ease;
}

.answer-field:focus {
    outline: none;
    border-color: #4ECDC4;
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
}

.quiz-actions {
    text-align: center;
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.submit-btn {
    background: linear-gradient(135deg, #96CEB4, #FFEAA7);
    color: #333;
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(150, 206, 180, 0.4);
    font-family: inherit;
}

.submit-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(150, 206, 180, 0.5);
}

.back-btn {
    background: linear-gradient(135deg, #DDD, #BBB);
    color: #333;
    padding: 1rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateY(-2px);
}

.encouragement-box {
    text-align: center;
    background: linear-gradient(135deg, #FFE5F1, #E5F3FF);
    padding: 1.5rem;
    border-radius: 15px;
    margin-top: 2rem;
}

.encouragement-text {
    font-size: 1.2rem;
    color: #666;
    font-weight: 600;
}

/* Results Page Styles */
.results-page {
    max-width: 1000px;
    margin: 0 auto;
}

.score-header {
    text-align: center;
    background: linear-gradient(135deg, #FFE5F1, #E5F3FF);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.score-title {
    font-size: 2.5rem;
    color: #FF6B9D;
    margin-bottom: 1rem;
}

.score-circle {
    display: inline-block;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    animation: pulse 2s infinite;
}

.score-circle.score-excellent {
    background: linear-gradient(135deg, #96CEB4, #FFEAA7);
}

.score-circle.score-good {
    background: linear-gradient(135deg, #4ECDC4, #45B7D1);
}

.score-circle.score-needs-practice {
    background: linear-gradient(135deg, #FF6B9D, #FF8E9B);
}

.score-number {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.score-percentage {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.performance-message {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 1rem 0;
    color: #333;
}

.time-taken {
    font-size: 1.1rem;
    color: #666;
    margin-top: 1rem;
}

.answers-review {
    margin-bottom: 2rem;
}

.review-title {
    font-size: 2rem;
    color: #45B7D1;
    text-align: center;
    margin-bottom: 1.5rem;
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.answer-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    border: 3px solid transparent;
}

.answer-card.correct {
    border-color: #96CEB4;
    background: linear-gradient(135deg, #F0FFF0, #E8F5E8);
}

.answer-card.incorrect {
    border-color: #FF8E9B;
    background: linear-gradient(135deg, #FFF0F0, #FFE8E8);
}

.question-num {
    position: absolute;
    top: -10px;
    left: 15px;
    background: #45B7D1;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
}

.question-text {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.answer-comparison {
    margin-bottom: 1rem;
}

.your-answer, .correct-answer {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.answer-value {
    font-weight: 700;
    color: #333;
}

.result-icon {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.retry-btn {
    background: linear-gradient(135deg, #4ECDC4, #45B7D1);
}

.home-btn {
    background: linear-gradient(135deg, #96CEB4, #FFEAA7);
    color: #333;
}

.results-btn {
    background: linear-gradient(135deg, #A29BFE, #6C5CE7);
}

/* My Results Page Styles */
.my-results-page {
    max-width: 1000px;
    margin: 0 auto;
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-title {
    font-size: 2.5rem;
    color: #45B7D1;
    margin-bottom: 0.5rem;
}

.results-subtitle {
    font-size: 1.2rem;
    color: #666;
}

.no-results {
    text-align: center;
    background: linear-gradient(135deg, #FFE5F1, #E5F3FF);
    padding: 3rem;
    border-radius: 20px;
    margin: 2rem 0;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.no-results h2 {
    font-size: 2rem;
    color: #45B7D1;
    margin-bottom: 1rem;
}

.no-results p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

.start-quiz-btn {
    background: linear-gradient(135deg, #FF6B9D, #FF8E9B);
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.start-quiz-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.4);
}

.stats-overview {
    background: linear-gradient(135deg, #F0FFE5, #E5F3FF);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid #4ECDC4;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #45B7D1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: #666;
    font-weight: 600;
}

.progress-message {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-top: 1rem;
}

.grade-breakdown {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.breakdown-title {
    font-size: 2rem;
    color: #45B7D1;
    text-align: center;
    margin-bottom: 1.5rem;
}

.grade-stats {
    display: grid;
    gap: 1rem;
}

.grade-stat-card {
    background: linear-gradient(135deg, #FFE5F1, #E5F3FF);
    padding: 1.5rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.grade-header {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grade-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}

.grade-count {
    font-size: 0.9rem;
    color: #666;
}

.grade-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #45B7D1;
    min-width: 60px;
    text-align: center;
}

.progress-bar {
    flex: 2;
    height: 20px;
    background: rgba(255,255,255,0.5);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #96CEB4, #4ECDC4);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.recent-results {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.recent-title {
    font-size: 2rem;
    color: #45B7D1;
    text-align: center;
    margin-bottom: 1.5rem;
}

.results-list {
    display: grid;
    gap: 1rem;
}

.result-item {
    background: linear-gradient(135deg, #F8F9FA, #E9ECEF);
    padding: 1rem 1.5rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.result-item:hover {
    border-color: #4ECDC4;
    transform: translateY(-2px);
}

.result-rank {
    font-size: 1.2rem;
    font-weight: 700;
    color: #45B7D1;
    min-width: 40px;
}

.result-details {
    flex: 1;
}

.result-grade {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.result-date {
    font-size: 0.9rem;
    color: #666;
}

.result-score {
    text-align: center;
    margin-right: 1rem;
}

.score-fraction {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}

.score-percent {
    font-size: 0.9rem;
    color: #666;
}

.result-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    text-align: center;
    min-width: 80px;
}

.result-badge.excellent {
    background: linear-gradient(135deg, #96CEB4, #FFEAA7);
    color: #333;
}

.result-badge.good {
    background: linear-gradient(135deg, #4ECDC4, #45B7D1);
}

.result-badge.practice {
    background: linear-gradient(135deg, #FF6B9D, #FF8E9B);
}

.actions {
    text-align: center;
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.practice-more-btn {
    background: linear-gradient(135deg, #96CEB4, #FFEAA7);
    color: #333;
}

.clear-btn {
    background: linear-gradient(135deg, #FF8E9B, #FF6B9D);
    color: white;
}

/* Footer Styles */
.main-footer {
    background: linear-gradient(90deg, #45B7D1, #4ECDC4, #96CEB4);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-message {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-icon {
    font-size: 1.5rem;
    margin: 0 0.5rem;
    animation: twinkle 2s infinite;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    background: rgba(255,255,255,0.2);
}

.footer-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.footer-copyright {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Animations */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-10px);
    }
    70% {
        transform: translateY(-5px);
    }
    90% {
        transform: translateY(-3px);
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .welcome-title {
        font-size: 2.5rem;
    }
    
    .grade-buttons {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .grade-btn {
        padding: 1.5rem 0.5rem;
    }
    
    .grade-number {
        font-size: 2.5rem;
    }
    
    .navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        justify-content: center;
    }
    
    .quiz-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .answers-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .grade-stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .result-item {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .welcome-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .grade-buttons {
        grid-template-columns: 1fr;
    }
    
    .quiz-title {
        font-size: 2rem;
    }
    
    .question-text {
        font-size: 1.5rem;
    }
    
    .answer-field {
        font-size: 1.3rem;
    }
}
