
/* ===============================
   GLOBAL STYLES
================================ */

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

:root {
    --purple: #122ac8;
    --background: #d1cae2;
    --card: #ffffff;
    --text: #151321;
    --muted: #4113d6;
    --border: #e814cc;
}

body {
    font-family: Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

body.dark {
    --background: #352b5d;
    --card: #282337;
    --text: #f5f1ff;
    --muted: #c0b8d1;
    --border: #403650;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

/* ===============================
   NAVBAR
================================ */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 5%;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    color: var(--purple);
    font-size: 25px;
    font-weight: bold;
    text-decoration: none;
}

/* SEARCH BOX */

.navbar input {
    padding: 11px 14px;
    border: 1px solid #3ff139;
    border-radius: 15px;
    background: var(--card);
    color: var(--text);
    min-width: 250px;
    box-shadow: 0 5px 10px rgba(75, 12, 211, 0.12);
    transition: all 0.3s ease;
}

.navbar input:hover {
    border-color: var(--purple);
    box-shadow: 0 4px 20px rgba(74, 9, 214, 0.868);
}

.navbar input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 20px rgba(102, 53, 207, 0.15);
}

.nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nav-buttons button {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--card);
    color: var(--text);
}

.nav-buttons button:hover {
    border-color: var(--purple);
}

/* NOTIFICATION BADGE */

.nav-buttons button:has(#badge) {
    position: relative;
}

#badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(35%, -35%);
    min-width: 19px;
    height: 19px;
    padding: 1px 5px;
    background: #ff8c00;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#badge[hidden] {
    display: none;
}

/* ===============================
   MAIN
================================ */

main {
    max-width: 1200px;
    margin: auto;
    padding: 28px 25px;
}

/* ===============================
   WELCOME SECTION
================================ */

.welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    background: linear-gradient(120deg, #22a237, #9563ed);
    color: white;
    padding: 36px;
    border-radius: 20px;
    margin-bottom: 25px;
    transition: transform 0.4s ease;
    cursor: pointer;
}

.welcome:hover {
    transform: translateY(-15px);
}

.welcome img {
    width: 30%;
    max-height: 230px;
    object-fit: cover;
    border-radius: 14px;
    transition: transform 0.4s ease;
    cursor: pointer;
}

.welcome img:hover {
    transform: scale(1.05);
}

.eyebrow {
    color: #210563;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 2.5px;
}

.welcome .eyebrow {
    color: #04060eea;
}

.welcome h1 {
    font-size: clamp(25px, 3vw, 38px);
    line-height: 1.0;
    margin: 10px 0;
    color: #63053f;
}

.welcome p {
    margin-bottom: 20px;
    color: #4016a9;
}

.welcome button {
    background: white;
    color: #5727a9;
    border: none;
    border-radius: 25px;
    padding: 11px 19px;
    font-weight: bold;
}

/* ===============================
   STATISTICS
================================ */

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 42px;
}

.stats article {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 19px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.stats article:hover {
    transform: translateY(-10px);
    background: linear-gradient(135deg, #b82d34, #a78bfa);
    border-color: #110e11;
    box-shadow: 0 25px 20px rgba(117, 70, 216, 0.25);
}

.stats article span {
    font-size: 30px;
    transition: transform 0.3s ease;
}

.stats article:hover span {
    color: rgb(191, 66, 66);
    transform: scale(1.15);
}

.stats h3 {
    color: var(--purple);
    font-size: 30px;
    transition: color 0.3s ease;
}

.stats p {
    color: var(--muted);
    font-size: 20px;
    transition: color 0.3s ease;
}

.stats article:hover h3,
.stats article:hover p {
    color: rgb(13, 9, 11);
}

/* ===============================
   SECTION HEADINGS
================================ */

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 19px;
}

.section-heading h2 {
    margin-top: 3px;
    font-size: 25px;
}

.section-heading > p {
    color: var(--muted);
    font-size: 14px;
}

/* ===============================
   COURSE CARDS
================================ */

.courses-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.course-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 15px;
    overflow: hidden;
    padding-bottom: 17px;
    box-shadow: 0 8px 24px rgba(72, 14, 165, 0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 8px 20px rgba(117, 70, 216, 0.18);
}

.course-card img {
    width: 100%;
    height: 165px;
    object-fit: cover;
    display: block;
}

.course-info {
    padding: 0 16px;
}

.course-card h3 {
    margin-top: 13px;
    font-size: 20px;
}

.course-card p {
    color: var(--muted);
    font-size: 15px;
    min-height: 42px;
    margin-top: 3px;
}

.course-rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #8cd088;
    color: #15803d;
    padding: 5px 11px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    margin: 10px 16px 8px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.course-rating:hover {
    transform: translateY(-10px);
}

.course-info button {
    width: 100%;
    background: var(--purple);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 12px;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
}

.course-info button:hover {
    transform: translateY(-8px);
    background: #5930b3;
}

/* ===============================
   QUIZ SECTION
================================ */

.quiz-section {
    margin-top: 40px;
    padding: 20px 0;
}

.quiz-section h2 {
    color: var(--text);
    margin-bottom: 10px;
}

.quiz-section > p {
    color: var(--muted);
    margin-bottom: 25px;
}

.quiz-section .section-heading {
    margin-bottom: 25px;
}

.quiz-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    width: 100%;
}

.quiz-card {
    background: var(--card);
    color: var(--text);
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
    border-color: var(--purple);
}

.quiz-card h3 {
    margin-bottom: 12px;
}

.quiz-card p {
    color: var(--muted);
    margin-bottom: 20px;
}

.quiz-card button {
    background: var(--purple);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-card button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 12px rgba(117,70,216,0.3);
}

.quiz-card button:active {
    transform: scale(0.95);
}

/* ===============================
   QUIZ POPUP
================================ */

.quiz-popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.quiz-popup.active {
    display: flex;
}

.quiz-popup[hidden] {
    display: none !important;
}

.quiz-box {
    background: var(--card);
    color: var(--text);
    width: 100%;
    max-width: 750px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
    border-radius: 15px;
    position: relative;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff4757;
    color: white;
    border: none;
    padding: 9px 12px;
    border-radius: 7px;
    cursor: pointer;
}

#quizTimer {
    position: sticky;
    top: 0;
    background: var(--card);
    color: #e63946;
    font-size: 18px;
    font-weight: bold;
    padding: 12px 0;
}

.quiz-question {
    background: var(--background);
    padding: 18px;
    border-radius: 10px;
    margin: 18px 0;
}

.quiz-question h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.quiz-question label {
    display: block;
    margin: 12px 0;
    cursor: pointer;
    color: var(--text);
}

.quiz-question input {
    accent-color: var(--purple);
    margin-right: 8px;
}

.quiz-box button,
#submitBtn {
    padding: 11px 20px;
    background: #7546d8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#quizResult {
    margin-top: 20px;
    font-size: 18px;
    font-weight: bold;
    color: var(--purple);
}

.answer-review {
    padding: 12px;
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* ===============================
   WEEKLY UPDATES
================================ */

.weekly-updates {
    margin-top: 42px;
    padding: 25px;
    background: linear-gradient(120deg, #f6e8ee, #f9d5e5);
    border: 1px solid #151310;
    border-radius: 16px;
    color: #13130d;
    transition: all 0.3s ease;
}

.weekly-updates:hover {
    transform: translateY(-15px);
    box-shadow: 0 6px 18px rgba(25, 21, 17, 0.15);
}

.weekly-updates h2 {
    color: #f96a23;
}

.weekly-updates p {
    color: #1a1a16;
}

.updates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.update-card {
    padding: 18px;
    border: 1px solid #28e1c5;
    border-radius: 12px;
    background: #cd7575;
    transition: all 0.3s ease;
}

.update-card:hover {
    transform: translateY(-15px);
    background: #5dbf24;
    box-shadow: 0 5px 12px rgba(255, 140, 0, 0.12);
}

.update-tag {
    display: inline-block;
    color: #15803d;
    background: #22c059;
    padding: 4px 9px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: bold;
}

.update-card h3 {
    margin: 12px 0 5px;
    font-size: 16px;
}

.update-card p {
    color: #07060b;
    font-size: 13px;
}

/* ===============================
   FOOTER
================================ */

.site-footer {
    background: #17152b;
    color: white;
    padding: 40px 6% 15px;
    margin-top: 48px;
}

.footer-container {
    max-width: 1200px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px;
}

.footer-column h2 {
    color: #a78bfa;
    margin-bottom: 12px;
}

.footer-column h3 {
    margin-bottom: 13px;
    font-size: 16px;
}

.footer-column p,
.footer-column a {
    color: #c7c5d8;
    line-height: 1.8;
    font-size: 13px;
}

.footer-column a {
    display: block;
    text-decoration: none;
    margin: 7px 0;
}

.footer-column a:hover {
    color: #a78bfa;
}

.footer-bottom {
    max-width: 1200px;
    margin: 28px auto 0;
    border-top: 1px solid #39364e;
    text-align: center;
    padding-top: 14px;
    color: #c7c5d8;
    font-size: 13px;
}

/* ===============================
   DIALOGS
================================ */

dialog {
    width: min(460px, calc(100% - 24px));
    max-height: 90vh;
    overflow: auto;
    margin: auto;
    padding: 25px;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 16px;
}

dialog::backdrop {
    background: rgba(25, 16, 44, .7);
}

dialog label:not(.setting-row) {
    display: block;
    margin-top: 12px;
    font-size: 14px;
}

dialog input:not([type="checkbox"]) {
    display: block;
    width: 100%;
    padding: 11px;
    margin-top: 5px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--background);
    color: var(--text);
}

dialog .close {
    float: right;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 20px;
}

dialog form .primary {
    width: 100%;
}

.error {
    color: #d94358;
    font-size: 13px;
    min-height: 18px;
}

.note {
    font-size: 11px;
    color: var(--muted);
    margin-top: 12px;
}

.link {
    background: transparent;
    border: none;
    color: var(--purple);
    margin-left: 5px;
}

/* ===============================
   PROFILE
================================ */

.profile-avatar {
    font-size: 45px;
    margin-top: 15px;
}

#profileEmail {
    color: var(--muted);
    margin-bottom: 12px;
}

#profileDialog hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 13px 0;
}

/* ===============================
   SETTINGS
================================ */

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

/* ===============================
   VIDEO
================================ */

.video-dialog {
    width: min(850px, calc(100% - 24px));
}

#videoPlayer iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 10px;
    margin: 15px 0;
    background: #111;
}

/* ===============================
   NOTIFICATIONS
================================ */

.notification {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.notification p {
    font-size: 13px;
    color: var(--muted);
}

.notification.unread strong::before {
    content: "● ";
    color: var(--purple);
}

/* ===============================
   COURSE DETAILS
================================ */

#coursesSection,
#detailsSection {
    scroll-margin-top: 90px;
}

/* ===============================
   GLOBAL HIDDEN
================================ */

[hidden] {
    display: none !important;
}

/* ===============================
   TABLET RESPONSIVE
================================ */

@media (max-width: 900px) {

    .courses-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quiz-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }

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

/* ===============================
   MOBILE RESPONSIVE
================================ */

@media (max-width: 600px) {

    .navbar {
        align-items: flex-start;
        padding: 14px;
    }

    .navbar input {
        order: 3;
        width: 100%;
        min-width: 0;
    }

    .nav-buttons {
        width: 100%;
    }

    .nav-buttons button {
        flex: 1;
        padding: 8px 5px;
        font-size: 12px;
    }

    main {
        padding: 17px 13px;
    }

    .welcome {
        padding: 22px;
    }

    .welcome img {
        display: none;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stats article {
        padding: 12px;
    }

    .courses-container {
        grid-template-columns: 1fr;
    }

    .quiz-container {
        grid-template-columns: 1fr;
    }

    .course-card img {
        height: 190px;
    }

    .section-heading {
        display: block;
    }

    .section-heading > p {
        margin-top: 5px;
    }

    .weekly-updates {
        padding: 17px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .lesson-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .quiz-box {
        padding: 22px 16px;
    }

    dialog {
        padding: 18px;
    }
}

/* ===============================
   COURSE DETAILS PAGE
================================ */

#detailsSection {
    padding: 30px;
    background: var(--background);
    border-radius: 18px;
}

#backBtn {
    background: #122ac8;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    margin-bottom: 20px;
    transition: 0.3s;
}

#backBtn:hover {
    background: #e814cc;
    transform: translateY(-5px);
}

.course-detail-card {
    background: var(--card);
    color: var(--text);
    border: 2px solid #e814cc;
    border-radius: 18px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 5px 18px rgba(18, 42, 200, 0.15);
    transition: 0.3s;
}

.course-detail-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(18, 42, 200, 0.25);
}

.course-detail-card h2 {
    color: #122ac8;
    margin-bottom: 12px;
}

.course-detail-card p {
    color: var(--muted);
    margin-bottom: 10px;
}

.course-meta {
    color: #a0008f;
    font-weight: bold;
    margin: 12px 0;
}

/* LESSON LIST */

.lesson-list {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.lesson-item {
    background: #eee8ff;
    color: #151321;
    border-left: 6px solid #122ac8;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    transition: 0.3s;
}

.lesson-item:hover {
    background: #fbd8f3;
    border-left-color: #e814cc;
    transform: translateX(8px);
}

.lesson-item.completed {
    background: #d8f8d5;
    border-left-color: #22a237;
}

.lesson-item button {
    background: linear-gradient(120deg, #122ac8, #9563ed);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    transition: 0.3s;
}

.lesson-item button:hover {
    background: #e814cc;
    transform: translateY(-4px);
}

/* COURSE PROGRESS */

.progress {
    background: #ded5f5;
    height: 12px;
    border-radius: 20px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-bar {
    background: linear-gradient(90deg, #22a237, #9563ed);
    height: 100%;
    border-radius: 20px;
    transition: width 0.5s;
}

/* ===============================
   QUIZ POPUP DESIGN
================================ */

.quiz-popup[hidden] {
    display: none !important;
}

.quiz-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(20, 10, 50, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.quiz-popup.active {
    display: flex;
}

.quiz-box {
    background: var(--card);
    color: var(--text);
    width: 100%;
    max-width: 750px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    border-radius: 20px;
    border: 3px solid #e814cc;
    box-shadow: 0 10px 35px rgba(18, 42, 200, 0.4);
    animation: quizOpen 0.4s ease;
}

@keyframes quizOpen {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.quiz-box h2 {
    color: #122ac8;
    text-align: center;
    margin-bottom: 15px;
}

#quizTimer {
    background: #fbd8f3;
    color: #a0008f;
    padding: 10px 18px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 20px;
}

#quizQuestions {
    display: grid;
    gap: 18px;
}

#quizQuestions > div {
    background: #eee8ff;
    color: #151321;
    border-left: 5px solid #122ac8;
    border-radius: 12px;
    padding: 18px;
    transition: 0.3s;
}

#quizQuestions > div:hover {
    background: #fbd8f3;
    border-left-color: #e814cc;
    transform: translateY(-4px);
}

#quizQuestions label {
    display: block;
    margin: 10px 0;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

#quizQuestions label:hover {
    background: #d8caff;
}

#quizQuestions input[type="radio"] {
    margin-right: 10px;
    accent-color: #122ac8;
}

#submitBtn {
    background: linear-gradient(120deg, #122ac8, #9563ed);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 13px 28px;
    margin-top: 20px;
    cursor: pointer;
    font-size: 16px;
    transition: 0.3s;
}

#submitBtn:hover {
    background: #e814cc;
    transform: translateY(-5px);
}

#quizResult {
    background: #d8f8d5;
    color: #176b20;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    font-weight: bold;
}
