img,
video {
    max-width: 100%;
    height: auto;
}

html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f5f5;
    color: #333;
}

header {
    background: #b30000;
    color: white;
    text-align: center;
    padding: 40px;
}

header h1 {
    margin-bottom: 10px;
}

#darkModeBtn {
    margin-top: 15px;
    padding: 10px 20px;
    cursor: pointer;
}

.controls {
    width: 90%;
    max-width: 1200px;
    margin: 30px auto;
}

#searchInput {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.progress-wrapper {
    width: 100%;
    height: 20px;
    background: #ddd;
    border-radius: 20px;
    margin-top: 20px;
}

#progressBar {
    width: 0%;
    height: 100%;
    background: green;
    border-radius: 20px;
}

#progressText {
    margin-top: 10px;
}

#lessonContainer {
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

.card {
    background: white;
    padding: 30px;
    margin-bottom: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card h2 {
    color: #b30000;
    margin-bottom: 15px;
}

.card p {
    margin-bottom: 20px;
}

.card button {
    padding: 10px 15px;
    margin-right: 10px;
    cursor: pointer;
}

.detail-btn {
    background: #b30000;
    color: white;
    border: none;
}

.summary-btn {
    background: #eee;
    border: none;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
}

.modal-content {
    background: white;
    width: 85%;
    max-width: 1000px;
    margin: 30px auto;
    padding: 40px;
    border-radius: 16px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

#closeModal {
    float: right;
    font-size: 30px;
    cursor: pointer;
}

.quiz-section {
    width: 90%;
    max-width: 1200px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
}

.question {
    margin-bottom: 25px;
}
.correct{
    color:green;
    font-weight:bold;
    margin-top:10px;
    display:block;
}

.wrong{
    color:red;
    font-weight:bold;
    margin-top:10px;
    display:block;
}

.answer{
    color:#0077cc;
    font-weight:bold;
}

.dark {
    background: #1f1f1f;
    color: white;
}

.dark .card,
.dark .quiz-section,
.dark .modal-content {
    background: #2b2b2b;
    color: white;
}

.dark {
    background: #1f1f1f;
    color: white;
}

.dark #searchInput {
    background: #333;
    color: white;
    border: 1px solid #555;
}

.dark .summary-btn {
    background: #444;
    color: white;
}

.dark .progress-wrapper {
    background: #444;
}

.dark header {
    background: #7a0000;
}


/* =========================
   MARKDOWN CONTENT
========================= */

#modalBody {
    line-height: 1.8;
    font-size: 17px;
}

#modalBody h1,
#modalBody h2,
#modalBody h3 {
    margin-top: 25px;
    margin-bottom: 15px;
}

#modalBody h1 {
    color: #b30000;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

#modalBody h2 {
    color: #b30000;
    border-left: 5px solid #b30000;
    padding-left: 12px;
}

#modalBody p {
    margin: 12px 0;
    text-align: justify;
}

#modalBody ul {
    margin: 15px 0;
    padding-left: 25px;
}

#modalBody li {
    margin: 8px 0;
}

#modalBody strong {
    color: #b30000;
    font-weight: 700;
}

#modalBody blockquote {
    border-left: 4px solid #b30000;
    padding: 10px 15px;
    margin: 15px 0;
    background: #f8f8f8;
    font-style: italic;
}

#modalBody hr {
    margin: 25px 0;
    border: none;
    border-top: 1px solid #ddd;
}

.dark #modalBody h1,
.dark #modalBody h2 {
    color: #ff6b6b;
}

.dark #modalBody strong {
    color: #ff8080;
}

.dark #modalBody blockquote {
    background: #363636;
    color: #ddd;
}

.dark #modalBody h1 {
    border-bottom-color: #555;
}

/* =========================
   TABLET
========================= */
@media (max-width: 768px) {

    header {
        padding: 25px 15px;
    }

    header h1 {
        font-size: 28px;
    }

    .controls,
    #lessonContainer,
    .quiz-section {
        width: 95%;
    }

    .card {
        padding: 20px;
    }

    .card h2 {
        font-size: 22px;
    }

    .modal-content {
        width: 92%;
        margin: 30px auto;
        padding: 20px;
        max-height: 85vh;
    }

    #closeModal {
        font-size: 26px;
    }

    .card button {
        margin-bottom: 10px;
    }

}

/* =========================
   MOBILE
========================= */
@media (max-width: 576px) {

    header {
        padding: 20px 10px;
    }

    header h1 {
        font-size: 22px;
        line-height: 1.4;
    }

    header p {
        font-size: 14px;
    }

    #darkModeBtn {
        width: 100%;
        margin-top: 15px;
    }

    #searchInput {
        font-size: 14px;
        padding: 10px;
    }

    .card {
        padding: 15px;
    }

    .card h2 {
        font-size: 18px;
        line-height: 1.5;
    }

    .card p {
        font-size: 14px;
    }

    .card button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .modal-content {
        width: 95%;
        margin: 15px auto;
        padding: 15px;
        border-radius: 10px;
    }

    #modalTitle {
        font-size: 20px;
        padding-right: 25px;
    }

    #modalBody {
        font-size: 14px;
        line-height: 1.7;
    }

    .quiz-section {
        padding: 15px;
    }

    .quiz-section h2 {
        font-size: 20px;
    }

    .question h3 {
        font-size: 16px;
        line-height: 1.5;
    }

    .question label {
        display: block;
        margin: 8px 0;
        line-height: 1.5;
    }

    #submitQuiz,
    #resetQuiz {
        width: 100%;
        margin-bottom: 10px;
        padding: 12px;
    }

}

/* =========================
   LARGE SCREEN
========================= */
@media (min-width: 1400px) {

    #lessonContainer,
    .controls,
    .quiz-section {
        max-width: 1400px;
    }

    .card {
        padding: 35px;
    }

    .card h2 {
        font-size: 28px;
    }

}