/* ============================================================
   YOGA STUDIO BOOKING — Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Jost:wght@300;400;500&display=swap');

/* ── Variables ────────────────────────────────────────────── */
:root {
  --bg:         #F5EFE7;
  --bg-dark:    #EDE5D8;
  --card:       #FFFFFF;
  --text:       #1A1A1A;
  --text-muted: #8A7F74;
  --accent:     #C9A27E;
  --accent-dk:  #A8835D;
  --border:     #E8E2D9;
  --success:    #6B8F71;
  --error:      #C0614A;
  --radius:     14px;
  --shadow:     0 4px 24px rgba(30,20,10,.07);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans:  'Jost', sans-serif;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dk); }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 300; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.1rem; }
p  { font-size: .95rem; color: var(--text-muted); }

/* ── Layout ───────────────────────────────────────────────── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.section    { padding: 64px 0; }

/* ── Nav ──────────────────────────────────────────────────── */
.nav {
  background: rgba(245,239,231,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; max-width: 1140px; margin: 0 auto;
}
.nav-logo {
  font-family: var(--font-serif); font-size: 1.5rem; font-weight: 400;
  color: var(--text); letter-spacing: .03em;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; align-items: center; list-style: none; }
.nav-links a { font-size: .88rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text); transition: color .2s; }
.nav-links a:hover { color: var(--accent); }
.nav-burger { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-burger span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; transition: .3s; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-block; font-family: var(--font-sans); font-size: .85rem;
  font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  padding: 12px 28px; border-radius: 50px; border: none; cursor: pointer;
  transition: all .25s; text-align: center;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dk); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,162,126,.35); }
.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-ghost  { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover  { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #a84f3a; }
.btn-sm { padding: 8px 18px; font-size: .8rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-body { padding: 28px; }

/* ── Class Card ───────────────────────────────────────────── */
.class-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column; gap: 12px;
}
.class-card:hover { transform: translateY(-3px); box-shadow: 0 10px 36px rgba(30,20,10,.11); }
.class-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.class-title { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 400; color: var(--text); }
.class-time  { font-size: .82rem; color: var(--text-muted); letter-spacing: .04em; }
.class-instructor { font-size: .85rem; color: var(--accent); font-weight: 500; }
.class-day   { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }

/* Capacity bar */
.capacity-bar-wrap { margin: 8px 0; }
.capacity-label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-muted); margin-bottom: 6px; }
.capacity-bar { height: 6px; background: var(--bg-dark); border-radius: 10px; overflow: hidden; }
.capacity-fill { height: 100%; border-radius: 10px; background: var(--accent); transition: width .5s ease; }
.capacity-fill.near-full { background: #C0614A; }
.capacity-fill.half-full { background: var(--accent); }
.spots-badge {
  display: inline-block; font-size: .78rem; padding: 3px 10px; border-radius: 20px;
  background: #f0ece5; color: var(--text-muted); font-weight: 500;
}
.spots-badge.sold-out { background: #faeae7; color: var(--error); }
.spots-badge.few-left  { background: #fdf3eb; color: #c07a3a; }

/* ── Schedule Grid ────────────────────────────────────────── */
.schedule-day { margin-bottom: 56px; }
.schedule-day-header {
  display: flex; align-items: baseline; gap: 16px; margin-bottom: 24px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.schedule-day-name { font-family: var(--font-serif); font-size: 2rem; font-weight: 300; }
.schedule-day-theme { font-size: .78rem; color: var(--accent); letter-spacing: .14em; text-transform: uppercase; font-weight: 500; }
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: .85rem; font-weight: 500; letter-spacing: .04em; margin-bottom: 8px; color: var(--text); }
.form-control {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--border);
  border-radius: 8px; font-family: var(--font-sans); font-size: .9rem;
  background: var(--bg); color: var(--text); transition: border-color .2s;
  outline: none;
}
.form-control:focus { border-color: var(--accent); background: #fff; }
.form-control::placeholder { color: #bbb; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Flash Messages ───────────────────────────────────────── */
.flash { padding: 14px 20px; border-radius: 8px; margin-bottom: 20px; font-size: .9rem; font-weight: 500; }
.flash-success { background: #edf5ee; color: #3d6b43; border: 1px solid #b4d9b8; }
.flash-error   { background: #faeae7; color: #9c3a28; border: 1px solid #e8b5ac; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  background: radial-gradient(ellipse at 60% 40%, rgba(201,162,126,.13) 0%, transparent 70%),
              radial-gradient(ellipse at 20% 70%, rgba(201,162,126,.07) 0%, transparent 60%);
}
.hero-eyebrow { font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.hero h1 { margin-bottom: 20px; font-style: italic; }
.hero p  { font-size: 1.05rem; max-width: 540px; margin: 0 auto 36px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ── Auth forms ───────────────────────────────────────────── */
.auth-wrap { min-height: calc(100vh - 80px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 48px; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.auth-card h2 { margin-bottom: 8px; }
.auth-card .subtitle { margin-bottom: 32px; font-size: .9rem; }
.auth-switch { text-align: center; margin-top: 24px; font-size: .88rem; color: var(--text-muted); }

/* ── Dashboard ────────────────────────────────────────────── */
.dashboard-header { padding: 48px 0 32px; border-bottom: 1px solid var(--border); margin-bottom: 40px; }
.dashboard-header h1 { margin-bottom: 4px; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 40px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; }
.stat-number { font-family: var(--font-serif); font-size: 2.5rem; color: var(--accent); font-weight: 300; }
.stat-label  { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.section-title { font-family: var(--font-serif); font-size: 1.6rem; margin-bottom: 20px; font-weight: 300; }

/* ── Booking Item ─────────────────────────────────────────── */
.booking-list { display: flex; flex-direction: column; gap: 14px; }
.booking-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.booking-item-info h4 { font-family: var(--font-serif); font-size: 1.1rem; margin-bottom: 4px; }
.booking-item-info p  { font-size: .85rem; }
.booking-item-actions { display: flex; gap: 10px; flex-shrink: 0; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; }
.badge-paid     { background: #edf5ee; color: #3d6b43; }
.badge-pending  { background: #fef9ec; color: #8a6a1a; }
.badge-cancelled{ background: #f5f0eb; color: #888; }

/* ── Table ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; padding: 12px 16px; background: var(--bg-dark); font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #faf6f0; }

/* ── Footer ───────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 80px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-brand { font-family: var(--font-serif); font-size: 1.2rem; }
.footer-copy  { font-size: .82rem; color: var(--text-muted); }

/* ── Divider ──────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* ── Google Calendar button ───────────────────────────────── */
.gcal-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 10px 20px; font-size: .85rem; font-weight: 500; color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.gcal-btn:hover { border-color: var(--accent); box-shadow: 0 2px 12px rgba(201,162,126,.2); color: var(--text); }
.gcal-icon { width: 18px; height: 18px; }

/* ── Confirmation box ─────────────────────────────────────── */
.confirm-box { text-align: center; padding: 60px 40px; }
.confirm-icon { font-size: 3rem; margin-bottom: 16px; }
.confirm-box h2 { margin-bottom: 12px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 70px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 20px; gap: 16px; }
  .nav-links.open { display: flex; }
  .nav-burger { display: block; }
  .nav-inner { position: relative; }
  .hero { padding: 60px 0 50px; }
  .auth-card { padding: 32px 24px; }
  .booking-item { flex-direction: column; align-items: flex-start; }
  .footer-inner { flex-direction: column; text-align: center; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   PWA + APP NAVIGATION ADDITIONS
   ============================================================ */

/* ── Logo in nav ──────────────────────────────────────────── */
.nav-logo { display: flex; align-items: center; }
.nav-logo-img { height: 44px; width: auto; display: block; }

/* ── Body padding for bottom nav ─────────────────────────── */
body.has-bottom-nav {
  padding-bottom: calc(68px + env(safe-area-inset-bottom));
}
@media (min-width: 769px) {
  body.has-bottom-nav { padding-bottom: 0; }
}

/* ── Bottom Tab Navigation ────────────────────────────────── */
.bottom-nav {
  display: none; /* hidden on desktop */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 24px rgba(0,0,0,.08);
}

@media (max-width: 768px) {
  .bottom-nav { display: flex; }
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px 8px;
  color: var(--text-muted);
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .2s;
  gap: 4px;
  position: relative;
}
.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--accent);
}
.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 2.5px;
  background: var(--accent);
  border-radius: 0 0 4px 4px;
}
.bnav-icon {
  width: 22px; height: 22px;
  stroke: currentColor;
  flex-shrink: 0;
}

/* Centre booking button */
.bottom-nav-center {
  flex: 1.2;
  padding-top: 0;
  margin-top: -14px;
}
.bottom-nav-center::after { display: none !important; }
.bnav-center-btn {
  width: 52px; height: 52px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(201,162,126,.5);
  transition: transform .2s, box-shadow .2s;
  margin-bottom: 4px;
}
.bnav-center-btn svg {
  width: 22px; height: 22px;
  stroke: #fff;
}
.bottom-nav-center:hover .bnav-center-btn,
.bottom-nav-center.active .bnav-center-btn {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(201,162,126,.6);
}
.bottom-nav-center span { color: var(--accent); font-weight: 600; }

/* ── PWA Install Banner ────────────────────────────────────── */
.pwa-banner {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 12px; right: 12px;
  z-index: 190;
  background: #1A1A1A;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  animation: slideUpBanner .4s cubic-bezier(.34,1.56,.64,1) both;
}
@media (min-width: 769px) {
  .pwa-banner {
    bottom: 20px;
    left: auto; right: 20px;
    width: 360px;
  }
}
@keyframes slideUpBanner {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.pwa-banner[hidden] { display: none !important; }

.pwa-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.pwa-banner-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}
.pwa-banner-text {
  flex: 1;
  display: flex; flex-direction: column; gap: 2px;
}
.pwa-banner-text strong {
  font-size: .84rem; font-weight: 600; color: #fff; line-height: 1.2;
}
.pwa-banner-text span {
  font-size: .72rem; color: rgba(255,255,255,.55);
}
.pwa-install-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 7px 16px;
  font-family: var(--font-sans);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.pwa-install-btn:hover { background: var(--accent-dk); }
.pwa-dismiss-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.4);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color .2s;
  flex-shrink: 0;
}
.pwa-dismiss-btn:hover { color: rgba(255,255,255,.8); }

/* iOS Safari install hint banner */
.ios-install-hint {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom) + 8px);
  left: 12px; right: 12px;
  z-index: 190;
  background: #1A1A1A;
  border-radius: 16px;
  padding: 16px;
  color: #fff;
  font-size: .82rem;
  line-height: 1.5;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  animation: slideUpBanner .4s cubic-bezier(.34,1.56,.64,1) both;
}
.ios-install-hint[hidden] { display: none !important; }
.ios-hint-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; color: rgba(255,255,255,.4);
  font-size: 1.1rem; cursor: pointer;
}
.ios-hint-arrow {
  display: block;
  text-align: center;
  font-size: 1.4rem;
  margin-top: 8px;
  animation: bounce .8s ease infinite alternate;
}
@keyframes bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(4px); }
}
