* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.logo h1 {
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

.back-button {
    display: flex;
    align-items: center;
}

.btn-back {
    background: rgba(255,255,255,0.2);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 1rem;
}

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

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Home Page */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 2.5rem;
    color: #4facfe;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.module-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    border: 3px solid transparent;
    cursor: pointer;
}

.module-card:hover {
    transform: translateY(-5px);
    border-color: #4facfe;
}

.module-icon img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
    object-fit: cover;
}

.module-card h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.module-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Module Items List Page */
.module-items-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.item-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

.item-card:hover {
    transform: translateY(-3px);
    border-color: #4facfe;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.item-image-container {
    flex-shrink: 0;
}

.item-image-container img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: contain;
    border: 2px solid #f0f0f0;
}

.item-info {
    flex: 1;
}

.item-info h3 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

/* Alphabet Letter Styling */
.alphabet-letter {
    position: absolute;
    top: 10px;
    right: 15px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-size: 2rem;
    font-weight: bold;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10;
}


/* Item Detail Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-header h2 {
    color: white;
    font-size: 1.8rem;
    margin: 0;
    flex: 1;
    text-align: center;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.close-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.modal-body {
    padding: 2rem;
}

.item-display {
    text-align: center;
}

.item-image {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    border-radius: 15px;
    object-fit: contain;
    margin-bottom: 1rem;
    border: 3px solid #f0f0f0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* Modal Alphabet Letter */
.modal-alphabet-letter {
    font-size: 5rem;
    font-weight: bold;
    color: white;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    background: rgba(255,255,255,0.2);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
}

/* Item Word Display */
.item-word {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background: rgba(79, 172, 254, 0.1);
    border-radius: 25px;
    display: inline-block;
}

.item-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.sound-button {
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.sound-button:hover {
    transform: translateY(-2px);
}

.sound-button:active {
    transform: translateY(0);
}

.name-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.name-button:hover {
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.real-sound-button {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}

.real-sound-button:hover {
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

/* Footer */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .module-items-list {
        grid-template-columns: 1fr;
    }

    .item-card {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .item-image-container img {
        width: 100px;
        height: 100px;
        object-fit: contain;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .item-image {
        max-width: 150px;
        max-height: 150px;
        width: auto;
        height: auto;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .btn-back {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .module-card {
        padding: 1.5rem;
    }

    .module-card h3 {
        font-size: 1.3rem;
    }

    .item-card {
        padding: 1rem;
    }

    .item-info h3 {
        font-size: 1.1rem;
    }

    .modal-content {
        width: 100%;
        margin: 0;
        border-radius: 0;
        height: 100vh;
    }

    .item-image {
        max-width: 120px;
        max-height: 120px;
        width: auto;
        height: auto;
    }

    .sound-button {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .item-controls {
        gap: 0.5rem;
    }
}

/* Loading animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.module-card:active {
    animation: pulse 0.3s ease;
}

.item-card:active {
    animation: pulse 0.2s ease;
}

/* Quiz Styles */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.quiz-header {
    text-align: center;
    margin-bottom: 3rem;
}

.quiz-header h2 {
    color: #4facfe;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.quiz-progress {
    margin-bottom: 2rem;
}

.quiz-progress span {
    display: block;
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    transition: width 0.3s ease;
    width: 11.11%;
}

.quiz-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.question-section {
    text-align: center;
    margin-bottom: 2rem;
}

.question-image-container {
    margin-bottom: 2rem;
}

.question-image {
    max-width: 300px;
    max-height: 200px;
    border-radius: 15px;
    object-fit: contain;
    border: 3px solid #f0f0f0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.question-text {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 2rem;
    line-height: 1.4;
}

.options-section {
    margin-bottom: 2rem;
}

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

.quiz-option {
    background: #f8f9fa;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-color: #4facfe;
}

.quiz-option.selected {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.quiz-option.correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.quiz-option.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.quiz-controls {
    text-align: center;
    margin-top: 2rem;
}

.quiz-continue-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}

.quiz-continue-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

.quiz-continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

.score-display {
    margin-bottom: 2rem;
}

.score-display h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.score-circle {
    display: inline-block;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 10px 30px rgba(79, 172, 254, 0.3);
}

.score-circle span {
    font-size: 3rem;
    font-weight: bold;
}

.score-total {
    font-size: 2rem !important;
    opacity: 0.8;
}

.score-message {
    margin-bottom: 2rem;
}

.score-message p {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 1rem;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-left: 1rem;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Responsive Quiz Styles */
@media (max-width: 768px) {
    .quiz-container {
        padding: 1rem;
    }
    
    .quiz-header h2 {
        font-size: 2rem;
    }
    
    .question-text {
        font-size: 1.5rem;
    }
    
    .quiz-options {
        grid-template-columns: 1fr;
    }
    
    .quiz-option {
        padding: 1rem;
        font-size: 1.1rem;
        min-height: 60px;
    }
    
    .question-image {
        max-width: 250px;
        max-height: 150px;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    .score-circle span {
        font-size: 2.5rem;
    }
    
    .score-total {
        font-size: 1.8rem !important;
    }
}

@media (max-width: 480px) {
    .quiz-content {
        padding: 1.5rem;
    }
    
    .question-text {
        font-size: 1.3rem;
    }
    
    .quiz-option {
        padding: 0.8rem;
        font-size: 1rem;
        min-height: 50px;
    }
    
    .question-image {
        max-width: 200px;
        max-height: 120px;
    }
    
    .btn-secondary {
        margin-left: 0.5rem;
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Smooth transitions */
.page {
    transition: opacity 0.3s ease;
}

.page.active {
    opacity: 1;
}