/* ═══════════════════════════════════════════════════════
   BBV BOOKING SYSTEM — FRONTEND CSS
   Luxury Bali Villa Aesthetic · Airbnb Luxe · Aman Resorts
   ═══════════════════════════════════════════════════════ */

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

/* ─── VARIABLES ─── */
:root {
  --bbv-gold:    #c9a84c;
  --bbv-dark:    #1a1a1a;
  --bbv-charcoal:#2d2d2d;
  --bbv-cream:   #faf8f3;
  --bbv-muted:   #6b6b6b;
  --bbv-border:  #e8e2d6;
  --bbv-white:   #ffffff;
  --bbv-success: #2d7a4f;
  --bbv-danger:  #c0392b;
  --bbv-info:    #2980b9;
  --bbv-warning: #d68910;
  --bbv-radius:  6px;
  --bbv-shadow:  0 4px 24px rgba(0,0,0,0.08);
  --bbv-shadow-lg: 0 12px 48px rgba(0,0,0,0.14);
  font-family: 'DM Sans', sans-serif;
}

/* ─── WRAPPER ─── */
.bbv-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 60px;
  font-family: 'DM Sans', sans-serif;
  color: var(--bbv-dark);
}

/* ─── CARDS ─── */
.bbv-card {
  background: var(--bbv-white);
  border: 1px solid var(--bbv-border);
  border-radius: var(--bbv-radius);
  box-shadow: var(--bbv-shadow);
  padding: 32px;
  margin-bottom: 24px;
}

.bbv-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--bbv-dark);
  margin: 0 0 8px;
  letter-spacing: 0.01em;
}

.bbv-card-subtitle {
  color: var(--bbv-muted);
  font-size: 0.88rem;
  margin: 0 0 24px;
  font-weight: 300;
}

/* ─── SECTION HEADER ─── */
.bbv-section-header {
  border-bottom: 1px solid var(--bbv-border);
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.bbv-section-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--bbv-dark);
  margin: 0;
}

.bbv-section-header p {
  color: var(--bbv-muted);
  font-size: 0.85rem;
  margin: 4px 0 0;
}

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

.bbv-form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--bbv-charcoal);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bbv-form-group label .bbv-req {
  color: var(--bbv-gold);
}

.bbv-input,
.bbv-select,
.bbv-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--bbv-border);
  border-radius: var(--bbv-radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  color: var(--bbv-dark);
  background: var(--bbv-white);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.bbv-input:focus,
.bbv-select:focus,
.bbv-textarea:focus {
  outline: none;
  border-color: var(--bbv-gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}

.bbv-textarea {
  min-height: 100px;
  resize: vertical;
}

.bbv-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ─── BUTTONS ─── */
.bbv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--bbv-radius);
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.2s;
  letter-spacing: 0.04em;
  line-height: 1;
}

.bbv-btn-gold {
  background: var(--bbv-gold);
  color: var(--bbv-white) !important;
}
.bbv-btn-gold:hover { background: #b8922e; color: #fff !important; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(201,168,76,0.3); }

.bbv-btn-dark {
  background: var(--bbv-dark);
  color: var(--bbv-white) !important;
}
.bbv-btn-dark:hover { background: var(--bbv-charcoal); color: #fff !important; }

.bbv-btn-outline {
  background: transparent;
  color: var(--bbv-dark) !important;
  border: 1px solid var(--bbv-border);
}
.bbv-btn-outline:hover { border-color: var(--bbv-gold); color: var(--bbv-gold) !important; }

.bbv-btn-danger-outline {
  background: transparent;
  color: var(--bbv-danger) !important;
  border: 1px solid var(--bbv-danger);
}
.bbv-btn-danger-outline:hover { background: var(--bbv-danger); color: #fff !important; }

.bbv-btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem;
}

.bbv-btn-block { width: 100%; justify-content: center; }

.bbv-btn:disabled, .bbv-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── BADGES ─── */
.bbv-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.bbv-badge-warning   { background: #fef3cd; color: #856404; }
.bbv-badge-info      { background: #d1ecf1; color: #0c5460; }
.bbv-badge-primary   { background: #cce5ff; color: #004085; }
.bbv-badge-success   { background: #d4edda; color: #155724; }
.bbv-badge-danger    { background: #f8d7da; color: #721c24; }
.bbv-badge-secondary { background: #e2e3e5; color: #383d41; }

/* ─── NOTICES ─── */
.bbv-notice {
  padding: 12px 18px;
  border-radius: var(--bbv-radius);
  font-size: 0.9rem;
  margin-bottom: 16px;
  border-left: 4px solid;
}
.bbv-notice-success { background: #f0faf4; border-color: var(--bbv-success); color: var(--bbv-success); }
.bbv-notice-error   { background: #fdf2f2; border-color: var(--bbv-danger); color: var(--bbv-danger); }
.bbv-notice-info    { background: #f0f6ff; border-color: var(--bbv-info); color: #1a5276; }
.bbv-notice-warning { background: #fef9ec; border-color: var(--bbv-warning); color: #7d4e00; }

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

.bbv-or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--bbv-muted);
  font-size: 0.82rem;
}
.bbv-or-divider::before,
.bbv-or-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--bbv-border);
}

/* ─── AUTH PAGES ─── */
.bbv-auth-wrap {
  max-width: 480px;
  margin: 40px auto;
  padding: 0 16px;
}

.bbv-auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.bbv-auth-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--bbv-dark);
  margin: 0 0 6px;
}

.bbv-auth-header p {
  color: var(--bbv-muted);
  font-size: 0.88rem;
  margin: 0;
}

.bbv-auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--bbv-muted);
}

.bbv-auth-footer a {
  color: var(--bbv-gold);
  font-weight: 500;
}

/* ─── ACCOUNT DASHBOARD ─── */
.bbv-dashboard-greeting {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--bbv-dark);
  margin: 0 0 4px;
}

.bbv-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.bbv-stat-card {
  background: var(--bbv-cream);
  border: 1px solid var(--bbv-border);
  border-radius: var(--bbv-radius);
  padding: 20px;
  text-align: center;
}

.bbv-stat-card .bbv-stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--bbv-gold);
  display: block;
}

.bbv-stat-card .bbv-stat-label {
  font-size: 0.78rem;
  color: var(--bbv-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-top: 4px;
}

/* ─── BOOKING LIST ─── */
.bbv-booking-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bbv-booking-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--bbv-border);
  border-radius: var(--bbv-radius);
  margin-bottom: 12px;
  background: var(--bbv-white);
  transition: box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  color: inherit;
}

.bbv-booking-item:hover {
  box-shadow: var(--bbv-shadow);
  border-color: var(--bbv-gold);
  color: inherit;
  text-decoration: none;
}

.bbv-booking-item-thumb {
  width: 70px;
  height: 54px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.bbv-booking-item-info {
  flex: 1;
  min-width: 0;
}

.bbv-booking-item-villa {
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bbv-booking-item-dates {
  font-size: 0.82rem;
  color: var(--bbv-muted);
  margin-top: 3px;
}

.bbv-booking-item-code {
  font-size: 0.78rem;
  color: var(--bbv-muted);
  font-family: monospace;
}

.bbv-booking-item-right {
  text-align: right;
  flex-shrink: 0;
}

.bbv-booking-item-price {
  font-weight: 600;
  color: var(--bbv-gold);
  font-size: 1rem;
}

/* ─── BOOKING DETAIL ─── */
.bbv-booking-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.bbv-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--bbv-border);
  font-size: 0.9rem;
}

.bbv-detail-row:last-child { border-bottom: none; }

.bbv-detail-label {
  color: var(--bbv-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bbv-detail-value {
  font-weight: 500;
  text-align: right;
}

.bbv-price-total {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--bbv-gold);
}

/* ─── TABS ─── */
.bbv-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--bbv-border);
  margin-bottom: 24px;
}

.bbv-tab {
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--bbv-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
  letter-spacing: 0.03em;
}

.bbv-tab.active,
.bbv-tab:hover {
  color: var(--bbv-dark);
  border-bottom-color: var(--bbv-gold);
}

.bbv-tab-panel { display: none; }
.bbv-tab-panel.active { display: block; }

/* ─── MESSAGING ─── */
.bbv-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 16px;
  background: #f8f7f4;
  border-radius: var(--bbv-radius);
  border: 1px solid var(--bbv-border);
  margin-bottom: 16px;
  scroll-behavior: smooth;
}

.bbv-message {
  display: flex;
}

.bbv-msg-mine {
  justify-content: flex-end;
}

.bbv-msg-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.bbv-msg-mine .bbv-msg-bubble {
  background: var(--bbv-gold);
  color: var(--bbv-white);
  border-bottom-right-radius: 4px;
}

.bbv-msg-theirs .bbv-msg-bubble {
  background: var(--bbv-white);
  border: 1px solid var(--bbv-border);
  color: var(--bbv-dark);
  border-bottom-left-radius: 4px;
}

.bbv-msg-sender {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 3px;
  opacity: 0.8;
}

.bbv-msg-time {
  display: block;
  font-size: 0.7rem;
  margin-top: 4px;
  opacity: 0.65;
}

.bbv-msg-bubble p {
  margin: 0;
}

.bbv-chat-input {
  display: flex;
  gap: 8px;
}

.bbv-chat-input textarea {
  flex: 1;
  min-height: 56px;
  resize: none;
}

/* ─── BOOKING FORM ─── */
.bbv-booking-form-card {
  background: var(--bbv-cream);
  border: 1px solid var(--bbv-border);
  border-radius: var(--bbv-radius);
  padding: 28px;
}

.bbv-villa-preview {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  background: var(--bbv-white);
  border: 1px solid var(--bbv-border);
  border-radius: var(--bbv-radius);
  margin-bottom: 24px;
}

.bbv-villa-preview img {
  width: 100px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.bbv-villa-preview-info h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  margin: 0 0 4px;
  font-weight: 600;
}

.bbv-price-summary {
  background: var(--bbv-dark);
  color: var(--bbv-white);
  border-radius: var(--bbv-radius);
  padding: 20px;
  margin-top: 20px;
}

.bbv-price-summary .bbv-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  padding: 6px 0;
}

.bbv-price-summary .bbv-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 600;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.2);
  color: var(--bbv-gold);
}

/* ─── CONFIRMATION PAGE ─── */
.bbv-confirmation {
  text-align: center;
  padding: 40px 20px;
}

.bbv-confirmation-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.bbv-confirmation h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--bbv-dark);
  margin-bottom: 8px;
}

.bbv-confirmation-code {
  font-family: monospace;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  color: var(--bbv-gold);
  background: #fef9ec;
  padding: 8px 20px;
  border-radius: 50px;
  display: inline-block;
  margin-bottom: 20px;
}

/* ─── STATUS TIMELINE ─── */
.bbv-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 24px 0;
  overflow-x: auto;
  padding-bottom: 8px;
}

.bbv-timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 80px;
  position: relative;
}

.bbv-timeline-step::before {
  content: '';
  position: absolute;
  top: 12px;
  left: -50%;
  right: 50%;
  height: 2px;
  background: var(--bbv-border);
  z-index: 0;
}

.bbv-timeline-step:first-child::before { display: none; }

.bbv-timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bbv-border);
  border: 2px solid var(--bbv-border);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.bbv-timeline-step.done .bbv-timeline-dot { background: var(--bbv-gold); border-color: var(--bbv-gold); color: white; }
.bbv-timeline-step.active .bbv-timeline-dot { background: var(--bbv-white); border-color: var(--bbv-gold); box-shadow: 0 0 0 4px rgba(201,168,76,0.2); }
.bbv-timeline-step.done::before { background: var(--bbv-gold); }

.bbv-timeline-label {
  font-size: 0.68rem;
  color: var(--bbv-muted);
  text-align: center;
  margin-top: 6px;
  white-space: nowrap;
}

.bbv-timeline-step.active .bbv-timeline-label { color: var(--bbv-dark); font-weight: 500; }

/* ─── PAYMENT UPLOAD ─── */
.bbv-upload-area {
  border: 2px dashed var(--bbv-border);
  border-radius: var(--bbv-radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.bbv-upload-area:hover, .bbv-upload-area.dragover {
  border-color: var(--bbv-gold);
  background: #fef9ec;
}

.bbv-upload-area input[type=file] {
  display: none;
}

.bbv-upload-icon { font-size: 40px; margin-bottom: 8px; }

/* ─── VILLA CARD ENHANCEMENT (override theme) ─── */
.bbv-villa-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--bbv-shadow);
  transition: box-shadow 0.3s, transform 0.3s;
  background: var(--bbv-white);
}

.bbv-villa-card:hover {
  box-shadow: var(--bbv-shadow-lg);
  transform: translateY(-3px);
}

.bbv-villa-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.bbv-villa-card-body {
  padding: 16px;
}

.bbv-villa-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--bbv-dark);
}

.bbv-villa-card-price {
  color: var(--bbv-gold);
  font-weight: 600;
  font-size: 0.95rem;
}

.bbv-villa-card-location {
  font-size: 0.8rem;
  color: var(--bbv-muted);
  margin-bottom: 12px;
}

/* ─── INVOICE ─── */
.bbv-invoice-preview {
  border: 1px solid var(--bbv-border);
  border-radius: var(--bbv-radius);
  overflow: hidden;
}

.bbv-invoice-header {
  background: var(--bbv-dark);
  color: var(--bbv-gold);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bbv-invoice-body {
  padding: 24px;
}

.bbv-invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.bbv-invoice-table th {
  background: #f5f5f0;
  padding: 8px 12px;
  text-align: left;
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bbv-muted);
}

.bbv-invoice-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bbv-border);
}

.bbv-invoice-total-row td {
  font-weight: 600;
  color: var(--bbv-gold);
  font-size: 1rem;
  border-top: 2px solid var(--bbv-border);
}

/* ─── STATUS FILTER TABS ─── */
.bbv-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.bbv-filter-tab {
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--bbv-border);
  background: var(--bbv-white);
  color: var(--bbv-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.bbv-filter-tab.active, .bbv-filter-tab:hover {
  background: var(--bbv-gold);
  border-color: var(--bbv-gold);
  color: var(--bbv-white);
  text-decoration: none;
}

/* ─── LOADING SPINNER ─── */
.bbv-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: bbv-spin 0.7s linear infinite;
}

@keyframes bbv-spin {
  to { transform: rotate(360deg); }
}

/* ─── BOOK NOW BUTTON on villa posts ─── */
.bbv-book-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(201,168,76,0.5);
  padding: 14px 28px;
  font-size: 0.95rem;
  border-radius: 50px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .bbv-form-row { grid-template-columns: 1fr; }
  .bbv-stats-grid { grid-template-columns: 1fr 1fr; }
  .bbv-booking-detail { grid-template-columns: 1fr; }
  .bbv-card { padding: 20px; }
  .bbv-booking-item-thumb { display: none; }
}

@media (max-width: 480px) {
  .bbv-stats-grid { grid-template-columns: 1fr 1fr; }
  .bbv-card { padding: 16px; }
}
