/* ============================================
 * AIPackList — Shell CSS (shared header/footer)
 * Provides styles for canonical header & mobile menu
 * across blog.html, pricing.html, 404.html
 * ============================================ */

/* ---- Header layout ---- */
header {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 20, 0.95);
  backdrop-filter: blur(20px);
}
[data-theme="light"] header { background: rgba(245, 246, 250, 0.95); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ---- Desktop navigation ---- */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.nav-desktop a, .nav-desktop .nav-link {
  color: var(--text2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: var(--transition);
  white-space: nowrap;
}
.nav-desktop a:hover, .nav-desktop .nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.nav-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}

/* ---- Sign Up CTA ---- */
.nav-signup {
  margin-left: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)) !important;
  color: #000 !important;
  font-weight: 700 !important;
  border-radius: 999px !important;
  padding: 7px 16px !important;
}
.nav-signup:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--accent), var(--accent2)) !important;
}

/* ---- Theme toggle (header) ---- */
.theme-btn-header {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  margin-left: 4px;
}
.theme-btn-header:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  transform: rotate(15deg);
}

/* ---- Language switcher (desktop) ---- */
.lang-switcher {
  display: inline-flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  margin-left: 4px;
}
.lang-btn {
  background: transparent;
  border: 0;
  color: var(--text2);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active {
  background: var(--accent);
  color: #000;
}

/* ---- Mobile navigation trigger (visible ≤720px) ---- */
.nav-mobile { display: none; align-items: center; gap: 8px; }
.hamburger {
  background: transparent;
  border: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ---- Responsive switch at 720px ---- */
@media (max-width: 720px) {
  .nav-desktop { display: none; }
  .nav-mobile { display: inline-flex; }
}

/* ---- Mobile menu drawer (slides in from right) ---- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  padding: 16px;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}
.mobile-menu.open .mobile-menu-panel { transform: translateX(0); }

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.mobile-menu-close {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.mobile-menu-close:hover { background: rgba(255,255,255,0.1); }

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: 10px;
  transition: var(--transition);
}
.mobile-nav-item:hover { background: rgba(255,255,255,0.06); }
.mni-icon { font-size: 18px; width: 24px; text-align: center; }
.mobile-nav-cta {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000 !important;
  font-weight: 700;
  justify-content: space-between;
  margin-top: 6px;
}
.mobile-nav-cta:hover { filter: brightness(1.1); background: linear-gradient(135deg, var(--accent), var(--accent2)); }

.mobile-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.mobile-menu-footer {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mobile-theme-toggle {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}
.mobile-theme-toggle:hover { background: rgba(255,255,255,0.1); }
.mobile-lang-row {
  display: inline-flex;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.mobile-lang-row button {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 0;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
}
.mobile-lang-row button.active { background: var(--accent); color: #000; }

/* ---- Footer ---- */
footer {
  padding: 32px 0 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  margin-top: 60px;
}
footer p { margin: 6px 0; }
.footer-links a:hover { color: var(--accent) !important; }


/* =============================================
 * Phase C: Auth state (logged-in / logged-out)
 * Phase D: Language dropdown
 * ============================================= */

/* Visibility toggles set by shell.js */
.auth-only { display: none !important; }
.guest-only { display: inline-flex; }
body.is-authed .auth-only { display: inline-flex !important; }
body.is-authed .guest-only { display: none !important; }
/* Block-level overrides for items that aren't inline-flex */
body.is-authed #mobile-auth-card.auth-only,
body.is-authed .mobile-nav-item.auth-only { display: flex !important; }

/* Credits chip (desktop) */
.nav-credits {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  min-height: 40px;
  box-sizing: border-box;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(240,165,0,.18), rgba(255,123,84,.10));
  border: 1px solid rgba(240,165,0,.45);
  color: var(--accent, #f0a500);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.nav-credits:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255,107,53,.25);
}
.nav-credits .cred-icon { font-size: 15px; line-height: 1; }

/* User menu (desktop) */
.user-menu { position: relative; }
.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.user-menu-btn:hover { background: var(--surface-2, rgba(255,255,255,.04)); border-color: var(--accent, #ff6b35); }
.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #ff6b35, #f7931e); /*v6*/
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
}
.user-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-caret { font-size: 10px; opacity: .7; }

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg, #0d0f14);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 200;
}
[data-theme="light"] .user-menu-dropdown { background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.user-menu.open .user-menu-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.user-menu-info {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.user-menu-name { font-weight: 600; font-size: 14px; color: var(--text); }
.user-menu-email { font-size: 12px; color: var(--text2); margin-top: 2px; word-break: break-all; }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13.5px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s;
}
.user-menu-item:hover { background: var(--surface-2, rgba(255,107,53,.08)); color: var(--accent, #ff6b35); }
.user-menu-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.user-menu-logout:hover { background: rgba(220,53,69,.12); color: #ff6b6b; }

/* Language dropdown (Phase D) */
.lang-dd { position: relative; }
.lang-dd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.lang-dd-btn:hover { border-color: var(--accent, #ff6b35); background: var(--surface-2, rgba(255,255,255,.04)); }
.lang-dd-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 170px;
  background: var(--bg, #0d0f14);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 200;
}
[data-theme="light"] .lang-dd-menu { background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.lang-dd.open .lang-dd-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.lang-dd-item:hover { background: var(--surface-2, rgba(255,107,53,.08)); color: var(--accent, #ff6b35); }
.lang-dd-item.active { background: rgba(255,107,53,.12); color: var(--accent, #ff6b35); }
.lang-dd-native { font-weight: 400; font-size: 12px; color: var(--text2); }
.lang-dd-item:hover .lang-dd-native { color: inherit; opacity: .85; }

/* Mobile auth card */
.mobile-auth-card {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  margin: 4px 0 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,107,53,.10), rgba(255,165,90,.05));
  border: 1px solid rgba(255,107,53,.25);
}
body:not(.is-authed) .mobile-auth-card { display: none !important; }
.mac-row { display: flex; align-items: center; gap: 12px; }
.mac-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #ff6b35, #f7931e); /*v6*/
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
}
.mac-meta { flex: 1; min-width: 0; }
.mac-name { font-weight: 600; color: var(--text); font-size: 15px; }
.mac-email { font-size: 12px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mac-credits {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,107,53,.10);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.mac-buy { color: var(--accent, #ff6b35); font-size: 12px; }

/* Hide old flat lang switcher (if cached version of pages references it) */
.lang-switcher { display: none !important; }

/* Fix button-as-mobile-nav-item styling */
button.mobile-nav-item{background:transparent;border:none;cursor:pointer;font:inherit;color:var(--text)}
button.mobile-nav-item:hover{color:var(--accent,#ff6b35)}
