@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #F7F8F5;
  --card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-card: #FFFFFF;
  --line: #E7E9E2;
  --text: #141710;
  --text-muted: #6B7264;
  --navy: #1C2620;
  --accent: #3F6B4A;
  --gold: #C68A3D;
  --sapphire: #4A7FB5;
  --radius: 20px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(63, 107, 74, 0.2); }

.display { font-family: 'Space Grotesk', sans-serif; }

.app-shell {
  max-width: 980px;
  margin: 0 auto;
}

header.hero {
  padding: 28px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

header.hero .logo-mark {
  height: 40px;
  width: auto;
  flex-shrink: 0;
}

.wordmark { display: flex; flex-direction: column; }

.wordmark .name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--navy);
}

.tagline { color: var(--text-muted); font-size: 13px; margin-top: 3px; }

.search-wrap {
  padding: 4px 20px 18px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 20px;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(20,23,16,0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(63, 107, 74, 0.1);
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
}

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

.results {
  padding: 4px 14px 100px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  align-items: start;
}

.trip-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(20,23,16,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: rise 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.trip-card:active { transform: scale(0.98); }
.trip-card:hover { box-shadow: 0 8px 20px rgba(20,23,16,0.1); }

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

.trip-photo-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #e2e5da;
}

.trip-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.35s ease;
}

.trip-photo-wrap .fallback-glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  opacity: 0.25;
}

/* Date badge replaces a "price" badge — we don't store trip prices. */
.date-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255,255,255,0.95);
  color: var(--navy);
  font-size: 10.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corner-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 2;
}

.corner-badge.premium { background: linear-gradient(135deg, #f2cd8e, var(--gold)); }
.corner-badge.verified { background: var(--sapphire); }
.corner-badge svg { width: 12px; height: 12px; }

.trip-card.tier-premium { border-color: rgba(198, 138, 61, 0.4); }

.trip-body { padding: 12px 14px 14px; }

.trip-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}

.trip-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
  line-height: 1.25;
}

.trip-seats {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.trip-company {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  min-width: 0;
}

.trip-company .company-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 7px 0;
  font-size: 11px;
  color: var(--text-muted);
}

.trip-meta span { display: flex; align-items: center; gap: 3px; }

.trip-desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: #4a5045;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-btn {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.book-btn:hover { background: #263329; }
.book-btn:active { transform: scale(0.97); }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 70px 20px;
  color: var(--text-muted);
  animation: fadeIn 0.3s ease both;
}

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

.empty-state .glyph { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }

.skeleton {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  height: 260px;
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(20,23,16,0.04), transparent);
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* Admin dashboard */
.admin-header {
  padding: 26px 20px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-header .logo-mark { height: 36px; }

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px 20px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(20,23,16,0.05);
  transition: transform 0.2s ease;
  animation: rise 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 25px;
  font-weight: 700;
  color: var(--gold);
}

.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.section-title {
  padding: 22px 20px 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80vh;
  text-align: center;
  color: var(--text-muted);
  padding: 0 30px;
}

/* Trip detail overlay */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
  display: none;
}

.detail-overlay.open { display: block; }

.detail-close {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  padding: 14px 16px 0;
  background: linear-gradient(180deg, var(--bg) 60%, transparent);
}

.detail-close button {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 18px;
  cursor: pointer;
  color: var(--text);
}

.detail-gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 16px 10px;
  scrollbar-width: none;
}
.detail-gallery::-webkit-scrollbar { display: none; }

.detail-gallery img, .detail-gallery video {
  width: 280px;
  height: 350px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
  background: var(--card);
}

.detail-body { padding: 8px 20px 120px; }

.detail-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.detail-country { color: var(--text-muted); font-size: 14px; margin-top: 2px; }

.detail-company {
  display: flex; align-items: center; gap: 6px;
  margin-top: 14px; font-size: 14px; color: var(--text-muted);
}

.detail-meta {
  display: flex; gap: 16px; margin: 14px 0;
  font-size: 14px; color: var(--text-muted);
}
.detail-meta span { display: flex; align-items: center; gap: 5px; }

.detail-desc {
  font-size: 15px; line-height: 1.6; color: #4a5045; white-space: pre-wrap;
  margin-top: 8px;
}

.detail-book-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 14px 20px 26px;
  z-index: 5;
}
