/* ── ROOT DESIGN TOKENS & COLOR PALETTE ── */
:root {
  --primary: #ff385c;
  --primary-hover: #e00b41;
  --primary-gradient: linear-gradient(135deg, #ff385c 0%, #e00b41 50%, #bd1e59 100%);
  --secondary: #008489;
  --accent: #ffb400;
  
  --bg-main: #ffffff;
  --bg-subtle: #f8f9fa;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  
  --text-main: #222222;
  --text-muted: #717171;
  --text-inverse: #ffffff;
  
  --border-color: #ebebeb;
  --border-subtle: #dddddd;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 14px 28px rgba(0, 0, 0, 0.14);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Tokens */
[data-theme="dark"] {
  --bg-main: #0f172a;
  --bg-subtle: #1e293b;
  --bg-card: #1e293b;
  --bg-glass: rgba(30, 41, 59, 0.85);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  
  --border-color: #334155;
  --border-subtle: #475569;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 14px 28px rgba(0, 0, 0, 0.6);
}

/* Global Reset & Typography */
* {
  box-sizing: border-box;
}

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  background-color: var(--bg-main) !important;
  color: var(--text-main) !important;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.main-content {
  flex: 1;
}

/* ── NAVBAR ── */
.navbar-custom {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  height: 5rem;
  transition: var(--transition);
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.4rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.brand-logo-icon {
  font-size: 1.8rem;
  color: var(--primary);
  -webkit-text-fill-color: var(--primary);
}

/* Search Bar in Navbar */
.search-pill-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-pill);
  transition: var(--transition);
}

.search-pill-bar:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-subtle);
}

.search-field-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-main);
  line-height: 1;
}

.search-field-input {
  font-size: 0.85rem;
  color: var(--text-main);
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
}

.search-field-input::placeholder {
  color: var(--text-muted);
}

.search-submit-btn {
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.search-submit-btn:hover {
  transform: scale(1.06);
}

/* User Menu Button */
.user-menu-btn {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  border-radius: var(--radius-pill) !important;
  padding: 6px 14px !important;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.user-menu-btn:hover {
  box-shadow: var(--shadow-md);
}

.user-avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ── CATEGORY BAR ── */
.cat-bar-wrapper {
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 5rem;
  z-index: 90;
  transition: var(--transition);
}

.cat-bar {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}

.cat-bar::-webkit-scrollbar {
  display: none;
}

.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 18px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--transition);
  text-decoration: none;
  flex-shrink: 0;
}

.cat-item i {
  font-size: 1.3rem;
  transition: var(--transition);
}

.cat-item:hover {
  color: var(--text-main);
  border-bottom-color: var(--border-subtle);
  transform: translateY(-2px);
}

.cat-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

.cat-scroll-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  transition: var(--transition);
}

.cat-scroll-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

/* ── PROPERTY LISTING CARDS ── */
.listing-card-modern {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.listing-card-modern:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}

.listing-img-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-subtle);
}

.listing-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.listing-card-modern:hover .listing-img-container img {
  transform: scale(1.05);
}

.listing-category-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: white;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  z-index: 2;
  text-transform: capitalize;
}

.listing-heart-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: var(--transition);
  color: white;
  font-size: 1.1rem;
}

.listing-heart-btn:hover {
  transform: scale(1.18);
  background: rgba(0, 0, 0, 0.6);
}

.listing-heart-btn.is-saved {
  background: white;
  color: #ff385c;
}

.listing-info-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.listing-card-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.listing-card-location {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.listing-card-specs {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  gap: 8px;
}

.listing-card-price {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px dashed var(--border-color);
}

.price-bold {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
}

/* ── STICKY BOOKING WIDGET ON SHOW PAGE ── */
.booking-widget-card {
  position: sticky;
  top: 6.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
}

.booking-price-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.booking-dates-box {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}

.booking-dates-row {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
}

.booking-date-col {
  flex: 1;
  padding: 10px 14px;
}

.booking-date-col:first-child {
  border-right: 1px solid var(--border-subtle);
}

.booking-date-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-main);
  display: block;
}

.booking-date-input {
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  width: 100%;
  outline: none;
}

.booking-guests-col {
  padding: 10px 14px;
}

.btn-gradient-reserve {
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 14px;
  width: 100%;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(255, 56, 92, 0.4);
}

.btn-gradient-reserve:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 56, 92, 0.5);
  color: white;
}

.price-breakdown-table {
  width: 100%;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.price-breakdown-table td {
  padding: 6px 0;
}

.price-breakdown-total {
  border-top: 1px solid var(--border-color);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
  padding-top: 12px;
}

/* ── AMENITIES GRID ── */
.amenities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.amenity-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

/* ── AI ASSISTANT WIDGET ── */
.ai-floating-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(255, 56, 92, 0.45);
  cursor: pointer;
  z-index: 1000;
  transition: var(--transition);
  animation: pulseAura 3s infinite;
}

@keyframes pulseAura {
  0% { box-shadow: 0 0 0 0 rgba(255, 56, 92, 0.5); }
  70% { box-shadow: 0 0 0 16px rgba(255, 56, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 56, 92, 0); }
}

.ai-floating-btn:hover {
  transform: translateY(-4px) scale(1.05);
}

.ai-chat-window {
  position: fixed;
  bottom: 90px;
  right: 30px;
  width: 400px;
  max-width: calc(100vw - 40px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  z-index: 1001;
  overflow: hidden;
  animation: slideUpFade 0.3s ease;
}

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

.ai-chat-header {
  background: var(--primary-gradient);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-subtle);
}

.ai-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.5;
}

.ai-msg-bot {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.ai-msg-user {
  background: var(--primary-gradient);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ai-chat-footer {
  padding: 12px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

/* ── HOST DASHBOARD & CHARTS ── */
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.kpi-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 12px;
}

.kpi-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ── PRINTABLE INVOICE / RECEIPT ── */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .navbar, footer, .cat-bar-wrapper, .ai-floating-btn, .no-print {
    display: none !important;
  }
  .invoice-card {
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
  }
}

/* Floating Toast */
.modern-toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.modern-toast {
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(10px);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastFadeIn 0.3s ease;
  pointer-events: auto;
}

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

/* Dropdown override */
.dropdown-menu {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  box-shadow: var(--shadow-lg) !important;
}

.dropdown-item {
  color: var(--text-main) !important;
}

.dropdown-item:hover {
  background-color: var(--bg-subtle) !important;
}

.card {
  background-color: var(--bg-card) !important;
  color: var(--text-main) !important;
}

.form-control, .form-select {
  background-color: var(--bg-card) !important;
  color: var(--text-main) !important;
  border-color: var(--border-subtle) !important;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(255, 56, 92, 0.2) !important;
}