/* Islamic Kids Quiz - Complete CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2E8B57;
    --secondary: #FFD700;
    --accent: #8B4513;
    --light: #F5F5DC;
    --dark: #2F4F4F;
    --correct: #4CAF50;
    --wrong: #F44336;
}

body {
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    font-family: 'Noto Sans Tamil', Arial, sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}



/* Header Styles */
header {
    background: linear-gradient(135deg, #2E8B57, #1a5c3a);
    color: white;
    padding: 15px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: center; /* Horizontal centering */
    align-items: center;     /* Vertical centering */
    flex-direction: column;  /* Stack items vertically */
    text-align: center;      /* Center text content */
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: #FFD700;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.logo p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    margin: 0;
    padding: 0;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

nav a:hover, nav a.active {
    background-color: #FFD700;
    color: #2F4F4F;
}

/* Hero Section - FIXED */
.hero {
    background: linear-gradient(135deg, #2E8B57, #3CB371);
    color: white;
    padding: 80px 0;
    text-align: center;
    margin: 50px 0;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.3rem;
    max-width: 800px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: #FFD700;
    color: #2F4F4F;
    
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    background-color: #FFC400;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background-color: #2E8B57;
    color: white;
}

.btn-secondary:hover {
    background-color: #1a5c3a;
}

/* Features Section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 60px 0;
}

.feature-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: #2E8B57;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 4rem;
    color: #2E8B57;
    margin-bottom: 25px;
}

.feature-card h3 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    color: #2E8B57;
}

.feature-card p {
    color: #666;
    line-height: 1.7;
}

/* Section Titles */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: #2E8B57;
    margin-bottom: 50px;
    position: relative;
}

.section-title::after {
    content: "";
    display: block;
    width: 120px;
    height: 5px;
    background-color: #FFD700;
    margin: 15px auto;
    border-radius: 3px;
}

/* Categories */
.quiz-categories {
    margin: 60px 0;
}

.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
      text-align: center;
}

.category {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
      text-align: center;
}

.category:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.category-img {
    height: 180px;
    background: linear-gradient(135deg, #2E8B57, #3CB371);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
}

.category-content {
    padding: 25px;
}

.category h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #2E8B57;
}

.category p {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.6;
}

/* User Welcome */
.user-welcome {
    background: linear-gradient(135deg, #2E8B57, #3CB371);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.user-welcome h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.user-welcome p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Avatars */
.avatars {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2E8B57, #3CB371);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 4px solid transparent;
}

.avatar:hover, .avatar.selected {
    transform: scale(1.15);
    border-color: #FFD700;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Badges */
.badges {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.badge {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #FFC400);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2F4F4F;
    font-size: 2.2rem;
    position: relative;
    transition: all 0.3s ease;
}

.badge:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.badge.locked {
    background: linear-gradient(135deg, #cccccc, #999999);
    color: #666;
}

.badge-info {
    position: absolute;
    bottom: -35px;
    background: rgba(47, 79, 79, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.badge:hover .badge-info {
    opacity: 1;
}

/* Quiz Container */
.quiz-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 40px 0;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #F5F5DC;
}

.quiz-progress {
    width: 100%;
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 6px;
    margin: 25px 0;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2E8B57, #4CAF50);
    transition: width 0.3s ease;
}

.question {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #2F4F4F;
    text-align: center;
    line-height: 1.6;
}

.options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 35px;
}

.option {
    padding: 20px 25px;
    background-color: #F5F5DC;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid transparent;
}

.option:hover {
    background-color: #e8e8c0;
    transform: translateY(-2px);
}

.option.selected {
    border-color: #2E8B57;
    background-color: #e0f0e0;
    transform: translateY(-2px);
}

.quiz-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.score-display {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2E8B57;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #2F4F4F, #1a1a1a);
    color: white;
    padding: 50px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    color: #FFD700;
}

.footer-section p, .footer-section a {
    color: #ddd;
    margin-bottom: 12px;
    display: block;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #FFD700;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icons a {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background: #FFD700;
    color: #2F4F4F;
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #aaa;
}

/* Tamil Text */
.tamil-text {
    font-family: 'Noto Sans Tamil', sans-serif;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .hero {
        padding: 50px 20px;
    }
    
    .hero h2 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .categories {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .container {
        padding: 15px;
    }
}




/* Add to your CSS */
.question-media {
    text-align: center;
    margin: 20px 0;
}

.question-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.question-audio audio {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.file-input {
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    width: 100%;
}

.current-file {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

/* Sound Controls */
.sound-controls {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 999;
    background: white;
    padding: 10px 15px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid #ff6b35;
}

.sound-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #ff6b35;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    background: #fff5f2;
    transform: scale(1.1);
}

.sound-toggle.muted {
    color: #666;
}

.volume-slider {
    width: 80px;
    height: 5px;
    -webkit-appearance: none;
    background: #e0e0e0;
    border-radius: 5px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ff6b35;
    cursor: pointer;
}

/* Hide sound container */
#soundContainer {
    display: none;
}


/* Star Rating Styles */
.star-rating {
    direction: rtl;
    unicode-bidi: bidi-override;
    color: #ddd;
    font-size: 24px;
}

.star-rating input {
    display: none;
}

.star-rating label {
    display: inline-block;
    padding: 0 2px;
    cursor: pointer;
    transition: color 0.2s;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: #ffc107;
}

/* Feedback Form Styles */
.quiz-feedback {
    max-width: 600px;
    margin: 0 auto;
}

#feedbackMessage {
    padding: 10px;
    border-radius: 5px;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}



/* Compact Quiz Cards */
.quiz-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.quiz-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FFD700, #FF6B6B);
}

.quiz-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.quiz-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.quiz-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.quiz-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
    flex-shrink: 0;
}

.quiz-icon i {
    font-size: 1.2rem;
    color: white;
}

.quiz-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.quiz-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
}

.quiz-meta i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.quiz-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.quiz-difficulty {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-easy {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.difficulty-medium {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.difficulty-hard {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.quiz-btn {
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.quiz-btn-primary {
    background: linear-gradient(135deg, #FFD700, #FFA000);
    color: #333;
    border-color: #FFD700;
}

.quiz-btn-primary:hover {
    background: linear-gradient(135deg, #FFA000, #FF6B00);
    transform: scale(1.05);
    color: #333;
}

.quiz-btn-secondary {
    background: transparent;
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.quiz-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Grid layout for multiple cards */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* Progress indicator */
.quiz-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 8px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #4CAF50);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Compact stats */
.quiz-stats {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-number {
    font-size: 1.1rem;
    font-weight: bold;
    color: #FFD700;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
}

/* Responsive design */
@media (max-width: 768px) {
    .quiz-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .quiz-card {
        padding: 15px;
        margin: 10px 0;
    }
    
    .quiz-card-body {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .quiz-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .quiz-btn {
        text-align: center;
        padding: 10px;
    }
}

/* Leaderboard Styles */
.leaderboard-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px 0;
    color: white;
    margin: 40px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: #FFD700;
}

.section-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.leaderboard-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto 30px;
}

.leaderboard-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.leaderboard-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.15);
}

.leaderboard-card.rank-1 {
    border-color: #FFD700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
}

.leaderboard-card.rank-2 {
    border-color: #C0C0C0;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.1));
}

.leaderboard-card.rank-3 {
    border-color: #CD7F32;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.1));
}

.rank-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    position: relative;
}

.rank-1 .rank-badge {
    background: linear-gradient(135deg, #FFD700, #FFA000);
    color: #333;
}

.rank-2 .rank-badge {
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
    color: #333;
}

.rank-3 .rank-badge {
    background: linear-gradient(135deg, #CD7F32, #B56C20);
    color: white;
}

.rank-4 .rank-badge,
.rank-5 .rank-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.rank-badge .fa-crown {
    position: absolute;
    top: -8px;
    font-size: 1rem;
    color: #FF6B00;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.user-score {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    color: #FFD700;
    font-weight: 600;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.no-leaders {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin-bottom: 30px;
}

.leaderboard-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Current User Highlight */
.current-user-card {
    border: 2px solid #4CAF50 !important;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1)) !important;
}

.current-user-badge {
    background: #4CAF50 !important;
    color: white !important;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .leaderboard-card {
        padding: 15px;
        gap: 15px;
    }
    
    .rank-badge {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .user-name {
        font-size: 1.1rem;
    }
    
    .leaderboard-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .leaderboard-actions .btn {
        width: 200px;
    }
}
