/* COLOURS AND BASE */
:root {
    --blue: #315b87;
    --blue-dark: #21466f;
    --blue-soft: #e8f1fc;
    --blue-line: #c8dcf5;
    --yellow: #ffe28a;
    --yellow-soft: #fff5cf;
    --yellow-line: #edcf69;
    --white: #ffffff;
    --text: #263d5d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: Arial, "Myanmar Text", sans-serif;
    background: #f4f8ff;
    color: var(--text);
    line-height: 1.8;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease; }

/* TOP BANNER */
.site-banner {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    color: var(--white);
    text-align: center;
    background: url("images/top-banner.jpg") center / cover no-repeat, linear-gradient(110deg, #315b87, #83acd4);
    text-shadow: 0 2px 5px #183e6866;
}
.site-banner h1 { font-size: clamp(24px, 3vw, 34px); line-height: 1.35; }
.site-banner p { margin-top: 4px; color: #f4f8ff; font-size: clamp(14px, 1.8vw, 18px); }

/* NAVIGATION AND DROPDOWN */
.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    background: var(--blue-dark);
    box-shadow: 0 3px 10px #183c6122;
}
.nav-btn {
    padding: 8px 15px;
    border: 1px solid #ffffff66;
    border-radius: 22px;
    background: transparent;
    color: var(--white);
    font: inherit;
}
.nav-btn:hover, .nav-btn.active, .dropdown.open > .nav-btn {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--blue-dark);
}
.dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 190px;
    padding: 8px;
    border: 1px solid #ffffff35;
    border-radius: 12px;
    background: var(--blue-dark);
    box-shadow: 0 8px 20px #1c3e6030;
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.open .dropdown-menu { display: grid; gap: 5px; }
.dropdown-menu .nav-btn { width: 100%; border-radius: 8px; text-align: left; }

/* PAGE LAYOUT AND TRANSITIONS */
.container { width: min(94%, 1180px); min-height: 500px; margin: 26px auto; }
.page { display: none; }
.page.active { display: block; animation: page-in .28s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.hero, .banner-title {
    color: var(--white);
    border-radius: 16px;
    background: linear-gradient(90deg, #173b65d9, #24588a55), url("images/banner-blue.png") center / cover;
}
.hero { display: flex; align-items: center; min-height: 300px; padding: clamp(20px, 4vw, 38px); }
.hero div { max-width: 650px; }
.hero h2 { margin-bottom: 10px; font-size: clamp(22px, 3vw, 30px); line-height: 1.5; }
.hero p { margin-bottom: 18px; }
.banner-title { margin-bottom: 20px; padding: 24px; }
.section-title { margin: 25px 0 18px; padding-left: 12px; border-left: 5px solid var(--yellow-line); color: var(--blue); }

/* HOME AND LESSON CARDS */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.card, .content-box, .quiz-box, .video-card {
    min-width: 0;
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid var(--blue-line);
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 4px 14px #365c8512;
}
.card { border-bottom: 4px solid var(--yellow-line); }
.card:nth-child(1) .card-emoji { background: var(--blue-soft); }
.card:nth-child(2) .card-emoji { background: var(--yellow-soft); }
.card:nth-child(3) .card-emoji { background: #f1f6ff; }
.card-emoji { display: flex; justify-content: center; align-items: center; height: 130px; margin-bottom: 10px; border-radius: 12px; font-size: 72px; }
.card h3, .content-box h3, .video-card h3 { margin-bottom: 8px; color: var(--blue); }
.card p, .content-box p { margin: 9px 0; }
.wide-image { width: 100%; max-height: 300px; margin-bottom: 14px; border-radius: 12px; object-fit: cover; }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.topic-card { margin: 0; padding: 18px; }
.topic-body { display: grid; grid-template-columns: minmax(120px, .85fr) minmax(0, 1.15fr); align-items: start; gap: 14px; }
.topic-image { display: block; width: 100%; height: 185px; border: 1px solid var(--blue-line); border-radius: 10px; background: var(--blue-soft); object-fit: contain; }
.topic-text p { margin: 0 0 10px; }

/* BUTTONS */
.main-btn, .card button, .pager button, #next-btn, #restart-btn, #check-fill, .video-card a {
    display: inline-block;
    padding: 9px 17px;
    border: 1px solid var(--yellow-line);
    border-radius: 22px;
    background: var(--yellow);
    color: var(--blue-dark);
    text-decoration: none;
    font-weight: 600;
}
.main-btn:hover, .card button:hover, .pager button:hover, #next-btn:hover:not(:disabled), #restart-btn:hover, #check-fill:hover, .video-card a:hover {
    background: #ffedb3;
    box-shadow: 0 3px 9px #385c8120;
    transform: translateY(-1px);
}
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin: 24px 0; }

/* COMPARISON TABLE */
.content-box { overflow-x: auto; }
table { width: 100%; min-width: 560px; border-collapse: collapse; }
th, td { padding: 11px; border: 1px solid var(--blue-line); text-align: center; }
th { background: var(--blue); color: var(--white); }
tr:nth-child(even) { background: var(--blue-soft); }

/* VIDEO PAGE */
.video-intro { margin-bottom: 16px; }
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.video-card { margin: 0; }
.video-icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 10px; border-radius: 14px; background: var(--yellow-soft); font-size: 30px; }
.video-card a { margin-top: 8px; }

/* QUIZ GUIDE AND CATEGORY BUTTONS */
.quiz-guide { margin: 14px 0; padding: 13px 16px; border: 1px solid var(--blue-line); border-left: 5px solid var(--yellow-line); border-radius: 12px; background: var(--blue-soft); }
.quiz-guide h3 { margin-bottom: 4px; color: var(--blue); }
.quiz-tabs { display: flex; flex-wrap: nowrap; gap: 7px; margin: 14px 0; padding: 4px 2px 8px; overflow-x: auto; }
.quiz-tab { flex: 1 0 auto; padding: 7px 11px; border: 1px solid var(--yellow-line); border-radius: 18px; background: var(--yellow-soft); color: var(--blue-dark); font-size: 13px; font-weight: 700; white-space: nowrap; }
.quiz-tab:hover, .quiz-tab.active { background: var(--yellow); border-color: #d5ad3e; }
.quiz-box[hidden], #fill-area[hidden] { display: none; }
.quiz-box h3 { color: var(--blue); }
.quiz-box > p:first-of-type { margin-top: 12px; }
.answers { display: grid; gap: 9px; margin: 17px 0; }
.quiz-box .answer-btn { width: 100%; padding: 11px 14px; border: 1px solid var(--yellow-line); border-radius: 10px; background: var(--yellow-soft); color: var(--text); text-align: left; }
.quiz-box .answer-btn:hover:not(:disabled) { background: var(--yellow); }
/* Feedback colours remain within the requested blue, yellow and white palette. */
.quiz-box .answer-btn.correct { border-color: var(--blue); background: var(--blue-soft); }
.quiz-box .answer-btn.wrong { border-color: #d4ad3d; background: #ffedb3; }
#fill-area { display: flex; flex-wrap: wrap; gap: 9px; margin: 16px 0; }
#fill-answer { flex: 1; min-width: 180px; padding: 10px; border: 1px solid var(--blue-line); border-radius: 10px; background: var(--white); color: var(--text); }
#feedback, #score { margin: 12px 0; font-weight: 700; }

/* FOOTER */
.footer { margin-top: 34px; padding: 22px 14px; background: var(--blue-dark); color: var(--white); text-align: center; }
.footer p + p { margin-top: 5px; }

/* TABLET AND MOBILE */
@media (max-width: 760px) {
    .site-banner { min-height: 120px; padding: 18px 12px; background-position: center; }
    .navbar { position: relative; gap: 6px; padding: 9px 7px; }
    .nav-btn { padding: 7px 10px; font-size: 13px; }
    .dropdown-menu { min-width: 180px; }
    .container { width: 94%; margin: 18px auto; }
    .topic-grid, .video-grid { grid-template-columns: 1fr; }
    .topic-body { grid-template-columns: 1fr; }
    .topic-image { height: 210px; }
    .hero { min-height: 240px; }
    .card-grid { grid-template-columns: repeat(3, minmax(190px, 1fr)); overflow-x: auto; padding-bottom: 8px; }
    .quiz-tabs { justify-content: flex-start; }
}

@media (max-width: 480px) {
    .site-banner { min-height: 105px; }
    .navbar { justify-content: center; }
    .dropdown-menu { left: 50%; transform: translateX(-50%); }
    .hero { padding: 18px; }
    .hero h2 { font-size: 21px; }
    .card, .content-box, .quiz-box, .video-card { padding: 16px; }
    .quiz-tab { padding: 7px 9px; font-size: 12px; }
    .pager { gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* IMAGE FALLBACKS */
.image-placeholder {
    display: grid;
    place-items: center;
    min-height: 150px;
    border: 1px solid var(--blue-line);
    border-radius: 10px;
    background: linear-gradient(135deg, var(--blue-soft), #ffffff);
    font-size: clamp(48px, 7vw, 76px);
}
.topic-image.image-placeholder { height: 185px; }
.wide-image.image-placeholder { height: 240px; max-height: 300px; }
@media (max-width: 760px) { .topic-image.image-placeholder { height: 210px; } }
