* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #2951b5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Added navigation header styles */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-menu {
    display: flex;
    gap: 30px;
    list-style: none;
}

    .navbar-menu a {
        text-decoration: none;
        color: #333;
        font-weight: 500;
        transition: color 0.3s ease;
        font-size: 1rem;
    }

        .navbar-menu a:hover {
            color: #667eea;
        }

.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

    .navbar-toggle span {
        width: 25px;
        height: 3px;
        background: #667eea;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

.main-content {
    flex: 1;
    padding: 70px 20px;
}

header.page-header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    margin-top: 50px;
}

    header.page-header h1 {
        font-size: 2.5rem;
        margin-bottom: 10px;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    }

    header.page-header p {
        font-size: 1.1rem;
        opacity: 0.9;
    }

/* Sidebar Menu */
.sidebar {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 280px;
    flex-shrink: 0;
    height: fit-content;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
}

    .sidebar h2 {
        color: #667eea;
        margin-bottom: 20px;
        font-size: 1.5rem;
        flex-shrink: 0;
    }

.topic-list {
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

    .topic-list::-webkit-scrollbar {
        width: 6px;
    }

    .topic-list::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .topic-list::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 10px;
    }

        .topic-list::-webkit-scrollbar-thumb:hover {
            background: #5568d3;
        }

.topic-item {
    padding: 12px 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

    .topic-item:hover {
        background: #e9ecef;
        transform: translateX(-5px);
    }

    .topic-item.active {
        background: #667eea;
        color: white;
        border-color: #667eea;
    }

    .topic-item span {
        font-weight: 600;
    }

/* Quiz List */
.quiz-list {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    align-content: start;
}

.quiz-card {
    background: white;
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .quiz-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    }

.quiz-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.quiz-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3rem;
    padding: 20px 25px 0 25px;
}

.quiz-card p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
    padding: 0 25px;
}

.quiz-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
    padding-top: 15px;
    border-top: 1px solid #eee;
    padding: 15px 25px 20px 25px;
}

    .quiz-meta span {
        font-size: 0.9rem;
        color: #888;
    }

.difficulty {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

    .difficulty.easy {
        background: #d4edda;
        color: #155724;
    }

    .difficulty.medium {
        background: #fff3cd;
        color: #856404;
    }

    .difficulty.hard {
        background: #f8d7da;
        color: #721c24;
    }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

    .modal.active {
        display: flex;
    }

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

    .close-btn:hover {
        background: #f0f0f0;
        color: #333;
    }

.quiz-header {
    margin-bottom: 30px;
}

    .quiz-header h2 {
        color: #667eea;
        margin-bottom: 10px;
    }

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.question {
    margin-bottom: 30px;
}

    .question h3 {
        color: #333;
        margin-bottom: 20px;
        font-size: 1.2rem;
        line-height: 1.6;
    }

.question-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 10px;
    margin: 20px auto;
    display: block;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.answer-options {
    display: flex;
    flex-direction: column;
}

.answer-option {
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

    .answer-option:hover {
        background: #e9ecef;
        border-color: #667eea;
    }

    .answer-option.selected {
        background: #667eea;
        color: white;
        border-color: #667eea;
    }

    .answer-option.correct {
        background: #28a745;
        color: white;
        border-color: #28a745;
    }

    .answer-option.incorrect {
        background: #dc3545;
        color: white;
        border-color: #dc3545;
    }

.quiz-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

    .btn-primary:hover {
        background: #5568d3;
        transform: translateY(-2px);
    }

.btn-secondary {
    background: #6c757d;
    color: white;
}

    .btn-secondary:hover {
        background: #5a6268;
    }

.result-screen {
    text-align: center;
    padding: 40px 20px;
}

    .result-screen h2 {
        color: #667eea;
        font-size: 2rem;
        margin-bottom: 20px;
    }

.score-display {
    font-size: 4rem;
    font-weight: bold;
    color: #667eea;
    margin: 30px 0;
}

.result-message {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
}

/* Hamburger Menu Button */
.menu-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: none;
    cursor: pointer;
    z-index: 99;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
}

    .menu-toggle span {
        width: 25px;
        height: 3px;
        background: #667eea;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

/* Overlay for Mobile Menu */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .menu-overlay.active {
        opacity: 1;
    }

/* Added footer styles */

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

    .social-links a {
        width: 40px;
        height: 40px;
        background: #f8f9fa;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #667eea;
        text-decoration: none;
        transition: all 0.3s ease;
    }

        .social-links a:hover {
            background: #667eea;
            color: white;
        }

/* Responsive */
@media (max-width: 768px) {
    /* Added mobile navbar styles */
    .navbar-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 80px 30px 30px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        z-index: 101;
        gap: 0;
    }

        .navbar-menu.open {
            left: 0;
        }

        .navbar-menu li {
            margin-bottom: 20px;
        }

    .navbar-toggle {
        display: flex;
    }

    .main-content {
        padding: 15px;
    }


    /* Sidebar Slide-in Menu on Mobile */
    .sidebar {
        width: 280px;
        position: fixed;
        top: 0;
        right: -280px;
        bottom: 0;
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
        padding: 25px;
        z-index: 99;
        box-shadow: -5px 0 20px rgba(0,0,0,0.3);
        transition: right 0.3s ease;
    }

        .sidebar.open {
            right: 0;
        }

        .sidebar h2 {
            display: block;
            font-size: 1.3rem;
            margin-bottom: 20px;
            cursor: default;
        }

    .topic-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
        overflow-y: auto;
        padding-right: 5px;
        max-height: calc(100vh - 100px);
    }

    .topic-item {
        flex-shrink: 0;
        white-space: normal;
        margin-bottom: 0;
        padding: 15px;
        text-align: left;
        font-size: 1rem;
    }

        .topic-item:hover {
            transform: translateX(-5px);
        }

    /* Show hamburger menu button on mobile */
    .menu-toggle {
        display: flex;
    }

    /* Show overlay when menu is open */
    .menu-overlay.active {
        display: block;
    }

    .quiz-list {
        grid-template-columns: 1fr;
        padding-bottom: 20px;
    }

    header.page-header h1 {
        font-size: 2rem;
    }

    .modal-content {
        padding: 25px;
    }

    .score-display {
        font-size: 3rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}
.container-quiz-list {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
    flex-direction: row-reverse;
}