/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 2000;
  background: linear-gradient(
    180deg,
    rgba(11, 11, 11, 0.95),
    rgba(11, 11, 11, 0.7) 70%,
    rgba(11, 11, 11, 0)
  );
  backdrop-filter: saturate(120%) blur(10px);
  -webkit-backdrop-filter: saturate(120%) blur(10px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  animation: slideDown 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* subtle base divider for the nav (used via class="nav divider") */
.nav.divider {
  border-bottom: 1px solid var(--line);
}

/* neon gradient hairline under nav on hover */
.nav::after {
  content: '';
  position: absolute;
  bottom: -1px;
  inset-inline: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(14, 165, 233, 0.3) 20%,
    rgba(139, 92, 246, 0.3) 50%,
    rgba(236, 72, 153, 0.3) 80%,
    transparent
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav:hover::after {
  opacity: 1;
}

/* shared max-width container */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px;
  gap: 24px;
}

/* === Nav links (HUB, dropdown etc.) === */
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-weight: 700;
  justify-content: center;
  justify-self: center;
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 4px;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-fast);
}

/* soft gradient chip behind link on hover / active */
.nav-links a::after {
  content: '';
  position: absolute;
  inset: -4px;
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.08),
    rgba(139, 92, 246, 0.08)
  );
  border-radius: 8px;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.25s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: #ffffff;
  transform: translateY(-1px);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  opacity: 1;
}

/* optional “current page” state */
.nav-links a.is-active {
  color: #ffffff;
}

.nav-links a.is-active::after {
  opacity: 1;
}

/* HUB button special styling */
.nav-hub-btn {
  padding: 8px 16px !important;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-hub-btn::after {
  display: none !important;
}

.nav-hub-btn:hover {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.25);
}

.nav-hub-btn.is-active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(139, 92, 246, 0.15));
  border-color: rgba(14, 165, 233, 0.3);
  color: #fff;
}

/* === Nav primary CTA (CONTACT ME) === */
.nav-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: #ffffff;
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.1),
    rgba(139, 92, 246, 0.1)
  );
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: var(--transition);
}

.nav-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.22),
    rgba(139, 92, 246, 0.22)
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}

.nav-cta:hover,
.nav-cta:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
}

.nav-cta:hover::before,
.nav-cta:focus-visible::before {
  opacity: 1;
}

/* ===== NAVIGATION — DROPDOWNS ===== */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

/* Toggle Button */
.nav-dropdown-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

/* Icon inside toggle */
.nav-dropdown-toggle svg {
  transition: transform 0.25s ease, opacity 0.25s ease;
  opacity: 0.7;
}

/* Open state — rotate arrow */
.nav-dropdown.open .nav-dropdown-toggle svg {
  transform: rotate(180deg);
  opacity: 1;
}

/* Highlight hover glow */
.nav-dropdown-toggle::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 8px;
  background: linear-gradient(135deg,
    rgba(14, 165, 233, 0.08),
    rgba(139, 92, 246, 0.08)
  );
  opacity: 0;
  z-index: -1;
  transition: opacity 0.25s ease;
}

/* Hover & active */
.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
  color: #fff;
  transform: translateY(-1px);
}

.nav-dropdown-toggle:hover::after,
.nav-dropdown.open .nav-dropdown-toggle::after {
  opacity: 1;
}

/* ===== DROPDOWN MENU (Minimal Style) ===== */
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 24px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 260px;
  padding: 16px 20px;
  background: rgba(10, 10, 12, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s ease;
  z-index: 10000;
}

/* Open state */
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Wide dropdown variant (for LEARN menu) */
.nav-dropdown-menu--wide {
  min-width: 420px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 24px;
  padding: 20px 24px;
}

.nav-dropdown-menu--wide .nav-dropdown-section {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.nav-dropdown-menu--wide .nav-dropdown-section:not(:first-child) {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.nav-dropdown-menu--wide .nav-dropdown-item {
  padding: 10px 0;
  transition: padding 0.2s ease;
}

.nav-dropdown-menu--wide .nav-dropdown-item:not(:last-child)::after {
  display: none;
}

.nav-dropdown-menu--wide .nav-dropdown-item:hover {
  padding-left: 8px;
}

.nav-dropdown-menu--wide .nav-dropdown-section-title {
  font-size: 9px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-dropdown-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
}

/* ===== MENU ITEMS (Minimal) ===== */
.nav-dropdown-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  padding: 14px 0;
  text-decoration: none;
  position: relative;
}

.nav-dropdown-item:hover .nav-dropdown-item-title {
  color: var(--accent-blue, #0ea5e9);
}

.nav-dropdown-item:hover .nav-dropdown-item-desc {
  color: rgba(255, 255, 255, 0.6);
}

/* Short line separator */
.nav-dropdown-item:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  transition: width 0.3s ease, background 0.3s ease;
}

.nav-dropdown-item:not(:last-child):hover::after {
  width: 100px;
  background: linear-gradient(90deg, var(--accent-blue, #0ea5e9), transparent);
}

/* Title on top - left aligned */
.nav-dropdown-item-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  transition: color 0.15s ease;
}

/* Description underneath */
.nav-dropdown-item-desc {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.4;
  transition: color 0.15s ease;
}

/* Sections inside dropdown (for Resources) */
.nav-dropdown-section {
  display: block;
  width: 100%;
  text-align: left;
}

.nav-dropdown-section:not(:first-child) {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-dropdown-section-title {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 8px;
}

/* ===== BRAND / LOGO ===== */
.brand {
  display: inline-grid;
  align-items: center;
  font-weight: 900;
  letter-spacing: 0.03em;
  font-size: clamp(16px, 1.25vw, 22px);
  line-height: 1;
  cursor: pointer;
  position: relative;
  color: inherit;
  text-decoration: none;
}

.brand:visited {
  color: inherit;
}

.brand .swap {
  grid-area: 1/1;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.brand .swap.out {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

/* TIMR + X */
.b-tim {
  color: var(--text);
}

.b-x {
  margin-left: 2px;
  background: linear-gradient(90deg, var(--accent-blue), #7dd3fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(14, 165, 233, 0.35);
  font-weight: 900;
  letter-spacing: 0.02em;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.brand:hover .b-x {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

/* Dima Vasiliu styling */
.b-dima {
  color: var(--text);
  opacity: 0.9;
  font-weight: 800;
}

.b-surname {
  color: #ff4d4d;
  font-weight: 900;
  letter-spacing: 0.04em;
  font-size: 1.06em;
}

/* ==========================================================================
   ACCOUNT BAR — Top-right icon bar with credits, notifications, avatar
   ========================================================================== */

.account-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* === Credits Pill === */
.account-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  transition: all 0.2s ease;
}

.account-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.account-pill__icon {
  width: 16px;
  height: 16px;
  color: #a78bfa;
  flex-shrink: 0;
}

.account-pill__count {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  min-width: 16px;
}

.account-pill__add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.account-pill__add svg {
  width: 12px;
  height: 12px;
}

.account-pill__add:hover {
  background: rgba(139, 92, 246, 0.4);
  transform: scale(1.05);
}

/* === Icon Buttons === */
.account-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
}

.account-icon svg {
  width: 18px;
  height: 18px;
}

.account-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Notification badge */
.account-icon--notif .notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #ef4444;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

.account-icon--notif .notif-badge:empty,
.account-icon--notif .notif-badge[data-count="0"] {
  display: none;
}

/* === Avatar === */
.account-avatar-wrap {
  position: relative;
}

.account-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.account-avatar:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.account-avatar[aria-expanded="true"] {
  border-color: #8b5cf6;
}

/* Not signed in state */
.account-avatar--guest {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

/* === Avatar Dropdown === */
.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  padding: 8px 0;
  background: rgba(15, 15, 18, 0.98);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: all 0.2s ease;
  z-index: 1000;
}

.account-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.account-dropdown__header {
  padding: 10px 14px;
}

.account-dropdown__email {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  word-break: break-all;
}

.account-dropdown__divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

.account-dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.account-dropdown__item svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  flex-shrink: 0;
}

.account-dropdown__item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.account-dropdown__item:hover svg {
  opacity: 1;
}

.account-dropdown__item--logout {
  color: #f87171;
}

.account-dropdown__item--logout:hover {
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

/* === Responsive === */
@media (max-width: 900px) {
  .account-pill {
    display: none;
  }
}

@media (max-width: 640px) {
  .account-icon:not(.account-icon--notif) {
    display: none;
  }

  .account-bar {
    gap: 4px;
  }
}

/* ==========================================================================
   WORKSPACE CREDITS GROUP (Nav Pill + Buy Button)
   ========================================================================== */
.credits-group {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
}

.credits-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(125,211,252,.35);
  color: #eaf6ff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .03em;
  background: rgba(125,211,252,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
  cursor: pointer;
  transition: all .2s ease;
}

.credits-pill i {
  color: #7dd3fc;
  font-size: 12px;
  filter: drop-shadow(0 0 4px rgba(125,211,252,.5));
}

.credits-pill .credits-value {
  min-width: 24px;
  text-align: center;
}

.credits-pill:hover {
  border-color: rgba(125,211,252,.55);
  background: rgba(125,211,252,.12);
  transform: translateY(-1px);
}

/* Low credits warning */
.credits-pill.low {
  border-color: rgba(251, 191, 36, .5);
  background: rgba(251, 191, 36, .1);
}
.credits-pill.low i {
  color: #fbbf24;
  filter: drop-shadow(0 0 4px rgba(251,191,36,.5));
}

/* Empty credits */
.credits-pill.empty {
  border-color: rgba(239, 68, 68, .45);
  background: rgba(239, 68, 68, .1);
}
.credits-pill.empty i {
  color: #ef4444;
  filter: drop-shadow(0 0 4px rgba(239,68,68,.5));
}

/* Buy button */
.credits-buy-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #fff;
  background: #fff;
  color: #0b0b0b;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s ease;
}

.credits-buy-btn:hover {
  background: transparent;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255,255,255,.15);
}

.credits-buy-btn:active {
  transform: translateY(0);
}

/* Hide on mobile */
@media (max-width: 940px) {
  .credits-group { display: none; }
}
