/* ============================================================
   BrigBooking — Global Stylesheet
   Glassmorphism · Mobile-First · Apple-inspired
   ============================================================ */

:root {
  --accent:      #0A84FF;
  --accent2:     #30D158;
  --danger:      #FF453A;
  --warning:     #FFD60A;
  --text:        #F5F5F7;
  --text-muted:  rgba(245,245,247,0.55);
  --glass:       rgba(255,255,255,0.10);
  --glass-border:rgba(255,255,255,0.18);
  --glass-hover: rgba(255,255,255,0.16);
  --blur:        blur(20px);
  --radius:      20px;
  --radius-sm:   12px;
  --shadow:      0 8px 32px rgba(0,0,0,0.35);
  --shadow-lg:   0 24px 60px rgba(0,0,0,0.45);
  --nav-h:       64px;
  --font:        -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  background: #040e1f;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Background ─────────────────────────────────────────── */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 120% 80% at 20% 10%, #0a2a6e 0%, transparent 60%),
    radial-gradient(ellipse 100% 70% at 80% 90%, #062240 0%, transparent 60%),
    linear-gradient(160deg, #040e1f 0%, #061929 50%, #040e1f 100%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: drift 18s ease-in-out infinite alternate;
}
.bg-orb-1 {
  width: 520px; height: 520px;
  background: radial-gradient(#0055cc, #003399);
  top: -120px; left: -100px;
  animation-duration: 22s;
}
.bg-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(#00509e, #001a4d);
  bottom: -100px; right: -80px;
  animation-duration: 17s;
  animation-delay: -8s;
}
.bg-orb-3 {
  width: 280px; height: 280px;
  background: radial-gradient(#006699, transparent);
  top: 40%; left: 50%;
  animation-duration: 25s;
  animation-delay: -4s;
}
.bg-waves {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 220px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 220'%3E%3Cpath fill='rgba(10,132,255,0.06)' d='M0,160 C360,220 720,100 1080,160 C1260,192 1380,140 1440,120 L1440,220 L0,220Z'/%3E%3Cpath fill='rgba(10,132,255,0.04)' d='M0,190 C480,140 960,200 1440,170 L1440,220 L0,220Z'/%3E%3C/svg%3E");
  background-size: cover;
  background-repeat: no-repeat;
}

@keyframes drift {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(30px, 40px) scale(1.08); }
}

/* ── Layout ─────────────────────────────────────────────── */
.page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-bottom: 40px;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Nav ─────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(4,14,31,0.72);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
  text-decoration: none;
  flex: 1;
}
.nav-logo-icon {
  font-size: 22px;
  filter: drop-shadow(0 0 8px rgba(10,132,255,0.6));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--glass);
}
.nav-link.active { color: var(--accent); }

.nav-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s;
  border: 2px solid rgba(255,255,255,0.2);
}
.nav-avatar:hover { transform: scale(1.08); }

/* Mobile nav */
.nav-mobile-menu { display: none; }
@media (max-width: 600px) {
  .nav-links { display: none; }
  .nav-mobile-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text);
  }
}

/* Bottom tab bar for mobile */
.tab-bar {
  display: none;
}
@media (max-width: 600px) {
  .tab-bar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 100;
    height: 72px;
    background: rgba(4,14,31,0.88);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-top: 1px solid var(--glass-border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tab-bar-inner {
    display: flex;
    width: 100%;
    align-items: center;
  }
  .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s;
    padding: 8px 0;
  }
  .tab-item.active { color: var(--accent); }
  .tab-item-icon { font-size: 22px; }
  .tab-item-book {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 26px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(10,132,255,0.5);
    margin-bottom: 2px;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
  }
  .tab-item-book:active { transform: scale(0.94); box-shadow: 0 2px 10px rgba(10,132,255,0.4); }
  .page-wrap { padding-bottom: 88px; }
}

/* ── Glass Card ──────────────────────────────────────────── */
.glass {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.glass-hover {
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.glass-hover:hover {
  background: var(--glass-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(10,132,255,0.4);
}
.btn-primary:hover { background: #0077ed; box-shadow: 0 6px 22px rgba(10,132,255,0.5); }

.btn-success {
  background: var(--accent2);
  color: #fff;
  box-shadow: 0 4px 16px rgba(48,209,88,0.35);
}
.btn-success:hover { background: #28c057; }

.btn-danger {
  background: rgba(255,69,58,0.15);
  color: var(--danger);
  border: 1px solid rgba(255,69,58,0.3);
}
.btn-danger:hover { background: rgba(255,69,58,0.25); }

.btn-ghost {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--glass-border);
}
.btn-ghost:hover { background: var(--glass-hover); }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 17px; }
.btn-block { width: 100%; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  font-family: var(--font);
  transition: border-color 0.2s, background 0.2s;
  outline: none;
  -webkit-appearance: none;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  border-color: var(--accent);
  background: rgba(10,132,255,0.08);
}
.form-control option { background: #0d1f38; color: var(--text); }

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-error {
  background: rgba(255,69,58,0.12);
  border: 1px solid rgba(255,69,58,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: #ff6b63;
  margin-bottom: 18px;
}

.form-success {
  background: rgba(48,209,88,0.12);
  border: 1px solid rgba(48,209,88,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: #34c759;
  margin-bottom: 18px;
}

/* ── Badge ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ── Avatar ──────────────────────────────────────────────── */
.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.15);
}

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  padding: 32px 0 20px;
}
.page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.page-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Booking Card ────────────────────────────────────────── */
.booking-card {
  padding: 18px;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.booking-card-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.booking-date-chip {
  background: rgba(10,132,255,0.15);
  border: 1px solid rgba(10,132,255,0.3);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  min-width: 52px;
}
.booking-date-chip .month {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.booking-date-chip .day {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.booking-card-body { flex: 1; min-width: 0; }
.booking-card-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.booking-card-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.booking-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.booking-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tank-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}
.tank-filled  { background: rgba(48,209,88,0.15);  color: #30D158; border: 1px solid rgba(48,209,88,0.3); }
.tank-empty   { background: rgba(255,214,10,0.12); color: #FFD60A; border: 1px solid rgba(255,214,10,0.3); }

/* ── Active booking glow ─────────────────────────────────── */
.booking-card.is-active {
  border-color: rgba(48,209,88,0.4);
  box-shadow: 0 0 0 1px rgba(48,209,88,0.2), var(--shadow);
}
.booking-card.is-active .booking-date-chip {
  background: rgba(48,209,88,0.15);
  border-color: rgba(48,209,88,0.3);
}
.booking-card.is-active .month { color: var(--accent2); }

/* ── Calendar strip ──────────────────────────────────────── */
.cal-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.cal-strip::-webkit-scrollbar { display: none; }

.cal-day {
  flex-shrink: 0;
  width: 54px;
  padding: 10px 0;
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--glass);
  border: 1px solid var(--glass-border);
}
.cal-day:hover { background: var(--glass-hover); }
.cal-day.has-booking { border-color: rgba(10,132,255,0.4); }
.cal-day.selected {
  background: var(--accent);
  border-color: var(--accent);
}
.cal-day-name { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.cal-day.selected .cal-day-name { color: rgba(255,255,255,0.75); }
.cal-day-num  { font-size: 18px; font-weight: 700; margin-top: 2px; }
.cal-day-dot  { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin: 4px auto 0; }

/* ── Timeline ────────────────────────────────────────────── */
.timeline-section { margin-top: 8px; }
.timeline-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 0 6px;
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.empty-state-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state-text  { font-size: 14px; }

/* ── Section divider ─────────────────────────────────────── */
.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Stat cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.stat-card {
  padding: 16px;
  text-align: center;
}
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-top: 2px; letter-spacing: 0.3px; }

/* ── Login page ──────────────────────────────────────────── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px 32px;
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo-icon {
  font-size: 52px;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 20px rgba(10,132,255,0.7));
  animation: float 4s ease-in-out infinite;
}
.login-logo-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.login-logo-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ── Fab ─────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 90;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(10,132,255,0.5);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.fab:active { transform: scale(0.93); }
@media (max-width: 600px) { .fab { display: none; } }

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--glass-border);
  margin: 20px 0;
}

/* ── User row ────────────────────────────────────────────── */
.user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 8px;
}
.user-row-info { flex: 1; min-width: 0; }
.user-row-name { font-size: 15px; font-weight: 600; }
.user-row-email { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-status-active   { color: var(--accent2); }
.user-status-pending  { color: var(--warning); }
.user-status-disabled { color: var(--text-muted); }

/* ── Toast ───────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 90px; left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 380px;
}
@media (min-width: 601px) { #toast-container { bottom: 24px; } }

.toast {
  background: rgba(30,40,60,0.95);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.3s ease, fadeOut 0.4s 2.8s ease forwards;
  pointer-events: all;
}
.toast.success { border-left: 3px solid var(--accent2); }
.toast.error   { border-left: 3px solid var(--danger); }

@keyframes slideUp  { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeOut  { to   { opacity:0; transform:translateY(-10px); } }

/* ── Confirm modal ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 env(safe-area-inset-bottom);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-sheet {
  background: rgba(15,25,48,0.96);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: 28px 28px 0 0;
  padding: 12px 24px 32px;
  width: 100%;
  max-width: 480px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
.modal-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  margin: 0 auto 20px;
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal-text  { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.5; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }

/* ── Pulse dot (live) ────────────────────────────────────── */
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent2);
  position: relative;
  display: inline-block;
  margin-right: 4px;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(48,209,88,0.3);
  animation: pulse 2s ease infinite;
}
@keyframes pulse { 0%,100%{transform:scale(1);opacity:0.7} 50%{transform:scale(1.6);opacity:0} }

/* ── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 480px) {
  .login-card  { padding: 32px 22px; }
  .page-title  { font-size: 24px; }
  .stats-grid  { gap: 8px; }
  .stat-value  { font-size: 22px; }
}

@media (min-width: 601px) {
  .tab-bar { display: none; }
}

/* ── Animations ──────────────────────────────────────────── */
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}
@keyframes fadeIn { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }

.stagger > * { animation: fadeIn 0.4s ease both; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.40s; }
