/* =============================================
   WHOGOS Global Design System – shared styles
   ============================================= */
:root {
  --cyan:       #00f0ff;
  --pink:       #ff00aa;
  --bg:         #05050a;
  --surface:    rgba(8,12,28,.7);
  --border:     rgba(0,255,255,.15);
  --text-dim:   #7dd3fc;
  --radius-lg:  16px;
  --radius-md:  12px;
  --radius-sm:  8px;
  --font-brand: 'Orbitron', sans-serif;
  --font-body:  'Inter', system-ui, sans-serif;
  --grad:       linear-gradient(135deg,#00c6ff,#ff00aa);
  --nav-h:      62px;
}

/* ---- Toast notifications ---- */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  pointer-events: none;
  max-width: 320px;
}
.toast {
  padding: .85rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-family: var(--font-body);
  color: #fff;
  backdrop-filter: blur(20px);
  animation: toastIn .3s ease forwards;
  pointer-events: all;
  line-height: 1.4;
}
.toast.success { background: rgba(0,255,170,.15); border:1px solid rgba(0,255,170,.4); }
.toast.error   { background: rgba(255,60,60,.15);  border:1px solid rgba(255,80,80,.4); }
.toast.info    { background: rgba(0,240,255,.1);   border:1px solid rgba(0,240,255,.3); }
.toast.warn    { background: rgba(255,180,0,.12);  border:1px solid rgba(255,180,0,.35); }
@keyframes toastIn {
  from { opacity:0; transform:translateY(12px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ---- Spinner ---- */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(0,240,255,.25);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Page loader ---- */
#page-loader {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 8888;
  transition: opacity .35s;
}
#page-loader.hidden { opacity: 0; pointer-events: none; }

/* ---- Input focus ring ---- */
input:focus, select:focus, textarea:focus {
  border-color: rgba(0,255,255,.5) !important;
  box-shadow: 0 0 0 3px rgba(0,255,255,.08);
  outline: none;
}

/* ---- Disabled buttons ---- */
button:disabled, .btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---- Hamburger button ---- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: .35rem;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--cyan);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ---- Mobile nav drawer (for regular pages) ---- */
.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: rgba(5,5,10,.97);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  z-index: 500;
  padding: 1rem 1.5rem;
  flex-direction: column;
  gap: 0;
}
.mobile-nav-drawer.open { display: flex; }
.mobile-nav-drawer a {
  color: #a0e7ff;
  text-decoration: none;
  padding: .9rem 0;
  border-bottom: 1px solid rgba(0,255,255,.06);
  font-size: 1rem;
}
.mobile-nav-drawer a:last-child { border-bottom: none; }
.mobile-nav-drawer a:hover { color: var(--cyan); }

/* ---- Bottom tab bar (customer mobile) ---- */
.bottom-tabs {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(5,5,10,.95);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  padding: .6rem 0;
  padding-bottom: max(.6rem, env(safe-area-inset-bottom));
  z-index: 400;
  justify-content: space-around;
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  color: #4a7fa0;
  text-decoration: none;
  font-size: .7rem;
  font-family: var(--font-body);
  padding: .3rem .8rem;
  border-radius: 8px;
  transition: color .2s;
}
.tab-item.active, .tab-item:hover { color: var(--cyan); }
.tab-icon { font-size: 1.3rem; line-height: 1; }

/* ---- Admin layout responsive ---- */
.admin-topbar {
  display: none;
  padding: .9rem 1.2rem;
  background: rgba(5,5,10,.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
}
.admin-topbar h2 {
  font-family: var(--font-brand);
  font-size: 1.1rem;
  background: linear-gradient(90deg,#00f0ff,#ff00aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---- Message input safe area ---- */
.input-bar {
  padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
}

/* ---- Global page loader overlay (walking monkey GIF) ---- */
#go-page-loader {
  position: fixed;
  inset: 0;
  background: rgba(5,5,10,.92);
  backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
#go-page-loader.active {
  opacity: 1;
  pointer-events: all;
}
.gpl-gif {
  width: 150px;
  height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(0,255,255,.25));
}
.gpl-logo {
  max-width: 110px;
  height: auto;
  opacity: .85;
}
.gpl-text {
  font-family: 'Orbitron', sans-serif;
  font-size: .85rem;
  color: #00f0ff;
  letter-spacing: .12em;
  animation: gplPulse 1.4s ease-in-out infinite;
}
.gpl-sub {
  font-size: .75rem;
  color: #4a7fa0;
  margin-top: -.4rem;
}
@keyframes gplPulse {
  0%,100% { opacity: .5; }
  50%      { opacity: 1;  }
}

/* ---- Offline / network error banner ---- */
#go-offline-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: .55rem 1rem;
  background: rgba(255,50,50,.12);
  border-bottom: 1px solid rgba(255,80,80,.3);
  text-align: center;
  font-size: .82rem;
  color: #ff6b6b;
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
#go-offline-banner.show { display: flex; }

/* ---- Nav logo link ---- */
.nav > a { display: inline-flex; align-items: center; flex-shrink: 0; }
.nav-logo-img { height: 38px; width: auto; display: block; object-fit: contain; cursor: pointer; }
.logo-img { max-width: 160px; height: auto; display: block; margin: 0 auto; cursor: pointer; }

/* ---- Carousel / Slideshow ---- */
.carousel-wrap { position: relative; border-radius: 18px; overflow: hidden; user-select: none; }
.carousel-slides { display: flex; height: 100%; transition: transform .5s ease; will-change: transform; }
.carousel-slide { flex: 0 0 100%; width: 100%; height: 100%; flex-shrink: 0; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
/* Blurred background layer auto-fills letterbox space for any image ratio */
.slide-bg-blur { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(28px) brightness(.32) saturate(1.4); z-index: 0; }
.carousel-slide img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.carousel-slide .slide-caption { position: absolute; bottom: 0; left: 0; right: 0; padding: .7rem 1rem; background: linear-gradient(transparent, rgba(5,5,10,.85)); font-size: .82rem; color: #e0f7ff; z-index: 2; }
.carousel-dots { display: flex; justify-content: center; gap: .45rem; margin-top: .7rem; }
.cdot { width: 8px; height: 8px; border-radius: 50%; background: rgba(0,240,255,.25); cursor: pointer; transition: .3s; border: none; padding: 0; }
.cdot.active { background: #00f0ff; transform: scale(1.3); }
.carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(5,5,10,.55); border: 1px solid rgba(0,255,255,.25); color: #00f0ff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; z-index: 5; transition: .2s; }
.carousel-arrow:hover { background: rgba(0,255,255,.15); }
.carousel-arrow.prev { left: .5rem; }
.carousel-arrow.next { right: .5rem; }

/* ---- Custom scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,240,255,.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,240,255,.4); }

/* ---- Badge ---- */
.badge {
  background: #ff2d55;
  color: #fff;
  font-size: .65rem;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 4px;
}

/* ---- Status chips ---- */
.chip {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.chip-pending  { background: rgba(255,180,0,.12); color: #ffb400; border:1px solid rgba(255,180,0,.3); }
.chip-active   { background: rgba(0,255,170,.1);  color: #00ffaa; border:1px solid rgba(0,255,170,.3); }
.chip-done     { background: rgba(0,240,255,.08); color: #00f0ff; border:1px solid rgba(0,240,255,.2); }
.chip-urgent   { background: rgba(255,50,50,.12); color: #ff5050; border:1px solid rgba(255,80,80,.3); }

/* =========================================
   RESPONSIVE BREAKPOINTS
   ========================================= */

/* Tablets and up: show bottom tabs, hide desktop overflow */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .bottom-tabs { display: flex; }

  /* Push page content above bottom tab bar */
  body.has-tabs { padding-bottom: 68px; }

  /* Admin: show topbar, hide sidebar inline */
  .admin-topbar { display: flex; }
  .layout { flex-direction: column; }
  .sidebar {
    width: 100% !important;
    display: none;
    border-right: none !important;
    border-bottom: 1px solid var(--border);
    position: relative;
  }
  .sidebar.open { display: block !important; }

  /* Nav links hidden until hamburger opens */
  .nav .nav-links { display: none !important; }

  /* Hero: stack vertically */
  .hero { flex-direction: column !important; }
}

@media (max-width: 480px) {
  .categories { grid-template-columns: repeat(3, 1fr) !important; gap: .7rem !important; }
  .card { padding: .9rem .4rem !important; }
  .stats { grid-template-columns: repeat(2, 1fr) !important; }
}
