﻿/**
 * Udemy-style header: logo | nav | centered search | prominent auth buttons
 * Uses theme tokens: --tg-theme-primary, --tg-theme-secondary (see main.css :root)
 */

:root {
  --xl-header-logo-height: 58px;
  --xl-header-logo-max-width: 280px;
  --xl-header-nav-min-height: 72px;
}

@media (max-width: 1199.98px) {
  :root {
    --xl-header-logo-height: 52px;
    --xl-header-logo-max-width: 240px;
    --xl-header-nav-min-height: 68px;
  }
}

@media (max-width: 767.98px) {
  :root {
    --xl-header-logo-height: 44px;
    --xl-header-logo-max-width: 204px;
    --xl-header-nav-min-height: 64px;
  }
}

/* Shared header + mobile drawer logo sizing */
.tg-header__area .tgmenu__nav--udemy .tgmenu__brand-browse .tgmenu__brand .logo img,
.tg-header__area .tgmenu__nav--udemy .tgmenu__brand .logo img,
header .logo img,
header .nav-logo img,
.tgmobile__menu .nav-logo img {
  display: block !important;
  height: var(--xl-header-logo-height) !important;
  width: auto !important;
  max-height: var(--xl-header-logo-height) !important;
  max-width: var(--xl-header-logo-max-width) !important;
  object-fit: contain !important;
  object-position: left center !important;
}

/* Restore header bar height (theme default was ~74px+ with nav link padding) */
header > .tg-header__area {
  padding: 10px 0 !important;
}
@media (max-width: 1199.98px) {
  header > .tg-header__area {
    padding: 18px 0 !important;
  }
}
header > .tg-header__area.sticky-menu {
  padding: 8px 0 !important;
}
@media (max-width: 1199.98px) {
  header > .tg-header__area.sticky-menu {
    padding: 8px 0 !important;
  }
}

/* Main nav bar layout */
.tg-header__area .tgmenu__nav--udemy {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem 1.5rem;
  align-items: center;
  width: 100%;
  min-height: var(--xl-header-nav-min-height);
}
@media (max-width: 1199.98px) {
  .tg-header__area .tgmenu__nav--udemy {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand actions";
    gap: 1rem;
  }
}
@media (max-width: 767.98px) {
  .tg-header__area .tgmenu__nav--udemy {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand actions";
  }
}

.tg-header__area .tgmenu__nav--udemy .tgmenu__brand-browse {
  min-width: max-content;
  flex-shrink: 0;
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
  min-width: 0;
}
@media (max-width: 1199.98px) {
  .tg-header__area .tgmenu__nav--udemy .tgmenu__brand-browse {
  min-width: max-content;
  flex-shrink: 0;
    grid-area: brand;
  }
}
.tg-header__area .tgmenu__nav--udemy .tgmenu__brand-browse .tgmenu__brand .logo {
  display: block;
  line-height: 0;
}

/* Browse subjects — icon button next to logo */
.tg-header__area .tgmenu__browse-wrap {
  flex-shrink: 0;
}
.tg-header__area .tgmenu__browse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--tg-theme-primary);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.tg-header__area .tgmenu__browse-icon {
  display: block;
}
.tg-header__area .tgmenu__browse-btn:hover,
.tg-header__area .tgmenu__browse-btn:focus-visible {
  background: rgba(232, 90, 28, 0.1);
  color: var(--tg-theme-primary);
  outline: none;
}
.tg-header__area.tg-header__area--browse-open .tgmenu__browse-btn {
  background: rgba(232, 90, 28, 0.14);
  color: var(--tg-theme-primary);
}

/* Full-width mega panel below header bar */
.tg-header__area .tgmenu__browse-flyout {
  position: relative;
  z-index: 100;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
  padding: 1.75rem 0 1.5rem;
}
.tg-header__area .tgmenu__browse-rows {
  margin-bottom: 0;
}
.tg-header__area .tgmenu__browse-col-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.65rem;
  line-height: 1.25;
}
.tg-header__area .tgmenu__browse-col-title a {
  color: #0f172a;
  text-decoration: none;
}
.tg-header__area .tgmenu__browse-col-title a:hover {
  color: var(--tg-theme-primary);
}
.tg-header__area .tgmenu__browse-sublist {
  margin: 0;
  padding: 0;
  list-style: none;
}
.tg-header__area .tgmenu__browse-sublist li {
  margin: 0 0 0.4rem;
}
.tg-header__area .tgmenu__browse-sublist a {
  font-size: 0.9rem;
  color: #475569;
  text-decoration: none;
  line-height: 1.4;
}
.tg-header__area .tgmenu__browse-sublist a:hover {
  color: var(--tg-theme-primary);
  text-decoration: underline;
}
.tg-header__area .tgmenu__browse-col-desc {
  margin: 0;
  font-size: 0.875rem;
}
.tg-header__area .tgmenu__browse-col-desc a {
  color: var(--tg-theme-primary);
  font-weight: 600;
}
.tg-header__area .tgmenu__browse-panel-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}
.tg-header__area .tgmenu__browse-all-link {
  display: inline-block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--tg-theme-primary);
  text-decoration: none;
}
.tg-header__area .tgmenu__browse-all-link:hover {
  text-decoration: underline;
}

/* Mobile slide-out: browse subjects */
.tgmobile__browse {
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 0.5rem;
}
.tgmobile__browse-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin: 0 0 0.75rem;
}
.tgmobile__browse-group {
  margin-bottom: 1rem;
}
.tgmobile__browse-parent {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
  text-decoration: none;
  margin-bottom: 0.35rem;
}
.tgmobile__browse-parent:hover {
  color: var(--tg-theme-primary);
}
.tgmobile__browse-subs {
  margin: 0;
  padding: 0 0 0 0.75rem;
  list-style: none;
  border-left: 2px solid #e2e8f0;
}
.tgmobile__browse-subs li {
  margin: 0.25rem 0;
}
.tgmobile__browse-subs a {
  font-size: 0.88rem;
  color: #475569;
  text-decoration: none;
}
.tgmobile__browse-subs a:hover {
  color: var(--tg-theme-primary);
}
.tgmobile__browse-all {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--tg-theme-primary);
}

.tg-header__area .tgmenu__nav--udemy .tgmenu__links {
  grid-column: 2;
  justify-self: center;
}
@media (max-width: 1199.98px) {
  .tg-header__area .tgmenu__nav--udemy .tgmenu__links {
    display: none !important;
  }
}
.tg-header__area .tgmenu__nav--udemy .tgmenu__links .navigation {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.tg-header__area .tgmenu__nav--udemy .tgmenu__links .navigation li {
  list-style: none;
}
.tg-header__area .tgmenu__nav--udemy .tgmenu__links .navigation li a {
  padding: 0.75rem 0.85rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1c1d1f;
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.tg-header__area .tgmenu__nav--udemy .tgmenu__links .navigation li a:hover,
.tg-header__area .tgmenu__nav--udemy .tgmenu__links .navigation li.active a {
  color: var(--tg-theme-primary);
}
.tg-header__area .tgmenu__nav--udemy .tgmenu__links .navigation li.header-btn,
.tg-header__area .tgmenu__nav--udemy .tgmenu__links .navigation li.login-btn {
  display: none;
}

/* Auth + mobile toggler */
.tg-header__area .tgmenu__nav--udemy .tgmenu__actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-self: end;
}
@media (max-width: 1199.98px) {
  .tg-header__area .tgmenu__nav--udemy .tgmenu__actions {
    grid-column: auto;
    grid-area: actions;
  }
}
.tg-header__area .tgmenu__nav--udemy .tgmenu__auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
@media (max-width: 767.98px) {
  .tg-header__area .tgmenu__nav--udemy .tgmenu__actions {
    grid-area: actions;
  }
}
.tg-header__area .tgmenu__nav--udemy .mobile-nav-toggler {
  padding: 0.55rem;
  cursor: pointer;
  color: var(--tg-theme-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
}
.tg-header__area .tgmenu__nav--udemy .mobile-nav-toggler:hover {
  background: rgba(39, 134, 136, 0.08);
}
/* Get Started CTA (replaces separate Log in / Sign up) */
.tg-header__area .tgmenu__nav--udemy .tgmenu__auth .btn-get-started {
  padding: 0.55rem 1.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--tg-theme-primary);
  text-decoration: none;
  border: 2px solid var(--tg-theme-primary);
  border-radius: 4px;
  white-space: nowrap;
  transition: background 0.2s, filter 0.2s;
}
.tg-header__area .tgmenu__nav--udemy .tgmenu__auth .btn-get-started:hover {
  filter: brightness(0.95);
  color: #fff;
}
.tg-header__area .tgmenu__nav--udemy .mobile-login-btn .btn-get-started--compact {
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
}
.tg-header__area .tgmenu__nav--udemy .tgmenu__auth .btn-user {
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1c1d1f;
  text-decoration: none;
  border: 1px solid #d1d7dc;
  border-radius: 4px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tg-header__area .tgmenu__nav--udemy .tgmenu__auth .btn-user:hover {
  border-color: var(--tg-theme-primary);
}
.tg-header__area .tgmenu__nav--udemy .tgmenu__auth .btn-logout {
  padding: 0.55rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1c1d1f;
  text-decoration: none;
  transition: color 0.2s;
}
.tg-header__area .tgmenu__nav--udemy .tgmenu__auth .btn-logout:hover {
  color: var(--tg-theme-primary);
}

/* Logged-in header: center nav links when visible */
.tg-header__area .tgmenu__nav--udemy.tgmenu__nav--auth .tgmenu__links {
  justify-self: center;
}
@media (max-width: 1199.98px) {
  .tg-header__area .tgmenu__nav--udemy.tgmenu__nav--auth .tgmenu__links {
    display: none !important;
  }
}

/* User avatar menu */
.os-user-menu {
  position: relative;
}
.os-user-menu__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.2rem 0.35rem 0.2rem 0.2rem;
  border: 1px solid #e4dfd6;
  border-radius: 999px;
  background: #fff;
  color: #14141a;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.os-user-menu__toggle:hover,
.os-user-menu.is-open .os-user-menu__toggle {
  border-color: rgba(232, 90, 28, 0.45);
  box-shadow: 0 4px 16px rgba(14, 16, 24, 0.08);
}
.os-user-menu__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.os-user-menu__avatar--lg {
  width: 48px;
  height: 48px;
}
.os-user-menu__avatar--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}
.os-user-menu__avatar--initials.is-a { background: linear-gradient(135deg, #e85a1c, #c44814); }
.os-user-menu__avatar--initials.is-b { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.os-user-menu__avatar--initials.is-c { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.os-user-menu__avatar--initials.is-d { background: linear-gradient(135deg, #0d9488, #0f766e); }
.os-user-menu__avatar--initials.is-e { background: linear-gradient(135deg, #db2777, #be185d); }
.os-user-menu__avatar--initials.is-f { background: linear-gradient(135deg, #ca8a04, #a16207); }
.os-user-menu__name {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 600;
}
.os-user-menu__chevron {
  color: #5c6170;
  flex-shrink: 0;
}
.os-user-menu__panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 15rem;
  background: #fffefc;
  border: 1px solid #e4dfd6;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(14, 16, 24, 0.12);
  padding: 0.45rem 0;
  z-index: 120;
}
.os-user-menu__panel[hidden] {
  display: none !important;
}
.os-user-menu__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem 0.65rem;
  border-bottom: 1px solid #e4dfd6;
  margin-bottom: 0.25rem;
}
.os-user-menu__head strong {
  display: block;
  color: #14141a;
  font-size: 0.95rem;
  line-height: 1.3;
}
.os-user-menu__head span {
  display: block;
  color: #5c6170;
  font-size: 0.8rem;
  line-height: 1.35;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.os-user-menu__item {
  display: block;
  width: 100%;
  padding: 0.62rem 1rem;
  border: 0;
  background: transparent;
  color: #14141a;
  text-align: left;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}
.os-user-menu__item:hover {
  background: rgba(232, 90, 28, 0.08);
  color: #e85a1c;
}
.os-user-menu__logout {
  margin: 0.25rem 0 0;
  padding-top: 0.25rem;
  border-top: 1px solid #e4dfd6;
}
.os-user-menu__item--logout {
  color: #5c6170;
}
.os-user-menu-mobile .os-user-menu__toggle {
  padding: 0.15rem;
  border-color: transparent;
  background: transparent;
}
.os-user-menu-mobile .os-user-menu__name,
.os-user-menu-mobile .os-user-menu__chevron {
  display: none !important;
}
.os-user-menu-mobile .os-user-menu__panel {
  right: 0;
  left: auto;
}

/* Header bar */
.tg-header__area {
  background: #fff !important;
  border-bottom: 1px solid #d1d7dc;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.tg-header__area.sticky-menu {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Mobile menu search */
.tgmobile__search {
  padding: 0 1.25rem 1rem;
}
.tgmobile__search-inner {
  display: flex;
  align-items: center;
  border: 1px solid rgba(39, 134, 136, 0.35);
  border-radius: 9999px;
  overflow: hidden;
  background: #fff;
}
.tgmobile__search-inner:focus-within {
  border-color: var(--tg-theme-primary);
  box-shadow: 0 0 0 2px rgba(39, 134, 136, 0.15);
}
.tgmobile__search-inner input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 1rem 0.6rem 1.25rem;
  font-size: 0.9375rem;
  border: none;
  background: transparent;
}
.tgmobile__search-inner input:focus {
  outline: none;
}
.tgmobile__search-inner button {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--tg-theme-primary);
  cursor: pointer;
}

/* Dropdown for dashboard */
.tg-header__area .tgmenu__links .menu-item-has-children .sub-menu {
  top: 100%;
  margin-top: 4px;
  min-width: 200px;
  padding: 0.5rem 0;
  border-radius: 8px;
}

/* Location + local price */
.os-locale {
  position: relative;
  flex-shrink: 0;
}
.os-locale__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 220px;
  padding: 0.35rem 0.7rem 0.35rem 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  line-height: 1.15;
}
.os-locale__btn:hover,
.os-locale.is-open .os-locale__btn {
  border-color: var(--tg-theme-primary, #e85a1c);
  box-shadow: 0 0 0 3px rgba(232, 90, 28, 0.12);
}
.os-locale__pin {
  display: inline-flex;
  color: var(--tg-theme-primary, #e85a1c);
}
.os-locale__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.os-locale__place {
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 148px;
}
.os-locale__price {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f766e;
  letter-spacing: 0.02em;
}
.os-locale__caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #64748b;
  margin-left: 0.1rem;
}
.os-locale__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: min(300px, 86vw);
  padding: 0.9rem 1rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}
.os-locale__lead {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: #475569;
}
.os-locale__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
}
.os-locale__select,
.os-locale__save {
  width: 100%;
  border-radius: 10px;
  font-size: 0.875rem;
}
.os-locale__select {
  padding: 0.55rem 0.65rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-weight: 500;
}
.os-locale__save,
.os-locale__detect {
  margin-top: 0.7rem;
  padding: 0.55rem 0.75rem;
  border: none;
  background: var(--tg-theme-primary, #e85a1c);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  border-radius: 10px;
  font-size: 0.875rem;
}
.os-locale__detect {
  margin-top: 0;
  margin-bottom: 0.75rem;
  background: #0f766e;
}
.os-locale--mobile {
  margin: 0 0 1rem;
}
.os-locale--mobile .os-locale__btn {
  max-width: none;
  width: 100%;
}
.os-locale--mobile .os-locale__panel {
  position: static;
  width: auto;
  margin-top: 0.6rem;
  box-shadow: none;
}
@media (max-width: 767.98px) {
  .tgmenu__actions > .os-locale:not(.os-locale--mobile) {
    display: none;
  }
}

