/* ============================================
   Tubelight Navbar
   Adapted from React/Tailwind tubelight-navbar
   ============================================ */

/* Container — always fixed to top */
.tubelight-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 10px 16px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

/* Fill the iOS safe-area inset (notch/Dynamic Island) behind the nav
   so there's no gap between the status bar and the hero shader. */
.tubelight-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg);
  z-index: -1;
}

.tubelight-nav.nav-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

@media (min-width: 768px) {
  .tubelight-nav {
    flex-direction: row;
    justify-content: center;
    padding: 16px 32px;
    gap: 0;
  }
}

/* ---- Logo ---- */
.tubelight-nav-logo {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.2vw, 10px);
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 2.2vw, 1.05rem);
  font-weight: 300;
  letter-spacing: -0.02em;
}

.tubelight-nav-logo img {
  width: clamp(22px, 5vw, 28px);
  height: clamp(22px, 5vw, 28px);
  object-fit: contain;
}

/* Desktop: use flex space-between instead of absolute positioning */
@media (min-width: 768px) {
  .tubelight-nav {
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
  }

  .tubelight-nav-logo {
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
    white-space: nowrap;
  }

  .tubelight-nav-logo img {
    flex-shrink: 0;
    width: clamp(36px, 4vw, 46px);
    height: clamp(36px, 4vw, 46px);
  }
}

/* Hide logo text at intermediate widths, keep icon */
@media (min-width: 768px) and (max-width: 1050px) {
  .tubelight-nav-logo-text {
    display: none;
  }
}

/* Pill — the rounded floating bar */
.tubelight-nav-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 4px;
  border-radius: 9999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  position: relative;
}

@media (min-width: 768px) {
  .tubelight-nav-pill {
    gap: 12px;
  }
}

/* Nav item — link inside the pill */
.tubelight-nav-item {
  position: relative;
  z-index: 1;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-family: var(--font-body);
}

@media (min-width: 768px) {
  .tubelight-nav-item {
    padding: 8px 24px;
  }
}

.tubelight-nav-item:hover {
  color: var(--accent-light);
}

.tubelight-nav-item.active {
  color: var(--accent-light);
}

/* Always show text labels, hide icons */
.tubelight-nav-label {
  display: inline;
}

.tubelight-nav-icon {
  display: none;
}

/* ---- Mobile: show only Products, Gallery, Get a Quote ---- */
@media (max-width: 767px) {
  .tubelight-nav-item[data-section="process"],
  .tubelight-nav-item[data-section="about"],
  .tubelight-nav-item[data-section="faq"],
  .tubelight-theme-btn {
    display: none;
  }
}

/* ---- CTA item (Get a Quote) ---- */
.tubelight-nav-cta {
  background: var(--accent);
  color: #fff;
  animation: cta-glow 3s ease-in-out infinite;
}

.tubelight-nav-cta:hover {
  background: var(--accent-light);
  color: #fff;
}

/* Keep white text even when active */
.tubelight-nav-cta.active {
  color: #fff;
}

@keyframes cta-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(65, 105, 225, 0); }
  50% { box-shadow: 0 0 16px 3px rgba(65, 105, 225, 0.25); }
}

/* ---- Tubelight lamp / glow effect ---- */
.tubelight-nav-lamp {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  border-radius: 9999px;
  background: rgba(65, 105, 225, 0.05);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
}

.tubelight-nav-lamp-bar {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 4px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
}

.tubelight-nav-lamp-glow1 {
  position: absolute;
  width: 48px;
  height: 24px;
  background: rgba(65, 105, 225, 0.2);
  border-radius: 9999px;
  filter: blur(12px);
  top: -8px;
  left: -8px;
}

.tubelight-nav-lamp-glow2 {
  position: absolute;
  width: 32px;
  height: 24px;
  background: rgba(65, 105, 225, 0.2);
  border-radius: 9999px;
  filter: blur(12px);
  top: -4px;
  left: 0;
}

.tubelight-nav-lamp-glow3 {
  position: absolute;
  width: 16px;
  height: 16px;
  background: rgba(65, 105, 225, 0.2);
  border-radius: 9999px;
  filter: blur(8px);
  top: 0;
  left: 8px;
}

/* ---- Theme toggle button inside the pill ---- */
.tubelight-theme-btn.theme-toggle {
  width: auto;
  height: auto;
  padding: 6px 14px;
  background: none;
  border: none;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .tubelight-theme-btn.theme-toggle {
    padding: 8px 24px;
  }
}

.tubelight-theme-btn.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

/* Theme toggle always shows icon (overrides the global icon hide) */
.tubelight-theme-btn .icon-for-dark { display: inline-flex; }
.tubelight-theme-btn .icon-for-light { display: none; }

/* Light mode: show sun icon */
.light-theme .tubelight-theme-btn .icon-for-dark { display: none; }
.light-theme .tubelight-theme-btn .icon-for-light { display: inline-flex; }

/* ---- Light theme adjustments ---- */
.light-theme .tubelight-nav-pill {
  background: rgba(0, 0, 0, 0.03);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.light-theme .tubelight-nav-lamp {
  background: rgba(65, 105, 225, 0.08);
}

.light-theme .tubelight-nav-logo {
  color: var(--text);
}

.light-theme .tubelight-nav-cta {
  background: var(--accent);
  color: #fff;
}

.light-theme .tubelight-nav-cta:hover {
  background: var(--accent-light);
  color: #fff;
}

/* ---- Override scroll-padding for tubelight nav ---- */
html {
  scroll-padding-top: 80px;
}

@media (max-width: 767px) {
  html {
    scroll-padding-top: 100px;
  }
}
