/* =========================================================
   kabuzz.css — Shared styles for all Kabuzz pages
   ========================================================= */

/* --- Design tokens --- */
:root {
  --cyan: #00BFFF;
  --cyan-dark: #009ACD;
  --cyan-light: #E0F7FF;
  --dark: #1a1a2e;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --green: #10b981;
  --green-light: #d1fae5;
  --green-dark: #065f46;
  --red: #ef4444;
  --red-light: #fef2f2;
  --orange: #f59e0b;
  --orange-light: #fef3c7;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
}

/* --- Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: var(--gray-50);
}

/* --- Nav --- */
nav {
  position: fixed; top: 0; width: 100%; z-index: 100;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 2rem;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo img { height: 32px; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a {
  text-decoration: none; color: var(--gray-600);
  font-size: 0.95rem; font-weight: 500; transition: color 0.2s;
}
.nav-links a:hover { color: var(--cyan-dark); }
.nav-cta {
  background: var(--cyan); color: var(--white) !important;
  padding: 0.5rem 1.25rem; border-radius: 8px;
  font-weight: 600 !important; transition: background 0.2s !important;
}
.nav-cta:hover { background: var(--cyan-dark); }

/* Nav user menu */
.nav-user { position: relative; }
.nav-user-btn {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.75rem; border-radius: 8px;
  border: 1px solid var(--gray-200); background: var(--white);
  cursor: pointer; font-size: 0.9rem; font-weight: 500;
  color: var(--gray-700); transition: border-color 0.2s;
}
.nav-user-btn:hover { border-color: var(--cyan); }
.nav-user-btn svg { flex-shrink: 0; }
.nav-user-name {
  max-width: 120px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.nav-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 180px; z-index: 200; overflow: hidden;
}
.nav-dropdown.open { display: block; }
.nav-dropdown a, .nav-dropdown button {
  display: block; width: 100%; padding: 0.7rem 1rem;
  text-align: left; font-size: 0.9rem; color: var(--gray-700);
  text-decoration: none; border: none; background: none;
  cursor: pointer; transition: background 0.15s;
}
.nav-dropdown a:hover, .nav-dropdown button:hover { background: var(--gray-50); }
.nav-dropdown .divider { height: 1px; background: var(--gray-200); margin: 0; }
.nav-dropdown button.logout { color: #dc2626; }

/* --- Nav badge + activity --- */
.nav-badge {
  position: absolute; top: -4px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #dc2626; color: #fff; font-size: 0.65rem; font-weight: 700;
  border-radius: 9px; display: none; align-items: center; justify-content: center;
  line-height: 1; pointer-events: none;
}
.nav-link-dot {
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #dc2626; color: #fff; font-size: 0.65rem; font-weight: 700;
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.nav-link-dot.msg { background: var(--cyan); }

/* --- Auth Modal (nav login/signup) --- */
.auth-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.35); backdrop-filter: blur(2px);
}
.auth-modal-overlay.open { display: flex; align-items: flex-start; justify-content: center; padding-top: 80px; }
.auth-modal {
  background: var(--white); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 100%; max-width: 380px; padding: 2rem; position: relative;
  animation: authSlideIn 0.2s ease-out;
}
@keyframes authSlideIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
.auth-modal-close {
  position: absolute; top: 12px; right: 12px; width: 28px; height: 28px;
  border: none; background: none; cursor: pointer; color: var(--gray-400);
  display: flex; align-items: center; justify-content: center; border-radius: 6px;
}
.auth-modal-close:hover { background: var(--gray-100); color: var(--gray-600); }
.auth-modal h2 { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); margin-bottom: 0.25rem; text-align: center; }
.auth-modal .auth-subtitle { color: var(--gray-500); font-size: 0.85rem; margin-bottom: 1.25rem; text-align: center; }
.auth-tabs {
  display: flex; gap: 0; margin-bottom: 1.25rem; border: 1px solid var(--gray-200); border-radius: 8px; overflow: hidden;
}
.auth-tab {
  flex: 1; padding: 0.55rem; text-align: center; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; border: none; background: var(--white); color: var(--gray-500); transition: all 0.15s;
}
.auth-tab.active { background: var(--cyan); color: var(--white); }
.auth-modal .google-btn {
  width: 100%; background: #fff; color: #333; border: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px; font-size: 14px; cursor: pointer; border-radius: 8px;
  font-weight: 500; transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-modal .google-btn:hover { border-color: var(--gray-300); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.auth-modal .auth-divider { display: flex; align-items: center; gap: 0.75rem; margin: 1rem 0; }
.auth-modal .auth-divider hr { flex: 1; border: none; border-top: 1px solid var(--gray-200); }
.auth-modal .auth-divider span { font-size: 0.75rem; color: var(--gray-400); font-weight: 500; }
.auth-modal .auth-field { margin-bottom: 0.65rem; }
.auth-modal .auth-field label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--gray-600); margin-bottom: 0.25rem; }
.auth-modal .auth-field input {
  width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--gray-200);
  border-radius: 8px; font-size: 0.9rem; outline: none; transition: border-color 0.15s;
}
.auth-modal .auth-field input:focus { border-color: var(--cyan); }
.auth-modal .auth-error { color: #dc2626; font-size: 0.8rem; margin-bottom: 0.5rem; display: none; }
.auth-modal .auth-submit {
  width: 100%; padding: 0.6rem; background: var(--cyan); color: var(--white);
  border: none; border-radius: 8px; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s; margin-top: 0.25rem;
}
.auth-modal .auth-submit:hover { background: var(--cyan-dark); }
.auth-modal .auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-un-status { font-size: 0.75rem; margin-top: 0.25rem; min-height: 1rem; transition: color 0.15s; }
.auth-un-status.checking { color: var(--gray-400); }
.auth-un-status.available { color: #16a34a; }
.auth-un-status.taken, .auth-un-status.error { color: #dc2626; }

/* --- Unshipped Order Alert Banner (global, non-dismissable) --- */
.unshipped-banner {
  position: fixed; top: 64px; left: 0; right: 0; z-index: 99;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.35);
  animation: unshippedPulse 3s ease-in-out infinite;
}
@keyframes unshippedPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(217, 119, 6, 0.35); }
  50% { box-shadow: 0 4px 24px rgba(217, 119, 6, 0.55); }
}
.unshipped-banner-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0.85rem 2rem;
}
.unshipped-header {
  display: flex; align-items: flex-start; gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.unshipped-header-text {
  font-size: 0.95rem; line-height: 1.45;
}
.unshipped-header-text strong {
  display: block; font-size: 1rem; margin-bottom: 0.15rem;
}
.unshipped-orders {
  display: flex; flex-direction: column; gap: 0.4rem;
}
.unshipped-row {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.18); border-radius: 8px;
  padding: 0.55rem 0.75rem; gap: 0.75rem;
}
.unshipped-row-info {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.9rem; min-width: 0; overflow: hidden;
}
.unshipped-row-info strong {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 300px;
}
.unshipped-amt {
  font-weight: 700; white-space: nowrap;
}
.unshipped-ago {
  font-size: 0.8rem; opacity: 0.8; white-space: nowrap;
}
.unshipped-ship-btn {
  flex-shrink: 0;
  background: #fff; color: #b45309;
  padding: 0.4rem 1rem; border-radius: 6px;
  font-size: 0.85rem; font-weight: 700;
  text-decoration: none; white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}
.unshipped-ship-btn:hover {
  background: #fef3c7; transform: translateY(-1px);
}
/* Push page content down when banner is visible */
body:has(.unshipped-banner) { padding-top: 64px; }
/* Fallback: also add via JS class */
body.has-unshipped-banner > main,
body.has-unshipped-banner > .container,
body.has-unshipped-banner > section:first-of-type {
  margin-top: 0;
}

@media (max-width: 768px) {
  .unshipped-banner { top: 56px; }
  .unshipped-banner-inner { padding: 0.75rem 1rem; }
  .unshipped-header-text { font-size: 0.85rem; }
  .unshipped-header-text strong { font-size: 0.9rem; }
  .unshipped-row { flex-direction: column; align-items: stretch; gap: 0.4rem; }
  .unshipped-row-info { flex-wrap: wrap; }
  .unshipped-row-info strong { max-width: 200px; }
  .unshipped-ship-btn { text-align: center; }
}

/* --- Toggle Switch --- */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--gray-200); border-radius: 24px; transition: 0.25s; }
.toggle-slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: var(--white); border-radius: 50%; transition: 0.25s; }
.toggle-switch input:checked + .toggle-slider { background: var(--cyan); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* --- Common buttons --- */
.btn { display: inline-block; padding: 0.65rem 1.5rem; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; }
.btn-primary { background: var(--cyan); color: var(--white); }
.btn-primary:hover { background: var(--cyan-dark); }
.btn-outline { background: var(--white); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan-dark); }

/* --- Common form elements --- */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-size: 0.85rem; font-weight: 600;
  color: var(--gray-700); margin-bottom: 0.35rem;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.6rem 0.85rem; border: 1px solid var(--gray-200);
  border-radius: 8px; font-size: 0.9rem; font-family: inherit;
}
.form-group textarea { resize: none; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--cyan); }
.form-row { display: flex; gap: 0.75rem; }
.form-row .form-group { flex: 1; }

/* --- Loading / Error states --- */
.loading-state, .error-state {
  text-align: center; padding: 6rem 2rem;
}
.spinner {
  display: inline-block; width: 32px; height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--cyan);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-state h2 { font-size: 1.35rem; color: var(--gray-700); margin-bottom: 0.5rem; }
.error-state p { color: var(--gray-500); margin-bottom: 1.5rem; }

/* --- Error/success banners --- */
.error-banner {
  background: var(--red-light); color: #991b1b; padding: 0.75rem 1rem;
  border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem;
  display: none;
}
.error-banner.show { display: block; }

/* --- Footer --- */
footer {
  background: var(--gray-900); color: var(--gray-400);
  padding: 2rem; text-align: center; font-size: 0.85rem;
}
footer a { color: var(--gray-400); text-decoration: none; margin: 0 0.75rem; }
footer a:hover { color: var(--cyan); }

/* --- Responsive nav --- */
@media (max-width: 768px) {
  nav { padding: 0 1rem; }
  .nav-inner { height: 56px; }
  .nav-logo img { height: 26px; }
  .nav-links { gap: 0.75rem; }
  .nav-links a { font-size: 0.85rem; }
  .nav-links a.hide-mobile { display: none; }
  .nav-cta { padding: 0.4rem 0.85rem; font-size: 0.82rem !important; border-radius: 6px; }
}
@media (max-width: 480px) {
  .nav-logo img { height: 22px; }
  .nav-links { gap: 0.5rem; }
  .nav-links a { font-size: 0.8rem; }
  .nav-cta { padding: 0.35rem 0.7rem; font-size: 0.78rem !important; }
  .nav-user-btn { padding: 0.3rem 0.5rem; font-size: 0.8rem; }
  .nav-user-name { max-width: 70px; }
}
