:root {
    --primary-color: #4a6fa5;
    --secondary-color: #6b8cae;
    --accent-color: #ff6b6b;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
}

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main Content */
main {
    padding: 3rem 0;
    min-height: calc(100vh - 300px);
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.card .meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.card .meta span {
    display: inline-block;
    margin-right: 1rem;
}

.card .difficulty {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.difficulty.easy {
    background-color: #d4edda;
    color: #155724;
}

.difficulty.hard {
    background-color: #f8d7da;
    color: #721c24;
}

/* Quiz Container */
.quiz-container {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.progress {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color);
}

.timer {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-color);
}

.question-text {
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

.options-list {
    list-style: none;
}

.option-item {
    margin-bottom: 1rem;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-label:hover {
    background-color: #e9ecef;
}

.option-label.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.option-label.correct {
    background-color: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.option-label.incorrect {
    background-color: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.option-prefix {
    font-weight: 600;
    margin-right: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Quiz Controls */
.quiz-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Results */
.results-container {
    text-align: center;
    padding: 2rem;
}

.score-circle {
    width: 200px;
    height: 200px;
    margin: 2rem auto;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
}

.score-number {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

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

/* Module Guide */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.module-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.module-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
}

.module-header h3 {
    margin-bottom: 0.5rem;
}

.module-body {
    padding: 1.5rem;
}

.module-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

.meta-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.meta-label {
    font-size: 0.9rem;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .quiz-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Loading Spinner */
.spinner {
    border: 4px solid rgba(0,0,0,0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== HEADER STYLES ========== */
.site-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #9f7aea 100%);
    color: white;
    padding: 1.5rem 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

/* Animated background pattern */
.site-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
}

.site-header::after {
    content: '🧠📚🧪📝';
    position: absolute;
    right: 20px;
    bottom: 10px;
    font-size: 4rem;
    opacity: 0.1;
    transform: rotate(-10deg);
    pointer-events: none;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: white;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 10px rgba(255,255,255,0.3));
    animation: bounce 3s ease-in-out infinite;
}

.logo-text {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.header-tagline {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
}

/* ========== NAVIGATION STYLES ========== */
.main-nav {
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}

.main-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #9f7aea);
    transition: transform 0.3s ease;
    border-radius: 3px 3px 0 0;
}

.nav-link:hover::after,
.nav-item.active .nav-link::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-link:hover {
    color: #667eea;
}

.nav-item.active .nav-link {
    color: #667eea;
    font-weight: 600;
}

.nav-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.nav-link:hover .nav-icon {
    transform: scale(1.2);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.mobile-menu-toggle span {
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #9f7aea);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

.mobile-menu-toggle.active span:first-child {
    transform: rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* ========== FOOTER STYLES ========== */
.site-footer {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    padding: 4rem 0 2rem;
    position: relative;
    overflow: hidden;
    margin-top: 4rem;
}

/* Decorative elements */
.site-footer::before {
    content: '🧠';
    position: absolute;
    left: 20px;
    top: 20px;
    font-size: 8rem;
    opacity: 0.03;
    transform: rotate(-15deg);
    pointer-events: none;
}

.site-footer::after {
    content: '📚🧪📝';
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 10rem;
    opacity: 0.03;
    transform: rotate(15deg);
    pointer-events: none;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #9f7aea);
    border-radius: 3px;
}

.footer-description {
    color: rgba(255,255,255,0.7);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    border: 1px solid rgba(255,255,255,0.2);
}

.social-link:hover {
    background: linear-gradient(135deg, #667eea, #9f7aea);
    transform: translateY(-3px) scale(1.1);
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.footer-copyright p {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

.heart-signature {
    color: #fc8181;
    font-size: 0.9rem;
    margin-top: 0.3rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.footer-disclaimer {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    max-width: 500px;
    text-align: right;
}

.footer-disclaimer p {
    line-height: 1.5;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    /* Header responsive */
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .header-tagline {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    
    /* Navigation responsive */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        box-shadow: 2px 0 20px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        z-index: 1000;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-link {
        padding: 0.8rem 0;
        font-size: 1.1rem;
    }
    
    .nav-link::after {
        bottom: 0;
    }
    
    /* Footer responsive */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-disclaimer {
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-section {
        text-align: center;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .logo-icon {
        font-size: 2rem;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    .header-tagline {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .nav-menu {
        width: 100%;
        max-width: none;
    }
    
    .footer-section {
        padding: 0 1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .main-nav {
        background: rgba(26, 32, 44, 0.95);
    }
    
    .nav-link {
        color: #e2e8f0;
    }
    
    .nav-link:hover,
    .nav-item.active .nav-link {
        color: #9f7aea;
    }
    
    .nav-menu {
        background: #1a202c;
    }
}

/* Print styles */
@media print {
    .site-header, .main-nav, .site-footer {
        display: none;
    }
}
