.sidebar {
  background-color: #fff;
  border-right: 1px solid #ececf0;
  padding: 40px 26px;
  display: flex;
  flex-direction: column;
  gap: 38px;
}

.brand {
  display: flex;
  gap: 0;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  height: 90px;
  max-width: 220px;
  width: auto;
  border-radius: 12px;
  display: block;
  object-fit: contain;
}

.brand-text {
  display: none;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #9d8a8a;
}

.brand-name {
  display: block;
  font-weight: 700;
  color: #c51b2a;
}

.brand-url {
  color: #a0a0b0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nav-item {
  position: relative;
  border: 1px solid transparent;
  background-color: #fff;
  border-radius: 20px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 15px;
  color: #352525;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.nav-item img {
  width: 48px;
  height: 48px;
  border-radius: 0;
  background-color: transparent;
  padding: 0;
}

.nav-item.active {
  border-color: #d4ddff;
  box-shadow: 0 0 0 4px #eef3ff;
}

.nav-item.active img {
  opacity: 0.8;
}

.nav-badge {
  margin-left: auto;
  background-color: #ff4d4f;
  color: #fff;
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 10px;
}

/* =========================
   RESPONSIVE NAV (tablet/iPad + phone)
   Only 3 nav items exist (Dashboard/Courses/Settings), so instead of an
   off-canvas hamburger drawer, the sidebar becomes a sticky horizontal
   top bar that keeps all items visible and reachable with one tap.
========================= */
@media (max-width: 1024px) {
  .sidebar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-right: none;
    border-bottom: 1px solid #ececf0;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .brand-logo {
    height: 44px;
    max-width: 120px;
  }

  .sidebar-nav {
    flex-direction: row;
    flex: 1 1 auto;
    justify-content: center;
    gap: 8px;
  }

  .nav-item {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 12px;
    min-width: 56px;
    min-height: 44px;
    font-size: 11px;
    text-align: center;
  }

  .nav-item img {
    width: 28px;
    height: 28px;
  }

  .sidebar-mascot {
    display: none;
  }
}

/* =========================
   PHONE: bottom tab bar
   Below iPad width, drop the top bar in favor of a fixed bottom tab bar
   (iOS/Duolingo-style) — it's within thumb reach and matches how every
   native mobile app on the platform places primary navigation.
========================= */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-around;
    gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    border-bottom: none;
    border-top: 1px solid #ececf0;
    box-shadow: 0 -2px 16px rgba(20, 20, 30, 0.06);
    z-index: 200;
  }

  /* Brand/logo isn't shown in a bottom tab bar (no native app does this) */
  .brand {
    display: none;
  }

  .sidebar-nav {
    flex: 1 1 auto;
    justify-content: space-around;
    gap: 0;
  }

  .nav-item {
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    padding: 6px 4px;
    font-size: 11px;
  }

  .nav-item img {
    width: 24px;
    height: 24px;
  }

  .nav-badge {
    position: absolute;
    top: 0;
    right: 18%;
    padding: 2px 6px;
    font-size: 10px;
  }
}

/* Every page's main content lives in a <main>, and the fixed bottom bar
   would otherwise sit on top of its last ~60px — reserve clearance here
   once instead of in every page's own stylesheet. */
@media (max-width: 768px) {
  main {
    padding-bottom: 76px;
  }
}
.sidebar-mascot {
  margin-top: auto;
  text-align: center;
  padding-top: 12px;
}

.sidebar-mascot img {
  width: 120px;
  aspect-ratio: 753 / 800;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
