* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1100px;
    width: 100%;
    position: relative;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 25px;
    font-size: 32px;
}

.story-box {
    background: #fff3e0;
    border-left: 5px solid #ff9800;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.story-box p {
    color: #555;
    line-height: 1.8;
    font-size: 16px;
    margin-bottom: 10px;
}

.story-box ul {
    margin: 15px 0;
    padding-left: 30px;
}

.story-box li {
    color: #555;
    line-height: 1.8;
    font-size: 16px;
    margin-bottom: 8px;
}

.story-box .question {
    color: #e65100;
    font-weight: bold;
    font-size: 17px;
    margin-top: 15px;
}

/* Reading Scene */
.reading-scene {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.scene-image {
    text-align: center;
    margin-bottom: 25px;
}

.reading-image {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border: 5px solid white;
    max-height: 400px;
    object-fit: cover;
}

.kenyan-setting {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.classroom-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: linear-gradient(135deg, #2d3436 0%, #000000 50%, #006400 50%, #228B22 100%);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.flag {
    font-size: 40px;
    animation: wave-flag 3s ease-in-out infinite;
}

@keyframes wave-flag {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.school-name {
    font-size: 22px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.student-reading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.student-character {
    text-align: center;
}

.student-avatar {
    font-size: 100px;
    animation: reading-bob 2s ease-in-out infinite;
}

@keyframes reading-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.student-name {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-top: 10px;
    background: #4caf50;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
}

.book-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.book-cover {
    display: flex;
    perspective: 1000px;
}

.book-spine {
    width: 30px;
    background: linear-gradient(to bottom, #8b4513 0%, #654321 100%);
    border-radius: 5px 0 0 5px;
    box-shadow: -3px 0 10px rgba(0, 0, 0, 0.3);
}

.book-front {
    background: linear-gradient(135deg, #d35400 0%, #e67e22 100%);
    width: 220px;
    height: 300px;
    border-radius: 0 10px 10px 0;
    padding: 20px;
    box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    border: 3px solid #c0392b;
    position: relative;
}

.book-front::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
}

.book-title {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.page-count {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 10px;
    z-index: 1;
}

.book-illustration {
    font-size: 60px;
    z-index: 1;
}

.reading-progress {
    width: 100%;
    max-width: 600px;
}

.progress-bar {
    display: flex;
    width: 100%;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.progress-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    border-right: 3px solid white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.progress-segment:last-child {
    border-right: none;
}

.progress-segment.day1 {
    width: 20%;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.progress-segment.day2 {
    width: 24%;
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.progress-segment.remaining {
    width: 56%;
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.progress-segment:hover {
    transform: scaleY(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.segment-label {
    line-height: 1.4;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: bold;
    color: #555;
    padding: 0 5px;
}

.desk-items {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 15px;
}

.item {
    font-size: 40px;
    animation: float-item 3s ease-in-out infinite;
}

.item:nth-child(2) { animation-delay: 0.5s; }
.item:nth-child(3) { animation-delay: 1s; }

@keyframes float-item {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Solution Steps */
.solution-steps {
    background: #e8f5e9;
    padding: 25px;
    border-radius: 15px;
    margin: 30px 0;
    border-left: 5px solid #4caf50;
}

.solution-steps h3 {
    color: #2e7d32;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.step {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.step:last-child {
    margin-bottom: 0;
    border: 3px solid #4caf50;
}

.step-number {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.calculation {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 8px;
    font-size: 16px;
    color: #555;
    margin-top: 5px;
    font-family: 'Courier New', monospace;
}

.calculation.alternative {
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    margin-top: 10px;
}

.highlight {
    background: #ffeb3b;
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: bold;
    color: #e65100;
    font-size: 18px;
}

/* Visual Breakdown */
.visual-breakdown {
    background: #e3f2fd;
    padding: 25px;
    border-radius: 15px;
    margin: 30px 0;
}

.visual-breakdown h3 {
    color: #1565c0;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.breakdown-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.breakdown-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 3px solid transparent;
}

.breakdown-card:hover {
    transform: translateY(-5px);
}

.day1-card {
    border-color: #3498db;
}

.remaining-card {
    border-color: #9b59b6;
}

.day2-card {
    border-color: #e67e22;
}

.final-card {
    border-color: #4caf50;
    background: linear-gradient(135deg, #f1f8e9 0%, #dcedc8 100%);
}

.card-icon {
    font-size: 50px;
    margin-bottom: 10px;
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.card-fraction {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
}

.card-value {
    font-size: 20px;
    font-weight: bold;
    color: #e65100;
}

/* Answer Section */
.answer-section {
    margin: 30px 0;
    text-align: center;
}

.answer-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
}

.instruction {
    color: #555;
    font-size: 16px;
    margin-bottom: 20px;
    font-weight: bold;
}

.input-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

#answerInput {
    width: 250px;
    padding: 15px 20px;
    font-size: 24px;
    font-weight: bold;
    border: 3px solid #2196f3;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

#answerInput:focus {
    outline: none;
    border-color: #1565c0;
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.4);
    transform: scale(1.05);
}

#answerInput.correct {
    border-color: #4caf50;
    background: #e8f5e9;
}

#answerInput.incorrect {
    animation: shake-input 0.5s ease;
}

@keyframes shake-input {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.unit-label {
    font-size: 20px;
    font-weight: bold;
    color: #555;
}

/* Buttons */
.button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0 20px 0;
}

button {
    background: #4caf50;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background: #388e3c;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

button:active {
    transform: translateY(0);
}

.feedback {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    min-height: 30px;
    margin: 20px 0;
}

.feedback.success {
    color: #4caf50;
}

.feedback.error {
    color: #f44336;
}

.feedback.warning {
    color: #ff9800;
}

.info-box {
    background: #fff3e0;
    border-left: 5px solid #ff9800;
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
}

.info-box h3 {
    color: #e65100;
    margin-bottom: 10px;
    font-size: 18px;
}

.info-box p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 10px;
}

.info-box ol {
    margin: 10px 0;
    padding-left: 25px;
}

.info-box li {
    color: #555;
    line-height: 1.8;
    margin-bottom: 8px;
}

.final-answer-display {
    background: #c8e6c9;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-top: 15px;
}

.final-answer {
    background: #4caf50;
    padding: 5px 15px;
    border-radius: 8px;
    font-weight: bold;
    color: white;
    font-size: 24px;
}

/* Thumbs Up Animation */
.thumbs-up-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: none;
}

.thumbs-up-animation.active {
    display: block;
}

.thumb-emoji {
    position: absolute;
    font-size: 80px;
    animation: thumbsUp 1.5s ease-out forwards;
    opacity: 0;
}

.thumb-emoji:nth-child(1) {
    left: 15%;
    top: 25%;
    animation-delay: 0s;
}

.thumb-emoji:nth-child(2) {
    left: 45%;
    top: 15%;
    animation-delay: 0.2s;
}

.thumb-emoji:nth-child(3) {
    left: 75%;
    top: 30%;
    animation-delay: 0.4s;
}

.thumb-emoji:nth-child(4) {
    left: 30%;
    top: 55%;
    animation-delay: 0.6s;
}

.thumb-emoji:nth-child(5) {
    left: 65%;
    top: 60%;
    animation-delay: 0.8s;
}

.thumb-emoji:nth-child(6) {
    left: 85%;
    top: 45%;
    animation-delay: 1s;
}

.thumb-emoji:nth-child(7) {
    left: 20%;
    top: 75%;
    animation-delay: 1.2s;
}

.thumb-emoji:nth-child(8) {
    left: 55%;
    top: 80%;
    animation-delay: 1.4s;
}

@keyframes thumbsUp {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(0) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: scale(1.3) translateY(-30px) rotate(10deg);
    }
    40% {
        transform: scale(1) translateY(-50px) rotate(-5deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-120px) rotate(15deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 26px;
    }

    .reading-scene {
        padding: 20px;
    }

    .school-name {
        font-size: 18px;
    }

    .student-avatar {
        font-size: 70px;
    }

    .book-front {
        width: 180px;
        height: 250px;
    }

    .breakdown-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    #answerInput {
        width: 200px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .story-box {
        padding: 15px;
    }

    .classroom-header {
        flex-direction: column;
        gap: 10px;
    }

    .book-display {
        flex-direction: column;
    }

    .breakdown-cards {
        grid-template-columns: 1fr;
    }

    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .input-container {
        flex-direction: column;
    }
}
