:root {
  --brand: #1a6b6b;
  --brand-dark: #0f4a4a;
  --bg: #f7f7f5;
  --card-bg: #ffffff;
  --text: #222;
  --muted: #6b6b6b;
  --border: #e2e2df;
  --error: #b3261e;
  --success: #1e7a34;
}

[data-theme="dark"] {
  --brand: #35a3a3;
  --brand-dark: #237a7a;
  --bg: #14181a;
  --card-bg: #1e2427;
  --text: #eaeaea;
  --muted: #9aa0a3;
  --border: #333a3d;
  --error: #ff6b6b;
  --success: #4fd67a;
}

[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] select,
[data-theme="dark"] input,
[data-theme="dark"] textarea {
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}
[data-theme="dark"] .modal-box { background: var(--card-bg); color: var(--text); }
[data-theme="dark"] .tag { background: #234040; color: #bfe6e6; }
[data-theme="dark"] .review-block { background: #23292c; }

.icon-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.icon-btn:hover { background: rgba(255,255,255,0.15); }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: var(--brand-dark);
  color: white;
}

.navbar .brand {
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
}

.nav-links a {
  color: white;
  text-decoration: none;
  margin-left: 20px;
  opacity: 0.9;
}

.nav-links a:hover { opacity: 1; text-decoration: underline; }

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

h1 { margin-top: 0; }

.muted { color: var(--muted); }
.error { color: var(--error); font-weight: 600; }
.success { color: var(--success); font-weight: 600; }

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-bar input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}

select, input, textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}

button {
  background: var(--brand);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

button:hover { background: var(--brand-dark); }
button.secondary { background: #9a9a97; }
button.secondary:hover { background: #7c7c79; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card h3 { margin: 0; }
.card button { align-self: flex-start; margin-top: 6px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  background: #e6f0f0;
  color: var(--brand-dark);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.popularity { font-size: 0.85rem; color: var(--muted); margin: 0; }

.map-view {
  width: 100%;
  height: 420px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
  z-index: 0;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.category-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
  color: white;
  white-space: nowrap;
}
.category-restaurant { background: #c0392b; }
.category-sports { background: #2980b9; }
.category-spa { background: #8e44ad; }
.category-nightlife { background: #d35400; }
.category-hotel { background: #16a085; }
.category-attraction { background: #27ae60; }
.category-entertainment { background: #f39c12; }
.category-landmark { background: #34495e; }

.identifier-toggle {
  display: flex;
  gap: 16px;
  margin: 4px 0 10px;
  font-weight: 400 !important;
}
.identifier-toggle label {
  font-weight: 400 !important;
  margin-top: 0 !important;
  display: flex;
  align-items: center;
  gap: 5px;
}

.star-picker {
  font-size: 1.8rem;
  color: #d8d8d5;
  cursor: pointer;
  letter-spacing: 4px;
  margin: 4px 0 10px;
}
.star-picker span { transition: color 0.1s; }
.star-picker span.filled { color: #f5b400; }
.stars { color: #f5b400; letter-spacing: 2px; }

.review-block {
  background: #f7f7f5;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 4px;
}

.transport-estimate { margin: 6px 0 10px; }
.transport-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 4px;
}
.transport-option {
  background: #f0f0ee;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.8rem;
}
[data-theme="dark"] .transport-option { background: #23292c; }

.locate-btn {
  position: absolute;
  z-index: 500;
  top: 10px;
  right: 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
[data-theme="dark"] .locate-btn { background: var(--card-bg); color: var(--text); }

.map-wrapper { position: relative; }

.place-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}

.nearby-section, .area-info {
  background: #f0f0ee;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 0.85rem;
}
[data-theme="dark"] .nearby-section, [data-theme="dark"] .area-info { background: #23292c; }

.timetable-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  overflow-x: auto;
}
.timetable-day {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  min-width: 140px;
}
.timetable-day-header {
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.timetable-item {
  background: #f0f0ee;
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}
[data-theme="dark"] .timetable-item { background: #23292c; }
.timetable-empty { padding: 6px 0; font-size: 0.8rem; }

@media (max-width: 900px) {
  .timetable-grid { grid-template-columns: repeat(7, 220px); }
}

.form-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
}

.form-card form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-card label { font-size: 0.9rem; margin-top: 10px; font-weight: 600; }
.form-card button { margin-top: 18px; }

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.checkbox-label {
  font-weight: 400 !important;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #f0f0ee;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.85rem !important;
  margin-top: 0 !important;
}
[data-theme="dark"] .checkbox-label { background: #23292c; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.hidden { display: none; }

.modal-box {
  background: white;
  border-radius: 10px;
  padding: 28px;
  width: 90%;
  max-width: 420px;
}

.modal-box form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-box label { font-size: 0.9rem; margin-top: 10px; font-weight: 600; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ---- Heart / favorites ---- */
.heart-btn {
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.heart-btn.filled { border-color: #e0245e; }
[data-theme="dark"] .heart-btn { background: var(--card-bg); }

.card-image-wrapper { position: relative; }
.card-image-wrapper .heart-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

/* ---- Page header row (title + action button) ---- */
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.map-link-btn {
  background: var(--brand);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}
.map-link-btn:hover { background: var(--brand-dark); }

.secondary-link-btn {
  background: #9a9a97;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
}
.secondary-link-btn:hover { background: #7c7c79; }

.tag-clickable { cursor: pointer; }
.tag-clickable:hover { background: var(--brand); color: white; }

/* ---- Dedicated map page ---- */
.map-page-layout {
  display: flex;
  gap: 16px;
  align-items: stretch;
}
.map-view-full {
  flex: 1;
  height: 620px;
  border-radius: 10px;
  border: 1px solid var(--border);
  position: relative;
}
.map-sidebar {
  width: 360px;
  flex-shrink: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  overflow-y: auto;
  max-height: 620px;
}
.map-sidebar h2 { margin: 6px 0 4px; font-size: 1.2rem; }
.map-hover-tooltip {
  position: absolute;
  z-index: 10;
  background: white;
  color: #222;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.8rem;
  max-width: 220px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  pointer-events: none;
}
[data-theme="dark"] .map-hover-tooltip { background: #2a3134; color: var(--text); }

@media (max-width: 900px) {
  .map-page-layout { flex-direction: column; }
  .map-sidebar { width: 100%; max-height: none; }
  .map-view-full { height: 400px; }
}

/* ---- Login hero banner ---- */
.hero-banner {
  max-width: 700px;
  margin: 0 auto 20px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* ---- Accessibility ---- */

/* Visible focus states on every interactive element — never remove
   the outline without replacing it with something equally visible. */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #ff9a5c;
  outline-offset: 2px;
}

/* Skip-to-content link — invisible until keyboard-focused, then jumps
   straight past the nav to the main content. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #1a6b6b;
  color: white;
  padding: 12px 20px;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

/* Respect the user's OS-level reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
