/* Modern minimal grey/dark theme - mobile-first */

/* Background image - use relative path; place your file at ./photos/background.JPG */
:root {
  --bg-image: url("./photos/background.JPG");
  --bg-overlay: rgba(6, 8, 10, 0.78);
  --card: rgba(255, 255, 255, 0.03);
  --muted: #9aa0a6;
  --text: #e9eef0;
  --accent: #b22; /* subtle red accent */
  --success: #05a587;
  --danger: #ef4444;
  --radius: 12px;
}

/* reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body,
#app {
  height: 100%;
}
body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom);
  background-color: #0b0f11;
  background-blend-mode: multiply;
}

/* app shell */
.app-shell {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px auto;
}

/* top */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #111, #0b0b0b);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
}
.title {
  font-weight: 700;
  font-size: 16px;
}
.subtitle {
  font-size: 12px;
  color: var(--muted);
}

/* buttons */
.btn {
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
}
.btn.subtle {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--muted);
}
.btn.primary {
  background: linear-gradient(180deg, var(--accent), #7f1212);
  color: white;
}
.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.12);
}

/* main content */
.content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 10px;

  /* Centers the calendar/slots vertically on the screen */
  flex-grow: 1;
  justify-content: center;
}

/* Card Styling (Frosted Glass) */
.card {
  background: rgba(15, 17, 18, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

/* calendar card */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.icon-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 8px;
  border-radius: 8px;
  color: var(--text);
}
.month-label {
  font-weight: 700;
  font-size: 15px;
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  color: var(--muted);
  font-size: 12px;
  padding: 6px 4px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 10px;
}
.day {
  min-height: 44px;
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 600;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.02);
}
.day.inactive {
  opacity: 0.28;
  font-weight: 500;
}
.day.selected {
  background: linear-gradient(180deg, #223232, #0f2b2b);
  color: #eafbf9;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
.day:hover {
  transform: translateY(-2px);
  transition: transform 0.12s;
}

/* slots */
.slots-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
/* Back Button Styling */
#backToCalendarBtn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 14px;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* Slot Styling */
.slot {
  background: rgba(26, 28, 30, 0.85);
  padding: 10px;
  border-radius: 10px;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.03);
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition:
    transform 0.08s,
    box-shadow 0.12s;
}
.slot:active {
  transform: translateY(1px);
}
.slot.free:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}
.slot.time {
  font-size: 14px;
  color: var(--muted);
}
.slot.client {
  font-size: 13px;
  margin-top: 6px;
  color: var(--text);
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot.booked {
  background: linear-gradient(
    90deg,
    rgba(178, 34, 34, 0.12),
    rgba(20, 20, 20, 0.08)
  );
  border-color: rgba(178, 34, 34, 0.15);
  cursor: default;
}

/* chips */
.chip {
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 12px;
}
.chip.free {
  background: rgba(5, 165, 130, 0.06);
  color: var(--success);
}
.chip.booked {
  background: rgba(178, 34, 34, 0.06);
  color: var(--danger);
}

/* modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}
.modal[aria-hidden="false"] {
  pointer-events: auto;
}
.modal-card {
  width: 100%;
  max-width: 520px;
  background: linear-gradient(180deg, #0b0c0d, #091011);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.modal-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}
.modal-card label {
  font-size: 13px;
  color: var(--muted);
  display: block;
  margin-top: 8px;
  margin-bottom: 6px;
}
.modal-card input {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: transparent;
  color: var(--text);
  font-size: 16px; /* Fixes iOS Zoom */
}

/* modal actions */
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 12px;
}
.spacer {
  flex: 1;
}

/* footer */
.bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 6px 0;
  font-size: 13px;
}

/* responsive */
@media (min-width: 700px) {
  .slots-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .calendar-grid .day {
    min-height: 64px;
  }
}

/* Danger Glow Pulse Animation */
@keyframes danger-glow-pulse {
  0% {
    transform: scale(1);
    box-shadow:
      0 0 0 0 var(--danger),
      0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    transform: scale(1.02);
    box-shadow:
      0 0 0 6px rgba(239, 68, 68, 0.2),
      0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: none;
  }
}

.slot.flash-booked {
  animation: danger-glow-pulse 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94)
    forwards;
  position: relative;
  z-index: 10;
  background: rgba(178, 34, 34, 0.06);
  color: var(--danger);
}

/* Permanent highlight for booked slots (Red Text) */
.slot.slot-booked-highlight .time,
.slot.slot-booked-highlight .client {
  color: var(--danger);
  opacity: 1;
  font-weight: 700;
}
.day.today {
  position: relative;
  font-weight: bold;
  color: #fff;
}
.day.today::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  background-color: var(--accent);
  border-radius: 50%;
}
.day.selected.today::after {
  background-color: #fff;
}
/* --- NAVIGATION ANIMATIONS --- */

/* 1. Forward: Calendar Exits Left */
@keyframes slideOutLeft {
  to {
    opacity: 0;
    transform: translateX(-40px);
  }
}
.anim-exit-left {
  animation: slideOutLeft 0.3s ease-in forwards;
}

/* 2. Forward: Slots Enter from Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.anim-enter-right {
  animation: slideInRight 0.3s ease-out forwards;
}

/* 3. Back: Slots Exit Right */
@keyframes slideOutRight {
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}
.anim-exit-right {
  animation: slideOutRight 0.3s ease-in forwards;
}

/* 4. Back: Calendar Enters from Left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.anim-enter-left {
  animation: slideInLeft 0.3s ease-out forwards;
}
.stats-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;

  margin: 8px 15px 6px;
  padding: 6px 8px;

  background: rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 14px;

  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

/* compact iphone-style pills */
.stat-item {
  display: flex;
  align-items: center;
  gap: 7px;

  padding: 7px 12px;

  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);

  border-radius: 999px;
}

.stat-item span {
  font-size: 0.66rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-item strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text); /* no green */
}

/* subtle accent on values only */
#weeklyCount,
#monthlyCount {
  color: #d7dde0;
}

/* iPhone 16 / mobile tuning */
@media (max-width: 430px) {
  .stats-bar {
    gap: 6px;
    padding: 5px 6px;
    margin: 6px 12px 4px;
  }

  .stat-item {
    padding: 6px 10px;
    gap: 5px;
  }

  .stat-item span {
    font-size: 0.6rem;
  }

  .stat-item strong {
    font-size: 0.92rem;
  }
}

/* ─────────────────────────────────────────
   HAMBURGER BUTTON
   ───────────────────────────────────────── */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ─────────────────────────────────────────
   DRAWER OVERLAY
   ───────────────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 200;
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ─────────────────────────────────────────
   DRAWER PANEL
   ───────────────────────────────────────── */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 260px;
  background: linear-gradient(180deg, #0e1113, #0b0d0f);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 201;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.drawer.open {
  transform: translateX(0);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.drawer-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.drawer-body {
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  gap: 4px;
}
.drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  color: var(--text);
}
.drawer-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.04);
}
.drawer-item.danger {
  color: var(--danger);
}
.drawer-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  color: var(--muted);
}
.drawer-item.danger .drawer-icon {
  color: var(--danger);
}
.drawer-item-label {
  font-size: 14px;
  font-weight: 600;
}
.drawer-item-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.drawer-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  margin: 8px 4px;
}
