/* ============================================================
   bookings.css — My Bookings Page
   Extends style.css — Royal Indian Festival Theme
   Fully synced with booking.js
   ============================================================ */

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
.bookings-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ============================================================
   PAGE HERO
   ============================================================ */
.page-hero {
  position: relative;
  padding: 60px 0 48px;
  text-align: center;
  overflow: hidden;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(232, 57, 138, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 50%, rgba(232, 160, 32, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.page-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.6s ease both;
}

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

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--text-light);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}

/* ============================================================
   TABS
   ============================================================ */
.booking-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(245, 208, 96, 0.15);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.95rem;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tab-btn:hover {
  background: rgba(245, 208, 96, 0.08);
  border-color: rgba(245, 208, 96, 0.3);
  color: var(--gold-light);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: var(--grad-gold);
  border-color: transparent;
  color: var(--text-dark);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}

/* Tab status dots */
.tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-active    { background: #22c55e; }
.dot-expired   { background: #94a3b8; }
.dot-cancelled { background: #ef4444; }

.tab-btn.active .tab-dot { opacity: 0.7; }

/* Tab count badge — "(3)" shown next to label
   ISSUE #11 FIX: on active tab, .tab-btn.active sets color:var(--text-dark)
   but .tab-count was hardcoded to var(--gold-light) → gold on gold = invisible.
   Override it for the active state. */
.tab-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-light);
  opacity: 0.8;
  margin-left: 2px;
}

.tab-btn.active .tab-count {
  color: var(--text-dark); /* dark text on gold background — readable */
  opacity: 0.75;
}

/* ============================================================
   BOOKING LIST
   ============================================================ */
.booking-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
  animation: fadeIn 0.4s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   BOOKING CARD
   ============================================================ */
.booking-card {
  background: var(--grad-card);
  border: 1px solid rgba(245, 208, 96, 0.1);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  position: relative;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  overflow: hidden;
}

/* Left gold accent bar
   ISSUE #13 FIX: z-index:1 so it never overlaps .status-badge (z-index:2) */
.booking-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--grad-gold);
  border-radius: 4px 0 0 4px;
  z-index: 1;
}

.booking-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: rgba(245, 208, 96, 0.25);
}

/* Product image
   ISSUE #1 FIX: removed `.booking-card img` (bare element selector).
   booking.js outputs <img class="booking-card-img"> — class selector only.
   Old rule had higher specificity (0,1,1) and was overriding this class (0,1,0),
   making .booking-card-img styles redundant. Now only one rule exists. */
.booking-card-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 208, 96, 0.1);
  padding: 6px;
  flex-shrink: 0;
}

/* ============================================================
   BOOKING INFO
   ISSUE #2 FIX: removed `.booking-info h4` — specificity (0,1,1)
     was silently overriding .booking-name (0,1,0) font-size.
   ISSUE #3 FIX: removed `.booking-info p` — specificity (0,1,1)
     was overriding .booking-price color:gold → price appeared muted.
     This was a VISIBLE bug — price showed in grey instead of gold.
   ISSUE #4 FIX: removed `.booking-info .price` — booking.js outputs
     class="booking-price" not class="price" → was complete dead code.
   All typography now via explicit class selectors only.
   ============================================================ */
.booking-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.booking-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.booking-qty {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.booking-price {
  font-family: 'Baloo Bhai 2', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold-light); /* now correctly applied — no high-specificity override */
}

/* Expiry countdown
   ISSUE #5 FIX: removed dead .booking-countdown block (never output by booking.js).
   ISSUE #6 FIX: removed dead .booking-card .cancel-btn block (wrong class name).
   ISSUE #7 FIX: removed dead .tooltip / .tooltiptext blocks (old approach replaced). */
.booking-expiry {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  margin-top: 2px;
}

.expiry-icon { flex-shrink: 0; }

.expiry-text { font-weight: 600; }

/* Cancel booking button */
.cancel-booking-btn {
  margin-top: 8px;
  padding: 7px 16px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  width: fit-content;
}

.cancel-booking-btn:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
}

.cancel-booking-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   STATUS BADGES
   ISSUE #13 FIX: z-index:2 ensures badge always sits above
   the ::before accent bar (z-index:1) on all browsers.
   ============================================================ */
.status-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  z-index: 2;
}

.status-active {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
}

.status-expired {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #94a3b8;
}

.status-cancelled {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* ============================================================
   EMPTY / ERROR STATE
   ISSUE #8 FIX: removed .empty-state, .empty-icon, .empty-state h3,
   .empty-state p — all dead code. booking.js outputs .booking-empty.
   ISSUE #10 FIX: @keyframes float defined only ONCE here (was duplicated
   across the old .empty-state block and the new .booking-empty block).
   ============================================================ */
.booking-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 80px 24px;
}

.booking-empty-icon {
  font-size: 3.5rem;
  animation: float 3s ease-in-out infinite;
}

/* Single @keyframes float definition — ISSUE #10 FIX */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

.booking-empty h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-light);
}

.booking-empty p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 300px;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.booking-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 2, 32, 0.96);
  border: 1px solid rgba(245, 200, 66, 0.3);
  color: var(--text-light);
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 50px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 999;
  backdrop-filter: blur(12px);
}

.booking-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.booking-toast--error {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .bookings-page { padding: 0 16px 80px; }

  .booking-list { grid-template-columns: 1fr; }

  .booking-card { flex-direction: column; }

  /* ISSUE #12 FIX: was `.booking-card img` (bare element selector)
     which never matched because booking.js uses class="booking-card-img".
     Mobile image full-width was silently broken. Fixed to class selector. */
  .booking-card-img {
    width: 100%;
    height: 180px;
    object-fit: contain;
  }

  /* ISSUE #14 FIX: on mobile, badge is position:static and flows to the
     bottom of the flex column (after .booking-info in DOM order).
     order:-1 moves it visually to the top without touching the HTML. */
  .status-badge {
    position: static;
    align-self: flex-start;
    order: -1;
    margin-bottom: 4px;
  }
}

@media (max-width: 480px) {
  .page-hero   { padding: 40px 0 32px; }
  .booking-tabs { gap: 8px; }
  .tab-btn     { padding: 8px 16px; font-size: 0.85rem; }
}