/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Navigation */
#navbar {
    background-color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#navbar ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
}

#navbar li {
    margin: 0;
}

#navbar a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 1rem 1.2rem;
    transition: background-color 0.3s;
}

#navbar a:hover {
    background-color: #34495e;
}

#navbar a.quiz-link {
    background-color: #e74c3c;
    font-weight: bold;
}

#navbar a.quiz-link:hover {
    background-color: #c0392b;
}

/* Main Content */
main {
    padding: 2rem 0;
}

.topic-section {
    background: white;
    margin: 2rem 0;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.topic-section h2 {
    color: #1e3c72;
    font-size: 2rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid #2a5298;
    padding-bottom: 0.5rem;
}

.topic-section h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
}

.topic-section h4 {
    color: #34495e;
    font-size: 1.2rem;
    margin: 1rem 0 0.5rem;
}

.content {
    color: #555;
}

.content p {
    margin-bottom: 1rem;
}

.content ul, .content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.content li {
    margin-bottom: 0.5rem;
}

/* Special Boxes */
.example-box, .info-box, .warning-box, .formula-box {
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 5px;
    border-left: 5px solid;
}

.example-box {
    background-color: #e8f4f8;
    border-left-color: #3498db;
}

.info-box {
    background-color: #e8f8f5;
    border-left-color: #1abc9c;
}

.warning-box {
    background-color: #fff3cd;
    border-left-color: #f39c12;
}

.formula-box {
    background-color: #f4ecf7;
    border-left-color: #9b59b6;
    font-family: 'Courier New', monospace;
}

.formula-box strong {
    font-size: 1.3rem;
    color: #8e44ad;
}

.outlet-type {
    background-color: #f8f9fa;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.outlet-type h4 {
    color: #2a5298;
    margin-top: 0;
}

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

#quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.question {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.answers {
    margin-bottom: 1.5rem;
}

.answer-option {
    background-color: #fff;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}

.answer-option:hover {
    background-color: #f8f9fa;
    border-color: #2a5298;
}

.answer-option.selected {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

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

.answer-option.incorrect {
    background-color: #f8d7da;
    border-color: #dc3545;
}

.answer-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

#quiz-controls {
    text-align: center;
    margin: 1.5rem 0;
}

.btn {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.btn-primary {
    background-color: #2a5298;
    color: white;
}

.btn-primary:hover {
    background-color: #1e3c72;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    margin-left: 1rem;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.result {
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: 5px;
    font-size: 1.1rem;
    text-align: center;
}

.result.correct {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.score-display {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin-top: 1rem;
}

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

.final-results h3 {
    color: #1e3c72;
    font-size: 2rem;
    margin-bottom: 1rem;
}

#final-score {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2a5298;
    margin: 1rem 0;
}

#performance-message {
    font-size: 1.3rem;
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: 5px;
}

#performance-message.excellent {
    background-color: #d4edda;
    color: #155724;
}

#performance-message.good {
    background-color: #d1ecf1;
    color: #0c5460;
}

#performance-message.needs-improvement {
    background-color: #fff3cd;
    color: #856404;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer p {
    margin-bottom: 0.5rem;
}

.disclaimer {
    font-size: 0.9rem;
    opacity: 0.8;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    #navbar ul {
        flex-direction: column;
    }

    #navbar a {
        text-align: center;
        padding: 0.8rem;
    }

    .topic-section {
        padding: 1.5rem;
    }

    .topic-section h2 {
        font-size: 1.5rem;
    }

    .question {
        font-size: 1.1rem;
    }

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

    .btn-secondary {
        margin-left: 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .topic-section {
        padding: 1rem;
    }

    .example-box, .info-box, .warning-box, .formula-box {
        padding: 1rem;
    }

    #quiz-controls {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-secondary {
        margin-left: 0;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Print Styles */
@media print {
    #navbar, footer, .quiz-section {
        display: none;
    }

    .topic-section {
        page-break-inside: avoid;
        box-shadow: none;
    }
}
