:root {
    --primary-color: #1a5d98;
    --secondary-color: #00796b;
    --accent-color: #d32f2f;
    --light-color: #f5f5f5;
    --dark-color: #333;
    --background-color: #f8f9fa;
    --text-color: #333;
    --card-background-color: white;
    --card-shadow-color: rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --primary-color: #2c7bb6;
    --secondary-color: #00a693;
    --accent-color: #e57373;
    --light-color: #424242;
    --dark-color: #f5f5f5;
    --background-color: #121212;
    --text-color: #f5f5f5;
    --card-background-color: #1e1e1e;
    --card-shadow-color: rgba(255,255,255,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.navbar {
    background-color: var(--primary-color) !important;
    box-shadow: 0 2px 10px var(--card-shadow-color);
}

.navbar-brand {
    font-weight: 700;
    color: white !important;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    margin: 0 10px;
    font-weight: 500;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 80px 0;
    border-bottom: 5px solid #fff;
}

.hero-section h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-section p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 30px;
}

.btn-primary {
    background-color: #fff;
    color: var(--primary-color);
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--light-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-success {
    background-color: var(--secondary-color);
    border: none;
    padding: 10px 25px;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background-color: #00695c;
    transform: translateY(-2px);
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--card-shadow-color);
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    background-color: var(--card-background-color);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px var(--card-shadow-color);
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    padding: 20px;
    font-weight: 600;
    font-size: 1.2rem;
}

.card-body {
    padding: 25px;
}

.exam-container {
    background-color: var(--card-background-color);
    border-radius: 15px;
    padding: 30px;
    margin-top: 50px;
    box-shadow: 0 10px 30px var(--card-shadow-color);
    transition: opacity 0.5s ease-in-out;
}

.question {
    margin-bottom: 30px;
    padding: 20px;
    border-left: 4px solid var(--primary-color);
    background-color: var(--background-color);
}

.question-number {
    background-color: var(--primary-color);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-weight: 600;
}

.option {
    padding: 12px 15px;
    margin: 8px 0;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option:hover {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
}

.option.selected {
    border-color: var(--primary-color);
    background-color: #e3f2fd;
    font-weight: 500;
}

.section-title {
    color: var(--primary-color);
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 10px;
    margin: 40px 0 25px;
    font-weight: 600;
}

.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stats-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 10px 0;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

.timer {
    background-color: var(--accent-color);
    color: white;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    margin: 20px 0;
}

footer {
    background-color: var(--dark-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: 80px;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fff;
}

.copyright {
    margin-top: 20px;
    color: #aaa;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .card {
        margin-bottom: 20px;
    }
}

.progress-container {
    background-color: #e0e0e0;
    height: 10px;
    border-radius: 5px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--secondary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.instructions {
    background-color: #e8f5e8;
    border-left: 4px solid var(--secondary-color);
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 10px 10px 0;
}

.exam-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    flex-wrap: wrap;
}

.exam-nav button {
    flex: 1;
    margin: 0 5px;
    min-width: 120px;
}

.topic-badge {
    background-color: var(--secondary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 10px;
}

.difficulty {
    font-size: 0.9rem;
    color: #666;
    margin: 5px 0;
}

.image-container {
    margin: 15px 0;
    text-align: center;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.zoomable {
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.zoomable:hover {
    transform: scale(1.05);
}

.modal-content {
    border-radius: 15px;
    border: none;
    background-color: var(--card-background-color);
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
    border-radius: 15px 15px 0 0 !important;
}

.modal-footer {
    background-color: var(--background-color);
}

.result-card {
    border: 3px solid var(--secondary-color);
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.result-title {
    color: var(--secondary-color);
    font-weight: 700;
}

.feedback {
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    background-color: #fff3e0;
    border-left: 4px solid #ff9800;
}

.correct {
    border-color: var(--secondary-color);
    background-color: #e8f5e9;
}

.incorrect {
    border-color: var(--accent-color);
    background-color: #ffebee;
}

/* Theme switcher */
.theme-switcher {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.theme-switcher .form-check-input {
    margin-right: 10px;
}

/* Question transitions */
.question-container {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.question-container.fade-out {
    opacity: 0;
}