/* =========================================================
   CallYourKid -- Mobile CSS
   Hamburger menu, sidebar overlay, bottom nav bar.
   Loaded on all pages after luxury-override.css
   ========================================================= */

/* ---- Hamburger button (hidden on desktop) -------------- */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: #f0f4f8;
  border-radius: 2px;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}
.hamburger-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Sidebar overlay (mobile only) --------------------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sidebar-overlay.active {
  opacity: 1;
}

/* ---- Bottom nav bar (mobile only) ---------------------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(8,15,26,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  display: none;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  color: #64748b;
  text-decoration: none;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  letter-spacing: 0.3px;
  transition: color 0.2s;
  position: relative;
  min-width: 56px;
}
.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}
.bottom-nav-item.active,
.bottom-nav-item:hover {
  color: #c9a84c;
}
.bottom-nav-item .bnav-badge {
  position: absolute;
  top: 4px;
  right: 10px;
  background: linear-gradient(135deg, #c9a84c, #e0c068);
  color: #080f1a;
  font-size: 9px;
  font-weight: 900;
  border-radius: 10px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ---- Mobile breakpoint --------------------------------- */
@media (max-width: 768px) {
  /* Show hamburger */
  .hamburger-btn {
    display: flex;
  }

  /* Show bottom nav */
  .bottom-nav {
    display: flex;
  }

  /* Add padding to main content so bottom nav doesn't cover content */
  .main-content {
    padding-bottom: 80px !important;
  }

  /* Sidebar slides in from left */
  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh !important;
    width: 260px !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    z-index: 200 !important;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.5);
  }

  /* Show overlay when sidebar open */
  .sidebar-overlay {
    display: block;
  }

  /* Topbar always visible */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 16px !important;
  }

  .topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .topbar-right {
    width: auto !important;
    margin-left: auto;
  }

  /* Hide page title on very small screens */
  .page-title {
    font-size: 16px !important;
  }

  /* Stat cards single column */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* Panels full width */
  .content-grid,
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Tighter panel padding */
  .panel {
    padding: 16px !important;
  }

  /* Request items */
  .request-item {
    padding: 14px !important;
  }

  /* Modal full-screen on mobile */
  .modal-overlay .modal,
  #reschedule-modal > div {
    margin: 16px !important;
    width: calc(100vw - 32px) !important;
    max-height: 85vh;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .stat-value {
    font-size: 28px !important;
  }

  .topbar {
    padding: 10px 12px !important;
  }

  .page-title {
    font-size: 15px !important;
  }
}

/* ---- iOS safe area support ----------------------------- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
  .main-content {
    padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
  }
}
