/* ═══════════════════════════════════════════════════
   MyCampaign Shared Navigation v8.0 — nav.css
   Sidebar (desktop) · Hamburger fullscreen menu (mobile)
   ═══════════════════════════════════════════════════ */

/* ── Animations ── */
@keyframes nav-pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }

/* ══════════════════════════════════
   APP LAYOUT SHELL
   ══════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ══════════════════════════════════
   SIDEBAR (Desktop — 248px)
   ══════════════════════════════════ */
.site-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 248px;
  background: #FFFFFF;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ── Sidebar Header (logo) ── */
.sidebar-header {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.sidebar-logo img {
  height: 28px;
  width: auto;
}

/* ── Section Label ── */
.sidebar-section-label {
  font-family: var(--font, 'Rubik', sans-serif);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9B9BA3;
  padding: 20px 20px 8px;
}
.sidebar-section-label:first-of-type {
  padding-top: 12px;
}

/* ── Live Pill (inline in nav link) ── */
.nav-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #D80D35;
  color: #fff;
  padding: 2px 6px;
  border-radius: 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 6px;
  line-height: 1;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.nav-live-pill .live-dot {
  width: 5px;
  height: 5px;
  background: #fff;
  border-radius: 50%;
  animation: navPulse 1.5s infinite;
}
@keyframes navPulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── Sidebar Nav Links ── */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 0;
  text-decoration: none;
  font-family: var(--font, 'Rubik', sans-serif);
  font-size: 14px;
  font-weight: 500;
  color: #3A3A3F;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-link:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #0A0A0B;
}

.sidebar-link.active {
  background: var(--brand-teal, #4285F4);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.25);
}

.sidebar-link-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

.sidebar-link-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Platform Switcher ── */
.platform-switcher {
  padding: 12px 12px 0;
}
.platform-switch-btn-direct {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: 1px solid #D93025;
  padding: 8px 12px;
  font-family: var(--font, 'Rubik', sans-serif);
  font-size: 12px;
  font-weight: 600;
  color: #D93025;
  cursor: pointer;
  text-decoration: none;
  transition: all 150ms ease;
  box-sizing: border-box;
}
.platform-switch-btn-direct:hover {
  background: #D93025;
  color: #FFFFFF;
}
.platform-switch-btn-direct svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

/* ── Spacer (pushes footer down) ── */
.sidebar-spacer {
  flex: 1;
}

/* ── Sidebar Footer ── */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  text-align: center;
}
.sidebar-copyright {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.35);
  margin-top: 10px;
  letter-spacing: 0.01em;
}

.sidebar-built-by {
  margin-top: 12px;
  text-align: center;
}
.built-by-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}
.built-by-link:hover {
  opacity: 0.9;
}
.built-by-text {
  font-family: var(--font, 'Rubik', sans-serif);
  font-size: 10px;
  font-weight: 500;
  color: #9B9BA3;
  letter-spacing: 0.02em;
}
.built-by-logo {
  height: 14px;
  width: auto;
}


/* ══════════════════════════════════
   MAIN CONTENT AREA
   ══════════════════════════════════ */
.app-main {
  flex: 1;
  margin-left: 248px;
  min-height: 100vh;
  min-width: 0;
}

/* ══════════════════════════════════
   MOBILE HEADER + MENU (hidden on desktop)
   ══════════════════════════════════ */
.mobile-header {
  display: none;
}
.mobile-hamburger {
  display: none;
}
.mobile-menu-overlay {
  display: none;
}

/* ══════════════════════════════════
   AUTH ELEMENTS — Sidebar Context
   ══════════════════════════════════ */

#navAuth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
#navAuth.ready { opacity: 1; }

.site-nav-login {
  display: inline-block;
  font-family: var(--font, 'Rubik', sans-serif);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 0;
  background: var(--brand-teal, #4285F4);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  letter-spacing: -0.01em;
}
.site-nav-login:hover {
  background: var(--brand-teal-dark, #3367D6);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.25);
}

.site-nav-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 0;
  color: #3A3A3F;
  text-decoration: none;
  transition: background 0.15s ease;
}
.site-nav-settings:hover {
  background: rgba(0, 0, 0, 0.05);
}

.site-nav-user-name {
  font-family: var(--font, 'Rubik', sans-serif);
  font-size: 13px;
  font-weight: 600;
  color: #211D3E;
}

.site-nav-logout {
  font-family: var(--font, 'Rubik', sans-serif);
  font-size: 12px;
  font-weight: 500;
  color: #9B9BA3;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 0;
  margin-left: auto;
  transition: color 0.15s ease, background 0.15s ease;
}
.site-nav-logout:hover {
  color: #3A3A3F;
  background: rgba(0, 0, 0, 0.04);
}

/* Mobile auth login button (compact, in header) */
.mobile-auth-login {
  font-family: var(--font, 'Rubik', sans-serif);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 0;
  background: var(--brand-teal, #4285F4);
  white-space: nowrap;
  transition: background 0.15s ease;
}
.mobile-auth-login:hover {
  background: var(--brand-teal-dark, #3367D6);
}

#mobileAuth {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
#mobileAuth.ready { opacity: 1; }

/* auth.js mobile menu classes */
.mobile-menu-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 0;
  background: var(--brand-teal, #4285F4);
  transition: background 0.15s ease;
}
.mobile-menu-login:hover {
  background: var(--brand-teal-dark, #3367D6);
}
.mobile-menu-login-label {
  font-family: var(--font, 'Rubik', sans-serif);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--font, 'Rubik', sans-serif);
  font-size: 13px;
  font-weight: 500;
  color: #3A3A3F;
  padding: 6px 10px;
  border-radius: 0;
  transition: background 0.15s ease;
}
.mobile-menu-item:hover {
  background: rgba(0, 0, 0, 0.04);
}
.mobile-menu-icon { font-size: 16px; }
.mobile-menu-label { font-weight: 600; color: #211D3E; }
.mobile-menu-desc { font-size: 11px; color: #9B9BA3; display: none; }


/* ══════════════════════════════════════════════
   TABLET BREAKPOINT — Collapsed sidebar (icons only)
   ══════════════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
  .site-sidebar {
    width: 64px;
  }

  .sidebar-logo {
    justify-content: center;
  }
  .sidebar-logo img {
    height: 22px;
  }
  .sidebar-header {
    justify-content: center;
    padding: 0 8px;
  }

  .sidebar-section-label {
    display: none;
  }

  .sidebar-nav {
    padding: 0 8px;
  }
  .sidebar-link {
    justify-content: center;
    padding: 12px 8px;
    border-radius: 0;
  }
  .sidebar-link-icon {
    font-size: 20px;
  }
  .sidebar-link-label {
    display: none;
  }

  .platform-switcher {
    display: none;
  }

  .sidebar-footer {
    padding: 12px 8px;
    align-items: center;
    text-align: center;
  }
  #navAuth .site-nav-user-name,
  #navAuth .site-nav-logout {
    display: none;
  }
  #navAuth .site-nav-login {
    font-size: 0;
    padding: 10px;
    border-radius: 0;
  }
  #navAuth .site-nav-login::before {
    content: '\2192';
    font-size: 16px;
  }

  .app-main {
    margin-left: 64px;
  }
}


/* ══════════════════════════════════════════════
   MOBILE BREAKPOINT — Hamburger + fullscreen menu
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Hide sidebar ── */
  .site-sidebar {
    display: none;
  }

  /* ── Reset main margin ── */
  .app-main {
    margin-left: 0;
  }

  /* ── Show mobile header ── */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
    padding: 0 16px;
    background: #FFFFFF;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .mobile-header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
  }
  .mobile-header-logo img {
    height: 24px;
    width: auto;
  }

  .mobile-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  /* ── Hamburger button ── */
  .mobile-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    color: #211D3E;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
  }
  .mobile-hamburger:active {
    opacity: 0.7;
  }

  /* ── Mobile account dropdown ── */
  .mobile-account-wrap {
    position: relative;
  }
  .mobile-account-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font, 'Rubik', sans-serif);
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-navy, #211D3E);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
  }
  .mobile-account-btn:active {
    background: rgba(0, 0, 0, 0.05);
  }
  .mobile-account-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-account-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 6px;
    z-index: 200;
  }
  .mobile-account-dropdown.open {
    display: block;
    animation: dropdownFadeIn 0.15s ease-out;
  }
  @keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .mobile-account-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 0;
    text-decoration: none;
    font-family: var(--font, 'Rubik', sans-serif);
    font-size: 14px;
    font-weight: 500;
    color: #3A3A3F;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-account-dropdown-item:active {
    background: rgba(0, 0, 0, 0.05);
  }

  .mobile-header-live {
    display: none;
  }

  /* ══════════════════════════════════
     FULLSCREEN MOBILE MENU OVERLAY
     Navy background, teal accents, blocky style
     ══════════════════════════════════ */
  .mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: #1A73E8;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-menu-overlay.open {
    display: flex;
    animation: menuFadeIn 0.2s ease-out;
  }
  @keyframes menuFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  /* ── Menu Header ── */
  .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
  }
  .mobile-menu-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
  }
  .mobile-menu-logo img {
    height: 26px;
    width: auto;
  }
  .mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0;
    color: #FFFFFF;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
  }
  .mobile-menu-close:active {
    background: rgba(255, 255, 255, 0.15);
  }

  /* ── Menu Body ── */
  .mobile-menu-body {
    flex: 1;
    padding: 16px 20px 32px;
  }

  /* ── Section Labels ── */
  .mobile-menu-section-label {
    font-family: var(--font, 'Rubik', sans-serif);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.35);
    padding: 24px 4px 12px;
  }
  .mobile-menu-section-label:first-child {
    padding-top: 8px;
  }

  /* ── Menu Links — blocky, bold ── */
  .mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 16px;
    border-radius: 0;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-menu-link:last-child {
    border-bottom: none;
  }
  .mobile-menu-link:active {
    background: rgba(255, 255, 255, 0.05);
  }

  /* Active link — white left border + light bg strip */
  .mobile-menu-link.active {
    background: rgba(255, 255, 255, 0.15);
    border-left: 4px solid #FFFFFF;
    color: #FFFFFF;
  }

  .mobile-menu-link-icon {
    font-size: 24px;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
  }

  .mobile-menu-link-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
  }
  .mobile-menu-link-label {
    font-family: var(--font, 'Rubik', sans-serif);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: inherit;
  }
  .mobile-menu-link.active .mobile-menu-link-label {
    color: #FFFFFF;
  }
  .mobile-menu-link-desc {
    font-family: var(--font, 'Rubik', sans-serif);
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.3;
  }
  .mobile-menu-link.active .mobile-menu-link-desc {
    color: rgba(255, 255, 255, 0.6);
  }

  /* ── Menu Footer ── */
  .mobile-menu-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
  }

  .mobile-menu-switcher {
    margin-bottom: 16px;
  }
  .mobile-menu-switcher .platform-switch-btn-direct {
    justify-content: center;
    padding: 12px 16px;
    font-size: 14px;
    border-color: rgba(217, 48, 37, 0.6);
    color: #FF6B5E;
  }
  .mobile-menu-switcher .platform-switch-btn-direct:hover,
  .mobile-menu-switcher .platform-switch-btn-direct:active {
    background: #D93025;
    border-color: #D93025;
    color: #FFFFFF;
  }

  .mobile-menu-login-btn {
    display: block;
    text-align: center;
    font-family: var(--font, 'Rubik', sans-serif);
    font-size: 15px;
    font-weight: 700;
    color: #FFFFFF;
    text-decoration: none;
    padding: 16px 24px;
    background: #4285F4;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
    letter-spacing: -0.01em;
  }
  .mobile-menu-login-btn:hover,
  .mobile-menu-login-btn:active {
    background: #3367D6;
  }

  /* ── Adjust toasts ── */
  .toast {
    bottom: 16px !important;
  }

  /* ── Mobile auth adjustments ── */
  #mobileAuth .mobile-menu-item {
    padding: 4px 8px;
    font-size: 12px;
  }
  #mobileAuth .mobile-menu-label {
    font-size: 12px;
  }
  #mobileAuth .mobile-menu-icon {
    font-size: 14px;
  }
}


/* ══════════════════════════════════
   SMALL MOBILE (<400px) — tighter spacing
   ══════════════════════════════════ */
@media (max-width: 400px) {
  .mobile-header {
    padding: 0 12px;
  }
  .mobile-header-logo img {
    height: 22px;
  }
  .mobile-menu-link {
    padding: 16px 14px;
  }
  .mobile-menu-link-label {
    font-size: 16px;
  }
}
