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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.course-info {
    background: white;
    padding: 40px 0;
    border-bottom: 1px solid #eee;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.info-card {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    background: #f8f9fa;
}

.info-card h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.modules {
    padding: 60px 0;
}

.modules h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #333;
}

.module-category {
    font-size: 1.8rem;
    margin: 30px 0 20px 0;
    color: #667eea;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.module-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.module-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.module-number {
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Module type styles */
.module-lecture .module-number {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.module-practice .module-number {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.module-assignment .module-number {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.module-lecture {
    border-left: 4px solid #3498db;
}

.module-practice {
    border-left: 4px solid #2ecc71;
}

.module-assignment {
    border-left: 4px solid #e74c3c;
}

.module-type-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: bold;
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.module-lecture .module-type-label {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.module-practice .module-type-label {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.module-assignment .module-type-label {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.module-card h3 {
    color: #333;
    font-size: 1.4rem;
}

.module-card p {
    color: #666;
    margin-bottom: 20px;
}

.topics-list {
    list-style: none;
    padding: 0;
}

.topics-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
}

.topics-list li:last-child {
    border-bottom: none;
}

.topics-list li:before {
    content: "▸";
    color: #667eea;
    margin-right: 10px;
}

.module-resources {
    display: flex;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}

.resource-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 10px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.resource-link:hover {
    transform: translateY(-2px);
}

.resource-link i {
    margin-right: 5px;
}

/* Resource link styles for different module types */
.module-lecture .resource-link.video {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.module-lecture .resource-link.slides {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.module-practice .resource-link.video {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.module-practice .resource-link.slides {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.module-assignment .resource-link.video {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.module-assignment .resource-link.assignment {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.prerequisites {
    background: #667eea;
    color: white;
    padding: 50px 0;
}

.prerequisites h2 {
    text-align: center;
    margin-bottom: 30px;
}

.prereq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.prereq-item {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 30px 0;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    margin-top: 20px;
    transition: transform 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }
}

/* Additional styles for quiz functionality */
.quiz-container {
    padding: 40px 0;
    width: 100%;
    margin: 0 auto;
    background-color: #f0f2f5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.quiz-container .container {
    width: 100%;
    max-width: 100%;
    padding: 0 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.quiz-header {
    width: 100%;
    max-width: 1200px;
}

.quiz-content {
    width: 100%;
    max-width: 1200px;
}

.quiz-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    border-left: 4px solid #667eea;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.quiz-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.12);
}

.quiz-question {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 30px;
    color: #333;
    line-height: 1.5;
}

.quiz-options {
    list-style: none;
    padding: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
}

.quiz-option {
    padding: 20px 25px;
    margin-bottom: 0;
    border: 2px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.quiz-option:hover {
    background-color: #f8f9fa;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.quiz-option.selected {
    background-color: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.quiz-option.selected::before {
    content: "✓";
    position: absolute;
    right: 20px;
    color: #667eea;
    font-weight: bold;
}

.quiz-option.correct {
    background-color: rgba(46, 204, 113, 0.1);
    border-color: #2ecc71;
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.1);
}

.quiz-option.correct::before {
    content: "✓";
    position: absolute;
    right: 20px;
    color: #2ecc71;
    font-weight: bold;
}

.quiz-option.incorrect {
    background-color: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.1);
}

.quiz-option.incorrect::before {
    content: "✗";
    position: absolute;
    right: 20px;
    color: #e74c3c;
    font-weight: bold;
}

.quiz-feedback {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    display: none;
    font-size: 1.1rem;
    font-weight: 500;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
}

.quiz-feedback.correct {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    border-left: 4px solid #2ecc71;
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.quiz-feedback.incorrect {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.quiz-explanation {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    display: none;
    font-size: 1rem;
    line-height: 1.6;
    border-left: 4px solid #667eea;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.quiz-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 20px;
}

.quiz-button {
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
    flex: 1;
    max-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.quiz-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.quiz-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.check-answer:before {
    content: "✓ ";
    margin-right: 5px;
}

.show-explanation {
    background-color: #f8f9fa;
    color: #333;
    border: 2px solid #ddd;
}

.show-explanation:before {
    content: "ℹ️ ";
    margin-right: 5px;
}

.show-explanation.active {
    background-color: #667eea;
    color: white;
    border: 2px solid #667eea;
}

.show-explanation.active:before {
    content: "✕ ";
    margin-right: 5px;
}

.quiz-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 15px 25px;
    font-size: 1.1rem;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.quiz-score {
    font-weight: 600;
    color: #667eea;
    display: flex;
    align-items: center;
}

.quiz-score:before {
    content: "🏆";
    margin-right: 8px;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    gap: 20px;
}

.quiz-navigation .cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.quiz-navigation .cta-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#prev-question:before {
    content: "◀ ";
    margin-right: 5px;
}

#next-question:after {
    content: " ▶";
    margin-left: 5px;
}

/* Quiz toggle styles */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    background: white;
    border-radius: 12px 12px 0 0;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.quiz-header:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.quiz-toggle {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    background-color: rgba(102, 126, 234, 0.1);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #667eea;
}

.quiz-toggle.expanded {
    transform: rotate(180deg);
    background-color: #667eea;
    color: white;
}

.quiz-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s ease;
    opacity: 0;
}

.quiz-content.expanded {
    max-height: 3000px; /* Large enough to show all content */
    opacity: 1;
}

/* Mobile responsive adjustments for half-page quiz */
@media (max-width: 768px) {
    .quiz-container {
        width: 90vw;
        padding: 20px 0;
    }

    .quiz-container .container {
        padding: 0 20px;
    }

    .quiz-card {
        padding: 30px 20px;
        min-height: calc(100vh - 120px);
    }

    .quiz-question {
        font-size: 1.2rem;
        margin-bottom: 25px;
    }

    .quiz-option {
        padding: 15px 20px;
        font-size: 1rem;
        min-height: 50px;
    }

    .quiz-progress {
        padding: 0 20px;
        margin-bottom: 30px;
        font-size: 1rem;
    }

    .quiz-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .quiz-button {
        max-width: none;
    }
}
