/* ═══════════════════════════════════════════════════════════════
   Wait4Destination — Global Design System
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Brand Colors */
  --brand-primary:      #0284c7; /* Improved contrast Sky 600 */
  --brand-primary-dark: #0369a1; /* Sky 700 */
  --brand-secondary:    #f59e0b;
  --brand-accent:       #f43f5e;
  --brand-gradient:     linear-gradient(135deg, #0284c7, #0369a1);
  --brand-warm:         linear-gradient(135deg, #f59e0b, #d97706);

  /* Neutrals (Slate/Gray Palette) */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b; /* Improved Contrast - WCAG compliant */
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Semantic Colors */
  --success:  #10b981;
  --warning:  #f59e0b;
  --danger:   #f43f5e;
  --info:     #3b82f6;

  /* Typography */
  --font-sans:   'Inter', system-ui, -apple-system, sans-serif;
  --font-serif:  'Playfair Display', Georgia, serif;
  --text-xs:     0.75rem;
  --text-sm:     0.875rem;
  --text-base:   1rem;
  --text-lg:     1.125rem;
  --text-xl:     1.25rem;
  --text-2xl:    1.5rem;
  --text-3xl:    1.875rem;
  --text-4xl:    2.25rem;

  /* Spacing */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem;    --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem;    --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem;   --space-20: 5rem;

  /* Border Radius */
  --radius-sm:  6px;
  --radius-md:  8px; /* Aligned with input fields */
  --radius-lg:  12px; /* Smoother corner transition */
  --radius-xl:  20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(15,23,42,0.05);
  --shadow-md:  0 4px 12px rgba(15,23,42,0.06), 0 2px 4px rgba(15,23,42,0.02);
  --shadow-lg:  0 12px 32px rgba(15,23,42,0.08), 0 4px 12px rgba(15,23,42,0.03);
  --shadow-xl:  0 24px 48px rgba(15,23,42,0.12), 0 8px 20px rgba(15,23,42,0.05);
  --shadow-card: 0 1px 3px rgba(15,23,42,0.04), 0 0 0 1px rgba(15,23,42,0.02);

  /* Transitions */
  --transition:     all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);

  /* Micro-Interactions System Tokens */
  --ease-spring:            cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:               cubic-bezier(0, 0, 0.2, 1);
  --duration-fast:          150ms;
  --duration-normal:        200ms;
  --duration-slow:          250ms;
  --duration-shimmer:       1500ms;

  /* Enhanced Hover Shadow Tokens */
  --shadow-button-hover:    0 4px 15px rgba(2, 132, 199, 0.35);
  --shadow-card-hover:      0 12px 28px rgba(15, 23, 42, 0.12), 0 4px 10px rgba(15, 23, 42, 0.04);
  --shadow-featured-hover:  0 16px 36px rgba(2, 132, 199, 0.25), 0 6px 14px rgba(15, 23, 42, 0.08);

  /* Skeleton Loader Color Tokens */
  --skeleton-base:          var(--gray-200);
  --skeleton-shimmer:       var(--gray-100);

  /* Phase 3 Design System Consistency Tokens */
  --color-primary:       var(--brand-primary);
  --color-primary-hover: var(--brand-primary-dark);
  --shadow-focus:        0 0 0 3px rgba(2, 132, 199, 0.15);
  --border-subtle:       1px solid var(--gray-200);
  --radius-interactive:  var(--radius-md);
  --shadow-overlay:      var(--shadow-lg);
}

/* ── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* Premium Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--gray-50);
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--gray-800);
  background-color: #fff;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--brand-primary-dark); }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* Skip Links for Keyboard Accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  background: var(--brand-primary-dark);
  color: #fff !important;
  font-weight: 700;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg);
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid var(--brand-secondary);
  outline-offset: 2px;
}

/* Screen Reader Only Utilities */
.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Global Focus Outline Indicators */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--brand-primary);
  outline-offset: 2px;
}

/* ── Container ─────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}
@media (max-width: 768px) { .container { padding: 0 var(--space-4); } }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  border: 2px solid transparent;
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-fast) var(--ease-out),
              background-color var(--duration-fast) ease,
              border-color var(--duration-fast) ease,
              color var(--duration-fast) ease;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1.4;
  will-change: transform;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0.5px); }

.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(3,105,161,0.3);
}
.btn-primary:hover:not(:disabled) { box-shadow: var(--shadow-button-hover); color: #fff; }

.btn-secondary {
  background: var(--brand-warm);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(245,158,11,0.3);
}
.btn-secondary:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(245,158,11,0.4); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease, border-color var(--duration-fast) ease, transform var(--duration-fast) var(--ease-spring);
}
.btn-outline:hover:not(:disabled) { background: var(--brand-primary); color: #fff; }

.btn-outline-primary { background: transparent; color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-outline-primary:hover:not(:disabled) { background: var(--brand-primary); color: #fff; }

.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.6); }
.btn-outline-light:hover:not(:disabled) { background: rgba(255,255,255,0.15); color: #fff; }

.btn-white { background: #fff; color: var(--brand-primary); border-color: #fff; }
.btn-white:hover:not(:disabled) { background: var(--gray-50); color: var(--brand-primary-dark); }

.btn-ghost { background: transparent; color: var(--gray-600); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); color: var(--gray-800); }

.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:hover:not(:disabled) { background: #dc2626; color: #fff; }

.btn-success { background: var(--success); color: #fff; border-color: transparent; }
.btn-success:hover:not(:disabled) { background: #059669; color: #fff; }

.btn-sm { padding: 0.375rem 0.875rem; font-size: var(--text-xs); border-radius: var(--radius-sm); min-height: 32px; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: var(--text-base); border-radius: var(--radius-lg); min-height: 48px; }
.btn:disabled, .btn.disabled { opacity: 0.5; pointer-events: none; cursor: not-allowed; transform: none !important; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255,255,255,0.3); border-top-color: #fff; }

/* Keyboard Focus styles for buttons */
.btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

/* ── Forms ─────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: var(--space-5); }
.form-label { font-size: var(--text-sm); font-weight: 600; color: var(--gray-700); display: flex; align-items: center; gap: 0.25rem; }
.form-label .req { color: var(--danger); font-weight: 700; }
.form-label span { color: var(--danger); }
.form-label small, .form-label .form-hint { font-weight: 400; color: var(--gray-500); font-size: var(--text-xs); }
select,
.form-control,
.form-select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--gray-800);
  background-color: #fff;
  transition: border-color var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
  line-height: 1.5;
  min-height: 42px;
}
.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-focus);
}
.form-control::placeholder { color: var(--gray-400); font-weight: 400; }
.form-control.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(244,63,94,0.08); }
.form-control:disabled,
.form-control:read-only { opacity: 0.6; cursor: not-allowed; background: var(--gray-50); transition: none; pointer-events: none; }

/* File input styling fix for .form-control */
.form-control[type="file"],
input[type="file"].form-control {
  padding: 0.45rem 0.75rem !important;
  height: auto !important;
  min-height: 42px !important;
  cursor: pointer !important;
  background-color: var(--gray-50, #f8fafc) !important;
  border: 1.5px solid var(--gray-200, #e2e8f0) !important;
}

.form-control[type="file"]::file-selector-button,
input[type="file"].form-control::file-selector-button {
  padding: 0.35rem 0.85rem !important;
  margin: -0.45rem -0.75rem !important;
  margin-inline-end: 0.75rem !important;
  color: #ffffff !important;
  background-color: var(--brand-primary, #0284c7) !important;
  border: none !important;
  border-radius: var(--radius-md, 6px) 0 0 var(--radius-md, 6px) !important;
  font-weight: 600 !important;
  font-size: var(--text-sm, 0.875rem) !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  transition: background-color 0.2s ease !important;
}

.form-control[type="file"]::file-selector-button:hover,
input[type="file"].form-control::file-selector-button:hover {
  background-color: #0369a1 !important;
}
select,
select.form-control,
select.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 1.1rem;
  padding-right: 2.5rem;
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative;
  z-index: 2;
}

textarea.form-control { min-height: 100px; resize: vertical; }
.field-error { font-size: var(--text-xs); color: var(--danger); margin-top: 0.15rem; font-weight: 500; }
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.input-group-text {
  display: flex; align-items: center; padding: 0 0.75rem;
  background: var(--gray-50); border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  font-size: var(--text-sm); color: var(--gray-500); white-space: nowrap;
  font-weight: 600;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--duration-slow) var(--ease-spring), box-shadow var(--duration-normal) var(--ease-out);
  will-change: transform;
  position: relative;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }
.card.featured:hover,
.card-featured:hover { transform: translateY(-6px); box-shadow: var(--shadow-featured-hover); }
.card a,
.card .btn { position: relative; z-index: 2; }
.card:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; transform: translateY(-2px); }
.card-body { padding: var(--space-6); }
.card-header { padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--gray-100); font-weight: 600; }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.badge-primary   { background: #dbeafe; color: #1d4ed8; }
.badge-success   { background: #d1fae5; color: #065f46; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-gray      { background: var(--gray-100); color: var(--gray-600); }
.badge-featured  { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  position: relative;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.alert-danger   { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning  { background: #fef3c7; color: #92400e; border-left: 4px solid var(--warning); }
.alert-info     { background: #dbeafe; color: #1e40af; border-left: 4px solid var(--info); }
.alert i, .alert .fa, .alert .fas { flex-shrink: 0; line-height: 1; }
.alert-close {
  position: absolute; right: var(--space-4); top: 50%;
  transform: translateY(-50%); background: none; border: none;
  font-size: 1.2rem; opacity: 0.5; cursor: pointer; padding: 0;
  line-height: 1; color: inherit;
}
.alert-close:hover { opacity: 1; }
.alert-dismissible { padding-right: var(--space-10); }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th {
  padding: var(--space-3) var(--space-4);
  background: var(--gray-50);
  font-weight: 700;
  color: var(--gray-600);
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid var(--gray-200);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 5;
}
.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
  transition: background 0.15s ease;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--gray-50); }
.table .actions-cell { display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }

/* ── Star Rating ────────────────────────────────────────────────────────── */
.stars { color: #f59e0b; letter-spacing: 2px; font-size: 1rem; }
.stars-empty { color: var(--gray-300); letter-spacing: 2px; font-size: 1rem; }
.star-rating-interactive .star { cursor: pointer; transition: color 0.15s ease, transform 0.15s ease; }
.star-rating-interactive .star:hover { transform: scale(1.15); }

/* ── Pagination ─────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: 0.25rem; list-style: none; flex-wrap: wrap; }
.page-item .page-link {
  display: flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 0.5rem;
  border-radius: var(--radius-sm); border: 1px solid var(--gray-200);
  font-size: var(--text-sm); font-weight: 500;
  color: var(--gray-600); background: #fff;
  transition: var(--transition);
}
.page-item .page-link:hover { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.page-item.active .page-link { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.page-item.disabled .page-link { opacity: 0.4; pointer-events: none; }

/* ── Utils ──────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-gradient { background: var(--brand-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.d-flex      { display: flex; }
.d-inline    { display: inline; }
.gap-2       { gap: 0.5rem; }
.gap-3       { gap: 0.75rem; }
.gap-4       { gap: 1rem; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }   .mt-5 { margin-top: 1.5rem; } .mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; } .mb-5 { margin-bottom: 1.5rem; } .me-2 { margin-right: 0.5rem; }
.ms-3 { margin-left: 0.75rem; } .mx-4 { margin-left: 1rem; margin-right: 1rem; }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.text-muted   { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--brand-primary); }
.w-100 { width: 100%; }

/* ── Loading Spinner ────────────────────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Preview Banner ─────────────────────────────────────────────────────── */
.preview-banner {
  position: sticky; top: 0; z-index: 999;
  background: linear-gradient(135deg, #1e40af, #7c3aed);
  color: #fff; padding: 0.5rem 1.5rem;
  text-align: center; font-size: var(--text-sm);
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
}

/* ── Sections ───────────────────────────────────────────────────────────── */
.section { padding: var(--space-12) 0; }
.section-light { background: var(--gray-50); }
.section-dark  { background: linear-gradient(135deg, #0f172a, #1e3a5f); }

.section-header { text-align: center; margin-bottom: var(--space-12); }
.section-badge {
  display: inline-block;
  background: #dbeafe; color: var(--brand-primary);
  padding: 0.35rem 1rem; border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 0.75rem;
}
.section-title { font-family: var(--font-serif); font-size: clamp(1.8rem, 4vw, 2.75rem); font-weight: 800; color: var(--gray-900); margin-bottom: 0.75rem; line-height: 1.2; }
.section-subtitle { color: var(--gray-500); font-size: var(--text-lg); max-width: 550px; margin: 0 auto; }

/* ── CTA Section ────────────────────────────────────────────────────────────── */
.cta-section {
  background: linear-gradient(135deg, #0369a1, #0c4a6e);
  padding: var(--space-20) 0;
  text-align: center;
}
.cta-content { max-width: 700px; margin: 0 auto; }
.cta-content h2 { font-family: var(--font-serif); font-size: clamp(1.8rem, 3.5vw, 2.5rem); color: #fff; font-weight: 800; margin-bottom: 1rem; }
.cta-content p { color: rgba(255,255,255,0.85); font-size: var(--text-lg); margin-bottom: 2rem; }
.cta-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Additional utilities for hybrid Bootstrap/custom layout ──────────────── */
.h-100 { height: 100%; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.p-0  { padding: 0 !important; }
.ms-1 { margin-left: 0.25rem; }
.ms-2 { margin-left: 0.5rem; }
.ms-auto { margin-left: auto; }
.me-1 { margin-right: 0.25rem; }
.me-3 { margin-right: 0.75rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.d-block { display: block; }
.d-none  { display: none; }
.d-grid  { display: grid; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-start  { text-align: left; }
.text-end    { text-align: right; }
.text-break  { word-break: break-word; }
.fw-bold     { font-weight: 700; }
.fw-normal   { font-weight: 400; }
.small       { font-size: var(--text-sm); }
.lh-sm       { line-height: 1.4; }
.opacity-75  { opacity: 0.75; }
.opacity-50  { opacity: 0.5; }
.border-0    { border: 0 !important; }
.rounded     { border-radius: var(--radius-md) !important; }
.rounded-pill { border-radius: var(--radius-full) !important; }
.overflow-hidden { overflow: hidden; }
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.text-white  { color: #fff !important; }
.bg-white    { background-color: #fff !important; }
.w-auto      { width: auto; }
.mw-100      { max-width: 100%; }
.shadow      { box-shadow: var(--shadow-md) !important; }
.shadow-sm   { box-shadow: var(--shadow-sm) !important; }
.shadow-lg   { box-shadow: var(--shadow-lg) !important; }
.cursor-pointer { cursor: pointer; }
.user-select-none { user-select: none; }

/* ── Horizontal Rules ──────────────────────────────────────────────────── */
hr {
  border: none;
  height: 1px;
  background: var(--gray-200);
  margin: var(--space-6) 0;
}

/* ── Avatar / Initials ─────────────────────────────────────────────────── */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--text-sm);
  color: #fff; background: var(--brand-gradient);
  flex-shrink: 0; line-height: 1;
}
.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-xl); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ── Tooltip Base ──────────────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900); color: #fff;
  font-size: 0.7rem; font-weight: 500; white-space: nowrap;
  padding: 0.35rem 0.6rem; border-radius: var(--radius-sm);
  pointer-events: none; opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 100;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Empty State ───────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem 1.5rem;
  color: var(--gray-400);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state-title { font-size: var(--text-lg); font-weight: 700; color: var(--gray-700); margin-bottom: 0.5rem; }
.empty-state-text { font-size: var(--text-sm); color: var(--gray-500); max-width: 400px; margin: 0 auto 1.5rem; }

/* ── Breadcrumb ────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex; gap: 0.4rem; align-items: center;
  font-size: var(--text-xs); list-style: none; padding: 0; margin: 0;
}
.breadcrumb li { display: flex; align-items: center; gap: 0.4rem; }
.breadcrumb li + li::before { content: '/'; color: var(--gray-400); }
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--brand-primary); }
.breadcrumb .current { color: var(--gray-700); font-weight: 600; }

/* ── Scroll to Top Button ──────────────────────────────────────────────── */
.scroll-top-btn {
  position: fixed; bottom: 2rem; right: 2rem;
  width: 44px; height: 44px;
  border-radius: 50%; background: var(--brand-primary);
  color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 990;
}
.scroll-top-btn.visible {
  opacity: 1; pointer-events: auto;
  transform: translateY(0);
}
.scroll-top-btn:hover {
  background: var(--brand-primary-dark);
  transform: translateY(-2px);
}

/* ── Line Clamp Utility ────────────────────────────────────────────────── */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; line-clamp: 1; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-clamp: 2; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; line-clamp: 3; overflow: hidden; }

/* ── Max Width Readability ─────────────────────────────────────────────── */
.prose { max-width: 65ch; }

/* ── Text Utility Classes ──────────────────────────────────────────────── */
.text-muted-sm   { font-size: 0.8rem; color: var(--gray-500); }
.text-muted-xs   { font-size: 0.75rem; color: var(--gray-400); }
.text-muted-md   { font-size: 0.85rem; color: var(--gray-600); }
.text-heading    { font-weight: 700; color: var(--gray-900); }
.text-heading-sm { font-size: 0.95rem; font-weight: 700; color: var(--gray-900); line-height: 1.4; }
.text-caption    { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.2rem; }
.text-footnote   { font-size: 0.7rem; opacity: 0.75; margin-top: 0.25rem; }
.text-disclaimer { font-size: 0.72rem; color: var(--gray-400); text-align: center; margin-top: 0.5rem; }
.text-label      { font-size: 0.75rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; }
.text-price      { font-weight: 700; color: var(--gray-900); font-size: 0.95rem; }
.text-meta       { font-size: 0.9rem; color: #475569; }

/* ── Layout Utility Classes ────────────────────────────────────────────── */
.flex-center     { display: flex; align-items: center; justify-content: center; }
.flex-col        { display: flex; flex-direction: column; }
.gap-05          { gap: 0.5rem; }
.gap-1           { gap: 1rem; }
.m-0             { margin: 0; }
.prose-wide { max-width: 80ch; }


/* ══════════════════════════════════════════════════════════════════
   PACKAGE CREATION WITH LIVE PREVIEW (Task 16)
   ══════════════════════════════════════════════════════════════════ */

/* Auto-Save Status Indicator (sticky at top) */
#autoSaveStatus {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#autoSaveStatus.saving {
    background: #eff6ff;
    color: #1e40af;
}

#autoSaveStatus.saved {
    background: #f0fdf4;
    color: #16a34a;
}

#autoSaveStatus.error {
    background: #fef2f2;
    color: #dc2626;
}

/* Main Layout: Side-by-side form and preview */
.package-creation-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 100%;
    margin: 0 auto;
}

/* Desktop: Side-by-side layout (>= 1280px) */
@media (min-width: 1280px) {
    .package-creation-layout {
        grid-template-columns: 1fr 50px;
        max-width: 1800px;
    }
}

/* Form Container */
.package-form-container {
    min-width: 0; /* Prevent grid overflow */
}

/* Header Actions */
.card-header .header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mobile Preview Button (hidden on desktop) */
.mobile-preview-btn {
    display: inline-flex;
}

@media (min-width: 1280px) {
    .mobile-preview-btn {
        display: none;
    }
}

/* Preview Pane Container */
.preview-pane-container {
    display: none; /* Hidden on mobile */
}

@media (min-width: 1280px) {
    .preview-pane-container {
        display: block;
    }
}

/* Sticky Preview Pane */
.preview-pane-sticky {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Preview Pane Header */
.preview-pane-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
}

.preview-pane-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
}

.preview-pane-header small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
}

/* Preview Pane Content */
.preview-pane-content {
    padding: 0;
    background: #f8fafc;
    overflow: hidden;
}

/* Preview Placeholder */
.preview-placeholder {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #6b7280;
}

/* Mobile Preview Modal */
@media (min-width: 992px) {
    #mobilePreviewModal {
        display: none !important;
    }
}

/* Universal Modal Elevation & Backdrop Stacking Fix */
.modal {
    z-index: 1060 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

.modal-content {
    background-color: var(--bg-card, #ffffff) !important;
    position: relative;
    z-index: 1065 !important;
}

#mobilePreviewModal {
    z-index: 1060 !important;
}

#mobilePreviewModal .modal-dialog {
    margin: 0;
    max-width: 100%;
}

#mobilePreviewModal .modal-content {
    background-color: #ffffff !important;
    border-radius: 0;
    min-height: 100vh;
    border: none;
    position: relative;
    z-index: 1065;
}

#mobilePreviewModal .modal-header {
    position: sticky;
    top: 0;
    z-index: 1070 !important;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
}

#mobilePreviewModal .modal-header button,
#mobilePreviewModal [data-bs-dismiss="modal"] {
    position: relative;
    z-index: 1080 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

#mobilePreviewModal .modal-body {
    padding: 0;
    background: #f8fafc;
    overflow-x: hidden;
}

/* Preview Content Styling (matching public detail page) */
.preview-pane-content .detail-hero {
    margin: 0;
    border-radius: 12px 12px 0 0;
    width: 100%;
}

#mobilePreviewContent .detail-hero {
    margin: 0;
    border-radius: 0;
    width: 100%;
}

/* Tabs in Preview */
.preview-pane-content .tab-btn,
#mobilePreviewContent .tab-btn {
    cursor: pointer;
    transition: all 0.2s;
}

.preview-pane-content .tab-btn:hover,
#mobilePreviewContent .tab-btn:hover {
    color: #3b82f6 !important;
}

/* Responsive adjustments for preview inside small container */
.preview-pane-content .detail-layout {
    display: block !important;
    padding: 1.25rem !important;
}

#mobilePreviewContent .detail-layout {
    display: block !important;
    padding: 1.25rem 1rem !important;
}

.preview-pane-content .detail-left,
#mobilePreviewContent .detail-left {
    width: 100%;
}

.preview-pane-content .detail-right,
#mobilePreviewContent .detail-right {
    display: none; /* Hide enquiry card in preview */
}

/* Smaller text in preview */
.preview-pane-content,
#mobilePreviewContent {
    font-size: 0.9rem;
    color: #334155;
}

.preview-pane-content .detail-title,
#mobilePreviewContent .detail-title {
    font-size: 1.5rem !important;
    word-break: break-word;
}

.preview-pane-content .detail-meta-bar,
#mobilePreviewContent .detail-meta-bar {
    font-size: 0.8rem !important;
}

/* ── Skeleton Loaders ─────────────────────────────────────────────────── */
.skeleton-base,
.skeleton-loader {
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shimmer) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  animation: shimmer var(--duration-shimmer) linear infinite;
  border-radius: var(--radius-md);
  display: block;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
  width: 100%;
}
.skeleton-title {
  height: 1.75rem;
  width: 70%;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-md);
}
.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}
.skeleton-card {
  height: 320px;
  border-radius: var(--radius-lg);
  width: 100%;
}
.skeleton-image {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: var(--radius-md);
}
.skeleton-button {
  height: 42px;
  width: 120px;
  border-radius: var(--radius-md);
}

/* ── Touch Device Overrides ───────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .card:hover,
  .card.featured:hover,
  .card-featured:hover {
    transform: none !important;
    box-shadow: var(--shadow-card);
  }
}

/* ── Reduced Motion Accessibility Overrides ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .btn, .btn:hover, .btn:active,
  .card, .card:hover, .card.featured:hover, .card-featured:hover {
    transform: none !important;
    will-change: auto !important;
  }
  .skeleton-base, .skeleton-loader {
    animation: pulse 1.5s ease-in-out infinite !important;
  }
  .form-control, .form-select {
    transition: none !important;
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
