@import url("https://fonts.googleapis.com/css2?family=Changa+One:ital@0;1&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

* {
  box-sizing: border-box;
}

img,
svg,
video {
  max-width: 100%;
}

/* Native selects styled to match UI (used with label + chevron icon) */
.site-select-wrap {
  position: relative;
  display: block;
  width: 100%;
}

/* Hero row: full-width selects on small screens; compact pills from sm+ */
.site-select-wrap.site-select-wrap--fit,
.site-select-wrap.site-select-wrap--fit-wide {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

@media (min-width: 640px) {
  .site-select-wrap.site-select-wrap--fit {
    width: auto;
    flex: 0 0 auto;
    min-width: 7.25rem;
    max-width: 11rem;
  }

  .site-select-wrap.site-select-wrap--fit-wide {
    width: auto;
    flex: 0 0 auto;
    min-width: 8.5rem;
    max-width: 13rem;
  }
}

.site-select-wrap .site-select-chevron {
  pointer-events: none;
  position: absolute;
  right: 1rem;
  top: 50%;
  translate: 0 -50%;
  font-size: 0.75rem;
  line-height: 1;
  color: #262626;
}

.site-select {
  width: 100%;
  appearance: none;
  border: 0;
  outline: none;
  cursor: pointer;
}

.site-select:focus-visible {
  box-shadow: 0 0 0 2px rgba(56, 239, 8, 0.45);
}

.site-select--brand {
  min-height: 3.25rem;
  border-radius: 15px;
  background-color: var(--color-brand-accent, #38ef08);
  padding: 0.75rem 2.75rem 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: #135601;
}

@media (min-width: 640px) {
  .site-select--brand {
    font-size: 1.125rem;
  }
}

.dark .site-select--brand {
  color: #0a2e00;
}

.site-select--white {
  min-height: 3rem;
  border-radius: 1rem;
  background-color: #fff;
  padding: 0.625rem 2.5rem 0.625rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: #1a1a1a;
}

@media (min-width: 640px) {
  .site-select--white {
    font-size: 1.125rem;
    min-height: 3.25rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
}

/* Hero filters: keep white pills in dark mode (matches design) */
.dark .site-select--white {
  background-color: #fff;
  color: #1a1a1a;
}

.site-select--white option {
  color: #1a1a1a;
  background-color: #fff;
}

.site-select--white option:disabled {
  color: #8c8989;
}

.dark .site-select-wrap .site-select-chevron--on-dark {
  color: #e4e4e4;
}

/* Practice / Learn hero: search + selects sync with light & dark */
.hero-search-field {
  color: #6b7280;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dark .hero-search-field {
  color: #9ca3af;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.hero-search-field:focus-within {
  border-color: rgba(56, 239, 8, 0.45);
}

.site-select--hero {
  min-height: 3.25rem;
  border-radius: 1rem;
  padding: 0.625rem 2.5rem 0.625rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  background-color: #fff;
  color: #1a1a1a;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

@media (min-width: 640px) {
  .site-select--hero {
    font-size: 1.125rem;
  }
}

.dark .site-select--hero {
  background-color: rgba(20, 20, 20, 0.92);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f3f4f6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.site-select--hero option {
  color: #1a1a1a;
  background-color: #fff;
}

.dark .site-select--hero option {
  color: #f3f4f6;
  background-color: #1a1a1a;
}

.site-select--hero option:disabled {
  color: #8c8989;
}

.dark .site-select--hero option:disabled {
  color: #9ca3af;
}

/* Curriculum accordion (course details) */
.curriculum-details > summary {
  list-style: none;
}

.curriculum-details > summary::-webkit-details-marker {
  display: none;
}

.curriculum-details[open] .curriculum-chevron {
  transform: rotate(180deg);
}

/* Practice Lab: full leaderboard overlay (replaces <dialog> for reliable close) */
.leaderboard-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.leaderboard-modal-overlay.leaderboard-modal--open {
  display: flex;
}

.leaderboard-modal-panel {
  width: min(52rem, calc(100vw - 2rem));
  max-height: min(90vh, 720px);
}

/* Interactive buttons site-wide */
button,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"],
.site-btn {
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease,
    filter 0.2s ease;
}

button:disabled,
[role="button"][aria-disabled="true"] {
  cursor: not-allowed;
}

button:not(:disabled):hover,
[role="button"]:not([aria-disabled="true"]):hover {
  filter: brightness(1.03);
}

/* Site header: light / dark sync */
body.light [data-site-header] .site-header-dropdown {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(56, 239, 8, 0.35);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
}

body.light [data-site-header] .site-header-dropdown a {
  color: #0d0d0d;
}

body.light [data-site-header] .site-header-dropdown a:hover,
body.light [data-site-header] .site-header-dropdown a:focus-visible {
  background: rgba(56, 239, 8, 0.12);
  color: #135601;
}

body.light [data-site-header] .site-mobile-nav details summary {
  color: inherit;
}

body.light [data-site-header] .site-mobile-nav a.rounded-lg {
  color: #0d0d0d;
}

body.light [data-site-header] .site-mobile-nav a.rounded-lg:hover,
body.light [data-site-header] .site-mobile-nav a.rounded-lg:focus-visible {
  color: #135601;
}

body.light [data-site-header] .site-theme-toggle .font-bold {
  color: #0d0d0d;
}

/* YouTube embed cards (home live section) */
.youtube-embed-card {
  overflow: hidden;
  border-radius: 15px 15px 0 0;
}

.youtube-embed-card__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0d0d0d;
}

.youtube-embed-card__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Custom dropdown (replaces native select UI) */
.site-select-wrap.is-custom .site-select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-select-wrap.is-custom > .site-select-chevron {
  display: none;
}

.custom-dropdown {
  position: relative;
  width: 100%;
}

.custom-dropdown__trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  cursor: pointer;
}

.custom-dropdown__trigger .fa-chevron-down {
  flex-shrink: 0;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.custom-dropdown.is-open .custom-dropdown__trigger .fa-chevron-down {
  transform: rotate(180deg);
}

.custom-dropdown__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 60;
  max-height: min(16rem, 50vh);
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border-radius: 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}

.dark .custom-dropdown__menu {
  border-color: rgba(255, 255, 255, 0.12);
  background: #141414;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.custom-dropdown__menu[hidden] {
  display: none;
}

.custom-dropdown__option {
  width: 100%;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-weight: 500;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.custom-dropdown__option:hover,
.custom-dropdown__option:focus-visible {
  background: rgba(56, 239, 8, 0.14);
  color: #135601;
  outline: none;
}

.dark .custom-dropdown__option:hover,
.dark .custom-dropdown__option:focus-visible {
  color: #afff8f;
}

.custom-dropdown__option.is-selected {
  background: rgba(56, 239, 8, 0.2);
  font-weight: 600;
}

.custom-dropdown--brand .custom-dropdown__trigger {
  min-height: 3.25rem;
  border-radius: 15px;
  background-color: var(--color-brand-accent, #38ef08);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: #135601;
}

#course-filters .custom-dropdown--brand .custom-dropdown__trigger {
  min-height: 3rem;
}

@media (min-width: 1024px) {
  #course-filters .custom-dropdown--brand .custom-dropdown__trigger {
    min-height: 3.3125rem;
    font-size: 1.375rem;
  }
}

.custom-dropdown--hero .custom-dropdown__trigger {
  min-height: 3.25rem;
  border-radius: 1rem;
  padding: 0.625rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  background-color: #fff;
  color: #1a1a1a;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dark .custom-dropdown--hero .custom-dropdown__trigger {
  background-color: rgba(20, 20, 20, 0.92);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f3f4f6;
}

/* Dashboard: responsive layout without clipping root */
[data-dashboard-layout] {
  width: 100%;
  max-width: 100%;
}

[data-dashboard-layout] [data-dashboard-main] {
  min-width: 0;
  flex: 1 1 auto;
  width: 100%;
}

[data-dashboard-layout] [data-dashboard-content] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

[data-dashboard-layout] [data-dashboard-sidebar] {
  width: min(20rem, calc(100vw - 1.25rem));
  flex-shrink: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

@media (min-width: 640px) and (max-width: 1023px) {
  [data-dashboard-layout] [data-dashboard-sidebar] {
    width: 20rem;
  }
}

@media (min-width: 1024px) {
  [data-dashboard-layout] [data-dashboard-sidebar] {
    width: 20rem;
    min-width: 20rem;
    max-width: 20rem;
  }

  [data-dashboard-layout] > .flex {
    align-items: stretch;
  }
}

[data-dashboard-header] {
  min-width: 0;
  max-width: 100%;
}

[data-dashboard-layout] .dashboard-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1023px) {
  body.dashboard-notification-open {
    overflow: hidden;
  }
}
