/**
 * Smart Mirror — Shared Navbar (v2)
 * Clean, consistent across dashboard + setup pages
 */

/* ══════════════════════════════════════════
   BASE
══════════════════════════════════════════ */
.sm-navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 0;
  /* Transparent with subtle border — blends with both dark dashboard and setup */
  background: #0b1220;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  transition: background 0.4s;
}

/* Light theme (setup pages) */
[data-theme="light"] .sm-navbar {
  background: rgba(245,248,255,0.85);
  border-bottom-color: rgba(0,0,0,0.07);
}

/* ── Brand ── */
.sm-navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 28px;
}
.sm-navbar-brand-icon {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #6ba3ff, #3ae7e1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 14px rgba(107,163,255,0.35);
  flex-shrink: 0;
}
.sm-navbar-brand-icon svg { width: 16px; height: 16px; }
.sm-navbar-brand-name {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3.5px;
  color: rgba(255,255,255,0.88);
  text-transform: uppercase;
}
[data-theme="light"] .sm-navbar-brand-name { color: #1a1f2e; }

/* ── Live dot + clock (inside navbar, left side after brand) ── */
.sm-navbar-live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  flex-shrink: 0;
}
.sm-navbar-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #3ae7e1;
  box-shadow: 0 0 8px #3ae7e1;
  animation: navDotBlink 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes navDotBlink {
  0%,80%,100% { opacity: 1; }
  40% { opacity: 0.15; }
}
.sm-navbar-live-label {
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  letter-spacing: 2.5px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}
.sm-navbar-clock {
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 1.5px;
  margin-left: 14px;
}
/* Hide live elements on setup pages */
.sm-navbar[data-context="setup"] .sm-navbar-live { display: none; }

/* ── Spacer (pushes right items to right when no live section) ── */
.sm-navbar-spacer { flex: 1; }

/* ── Right cluster ── */
.sm-navbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

/* ── AI Coach button ── */
.sm-btn-ai {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: rgba(58,231,225,0.1);
  border: 1px solid rgba(58,231,225,0.3);
  border-radius: 18px;
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #3ae7e1;
  text-decoration: none;
  text-transform: uppercase;
  transition: all 0.3s;
  white-space: nowrap;
}
.sm-btn-ai:hover {
  background: rgba(58,231,225,0.18);
  box-shadow: 0 0 16px rgba(58,231,225,0.25);
  transform: translateY(-1px);
}

/* ── Avatar button ── */
.sm-avatar-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6ba3ff, #3ae7e1);
  border: 2px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #000;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
  transition: all 0.3s;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(107,163,255,0.3);
  position: relative;
}
.sm-avatar-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(107,163,255,0.55);
}
.sm-avatar-btn img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: absolute; inset: 0;
}

/* ── Logout btn ── */
.sm-btn-logout {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid rgba(255,77,106,0.3);
  border-radius: 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,77,106,0.8);
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.3s;
  white-space: nowrap;
  background: none;
}
.sm-btn-logout:hover {
  border-color: rgba(255,77,106,0.7);
  color: #ff4d6a;
  background: rgba(255,77,106,0.08);
}

/* ── Hamburger (mobile) ── */
.sm-navbar-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.sm-navbar-hamburger span {
  width: 20px; height: 2px;
  background: rgba(255,255,255,0.65);
  border-radius: 2px;
  display: block;
  transition: all 0.3s;
}
[data-theme="light"] .sm-navbar-hamburger span { background: rgba(26,31,46,0.65); }

/* Mobile drawer */
.sm-navbar-drawer {
  display: none;
  position: fixed;
  top: 60px; left: 0; right: 0;
  background: rgba(4,8,14,0.97);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(24px);
  z-index: 999;
  flex-direction: column;
  padding: 12px 20px 20px;
  gap: 4px;
  animation: drawerDown 0.22s ease both;
}
[data-theme="light"] .sm-navbar-drawer {
  background: rgba(245,248,255,0.97);
}
.sm-navbar-drawer.open { display: flex; }
@keyframes drawerDown {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}
.sm-drawer-link {
  padding: 11px 14px;
  border-radius: 8px;
  font-family: 'Rajdhani','DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  letter-spacing: 1px;
  transition: all 0.2s;
}
.sm-drawer-link:hover {
  color: #3ae7e1;
  background: rgba(58,231,225,0.07);
}
[data-theme="light"] .sm-drawer-link { color: #3a4255; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 768px) {
  .sm-navbar { padding: 0 16px; }
  .sm-btn-ai span:not(.sm-btn-ai-dot) { display: none; }
  .sm-navbar-hamburger { display: flex; }
  .sm-navbar-clock { font-size: 11px; }
  .sm-btn-logout { display: none; }
}
@media (max-width: 480px) {
  .sm-navbar-brand-name { display: none; }
  .sm-navbar-clock { display: none; }
}

/* ── Username in navbar (injected by app.js on dashboard) ── */
.sm-navbar-username {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.72);
  white-space: nowrap;
  padding: 3px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
}

@media (max-width: 768px) {
  .sm-navbar-username { display: none; }
}