/* ═══════════════════════════════════════════════════════════════════════════
   Hotel Price Intelligence — Application Styles
   ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
  --blue:      #1a56db;
  --blue-dark: #1245b0;
  --blue-light:#eff6ff;
  --green:     #059669;
  --red:       #dc2626;
  --amber:     #d97706;
  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-200:  #e5e7eb;
  --gray-400:  #9ca3af;
  --gray-600:  #4b5563;
  --gray-900:  #111827;
  --radius:    8px;
  --shadow:    0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--gray-50); color: var(--gray-900); line-height: 1.5; min-height: 100vh; }

/* ── Typography ───────────────────────────────────────────────────────────── */
h1, h2, h3 { line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; font-weight: 600; }
em { font-style: normal; color: var(--blue); }
.text-muted { color: var(--gray-400); font-size: .875rem; }
.text-warning { color: var(--amber); }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ── Navigation ───────────────────────────────────────────────────────────── */
.nav { background: #fff; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 50; }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 56px; }
.nav-brand { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--gray-900); display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; align-items: center; gap: 20px; font-size: .9rem; }
.nav-links a { text-decoration: none; color: var(--gray-600); }
.nav-links a:hover { color: var(--blue); }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero { background: linear-gradient(135deg, #eff6ff 0%, #fff 60%); border-bottom: 1px solid var(--gray-200); padding: 56px 0 40px; }
.hero-sub { color: var(--gray-600); max-width: 560px; margin: 12px 0 32px; font-size: 1.05rem; }

/* ── Search Form ──────────────────────────────────────────────────────────── */
.search-form { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 24px; box-shadow: var(--shadow-md); }
.search-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 0.6fr 0.6fr 0.6fr; gap: 12px; margin-bottom: 16px; }
@media (max-width: 768px) { .search-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .search-grid { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: .8rem; font-weight: 600; color: var(--gray-600); text-transform: uppercase; letter-spacing: .05em; }
.form-group input,
.form-group select { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 10px 12px; font-size: .95rem; background: #fff; color: var(--gray-900); }
.form-group input:focus, .form-group select:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: transparent; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: var(--radius); font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { background: transparent; border-color: var(--gray-200); color: var(--gray-600); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-ghost { background: transparent; color: var(--gray-600); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); }
.btn-lg { padding: 13px 32px; font-size: 1rem; border-radius: 10px; }
.btn-sm { padding: 6px 14px; font-size: .85rem; }

/* ── Results ──────────────────────────────────────────────────────────────── */
.results-section { padding: 32px 0 64px; }
.results-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.results-grid { display: flex; flex-direction: column; gap: 16px; }

/* ── Hotel Card ───────────────────────────────────────────────────────────── */
.hotel-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; display: grid; grid-template-columns: 200px 1fr; }
@media (max-width: 600px) { .hotel-card { grid-template-columns: 1fr; } }

.hotel-img-wrap { position: relative; }
.hotel-img { width: 100%; height: 100%; object-fit: cover; min-height: 160px; display: block; }
.hotel-stars { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.55); color: #fbbf24; padding: 2px 8px; border-radius: 20px; font-size: .8rem; }

.hotel-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.hotel-name { font-size: 1.1rem; font-weight: 700; }
.hotel-location { font-size: .85rem; }

/* ── Rate Comparison ─────────────────────────────────────────────────────── */
.rate-comparison { display: flex; flex-direction: column; gap: 8px; }
.rate-row { display: grid; grid-template-columns: 140px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: var(--gray-50); }
@media (max-width: 500px) { .rate-row { grid-template-columns: 1fr auto; } }
.rate-row.is-cheapest { background: var(--blue-light); border: 1px solid #bfdbfe; }

.rate-provider { font-size: .85rem; font-weight: 600; color: var(--gray-600); }
.rate-total { font-size: 1.1rem; font-weight: 700; color: var(--gray-900); }
.rate-details-sm { font-size: .78rem; display: block; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-green { background: #d1fae5; color: var(--green); }
.badge-red { background: #fee2e2; color: var(--red); }
.badge-blue { background: #dbeafe; color: var(--blue); }
.badge-yellow { background: #fef3c7; color: var(--amber); }
.badge-info { background: var(--blue-light); color: var(--blue); }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: .9rem; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Loading / Spinner ────────────────────────────────────────────────────── */
.loading-wrap, .error-wrap { text-align: center; padding: 64px 16px; color: var(--gray-400); }
.spinner { width: 40px; height: 40px; border: 3px solid var(--gray-200); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-error { color: var(--red); font-size: .85rem; margin-top: 4px; }
.form-success { color: var(--green); font-size: .85rem; margin-top: 4px; }

/* ── Hotel Actions ────────────────────────────────────────────────────────── */
.hotel-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--gray-200); padding: 24px 0; font-size: .85rem; color: var(--gray-400); text-align: center; }

/* ── Login / Signup ───────────────────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 40px 32px; width: 100%; max-width: 400px; box-shadow: var(--shadow-md); }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 24px; }
.auth-card .form-group { margin-bottom: 16px; }
.auth-card input { width: 100%; padding: 11px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: .95rem; }
.auth-card .btn { width: 100%; margin-top: 8px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: .9rem; color: var(--gray-600); }
.auth-switch a { color: var(--blue); text-decoration: none; }

/* ── Admin ────────────────────────────────────────────────────────────────── */
.admin-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--gray-200); margin-bottom: 24px; }
.admin-tab { background: none; border: none; padding: 12px 20px; font-size: .9rem; font-weight: 600; cursor: pointer; color: var(--gray-600); border-bottom: 2px solid transparent; }
.admin-tab:hover { color: var(--blue); }
.admin-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.admin-stat { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px; }
.admin-stat-val { font-size: 2rem; font-weight: 700; }
.admin-stat-label { color: var(--gray-400); font-size: .85rem; margin-top: 4px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }

/* ── Data table ───────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th { text-align: left; padding: 10px 12px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-400); border-bottom: 1px solid var(--gray-200); }
.data-table td { padding: 12px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.data-table tr:hover td { background: var(--gray-50); }
.table-wrap { overflow-x: auto; }

/* ── Deal Intelligence ────────────────────────────────────────────────────── */
.hotel-deals {
  border-top: 1px solid var(--border);
  padding: 12px 0 4px;
  margin-top: 12px;
}
.deals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.deals-title { font-weight: 600; font-size: 0.9rem; }
.deals-section-title { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin: 10px 0 6px; }
.deals-loading { color: var(--text-muted); font-size: 0.85rem; padding: 8px 0; }
.promo-code-card {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--primary);
}
.promo-code-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.promo-code { font-size: 1rem; font-weight: 700; letter-spacing: 0.05em; background: var(--surface-3); padding: 2px 8px; border-radius: 4px; }
.promo-desc, .promo-expiry { font-size: 0.8rem; margin: 2px 0; }
.link-sm { font-size: 0.8rem; color: var(--primary); }
.deal-obs-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
  transition: background 0.15s;
}
.deal-obs-card:hover { background: var(--surface-2); }
.deal-obs-meta { font-size: 0.75rem; margin-bottom: 2px; text-transform: capitalize; }
.deal-obs-title { font-size: 0.85rem; font-weight: 500; }
.btn-xs { padding: 2px 8px; font-size: 0.75rem; }
