* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.guide-app {
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Header ---------- */

.guide-header {
  position: relative;
  text-align: center;
  padding: 8px 0 4px;
}

.back-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 10px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, background 0.1s ease;
}

.back-btn:hover { background: #0f3460; }
.back-btn:active { transform: translateY(-50%) scale(0.96); }
.back-btn:focus-visible { outline: 2px solid #e94560; outline-offset: 2px; }

.guide-title { font-size: 1.5rem; }
.guide-subtitle { color: #999; font-size: 0.95rem; margin-top: 2px; }

/* ---------- Toggle tabs ---------- */

.guide-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 6px;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 14px;
}

.guide-tab {
  padding: 14px 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ccc;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, background 0.2s ease, color 0.2s ease;
}

.guide-tab:hover { background: #0f3460; color: #fff; }
.guide-tab:active { transform: scale(0.97); }
.guide-tab:focus-visible { outline: 2px solid #e94560; outline-offset: 2px; }

.guide-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #e94560 0%, #ff5570 100%);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(233, 69, 96, 0.35);
}

/* ---------- Content ---------- */

.guide-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.guide-content.fade {
  animation: guide-fade 0.35s ease;
}

@keyframes guide-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.guide-category {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffd166;
  padding-bottom: 6px;
  border-bottom: 1px solid #0f3460;
}

.venue-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.venue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.venue-card:hover {
  border-color: #e94560;
  background: #1b2a4a;
  transform: translateY(-1px);
}

.venue-card:focus-visible {
  outline: 2px solid #ffd166;
  outline-offset: 2px;
}

.venue-info { min-width: 0; }

.venue-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  word-break: break-word;
}

.venue-icon {
  margin-right: 6px;
}

.venue-note {
  margin-top: 3px;
  font-size: 0.85rem;
  color: #aab;
}

.venue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.venue-rating,
.venue-price {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}

.venue-rating {
  color: #ffd166;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.25);
}

.venue-price {
  color: #a7e8c0;
  background: rgba(110, 231, 183, 0.10);
  border: 1px solid rgba(110, 231, 183, 0.25);
}

.venue-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 13px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #e94560 0%, #ff5570 100%);
  border-radius: 10px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, box-shadow 0.12s ease;
}

.venue-link:hover { box-shadow: 0 4px 14px rgba(233, 69, 96, 0.4); }
.venue-link:active { transform: scale(0.95); }
.venue-link:focus-visible { outline: 2px solid #ffd166; outline-offset: 2px; }

/* ---------- Photo Modal ---------- */

body.modal-open { overflow: hidden; }

.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modal-fade-in 0.2s ease;
}

.photo-modal[hidden] { display: none; }

.photo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 20, 0.82);
  backdrop-filter: blur(3px);
}

.photo-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: modal-pop 0.22s ease;
}

.photo-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  padding: 16px 56px 12px 18px;
  background: linear-gradient(135deg, #e94560 0%, #ff5570 100%);
}

.photo-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, background 0.12s ease;
}

.photo-modal-close:hover { background: rgba(0, 0, 0, 0.45); }
.photo-modal-close:active { transform: scale(0.9); }
.photo-modal-close:focus-visible { outline: 2px solid #ffd166; outline-offset: 2px; }

.photo-stage {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.photo-frame {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  background: #0f1a30;
  border-radius: 12px;
  overflow: hidden;
}

.photo-image {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  animation: modal-fade-in 0.25s ease;
}

.photo-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #aab;
  font-size: 0.9rem;
}

/* Ensure `hidden` attribute always wins over the display rules above,
   otherwise "Loading Photos…" (and the image) stay visible after load. */
.photo-image[hidden],
.photo-loading[hidden],
.photo-empty[hidden] {
  display: none;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #e94560;
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate { to { transform: rotate(360deg); } }

.photo-empty {
  color: #aab;
  font-size: 0.95rem;
  padding: 20px;
  text-align: center;
}

.photo-nav {
  flex-shrink: 0;
  width: 40px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  line-height: 1;
  color: #fff;
  background: rgba(233, 69, 96, 0.2);
  border: 1px solid rgba(233, 69, 96, 0.35);
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, transform 0.1s ease;
}

.photo-nav:hover { background: rgba(233, 69, 96, 0.4); }
.photo-nav:active { transform: scale(0.92); }
.photo-nav:disabled { opacity: 0.3; cursor: default; }
.photo-nav:focus-visible { outline: 2px solid #ffd166; outline-offset: 2px; }

.photo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 14px;
  border-top: 1px solid #0f3460;
  color: #aab;
  font-size: 0.82rem;
}

.photo-counter {
  font-weight: 700;
  color: #ffd166;
  white-space: nowrap;
}

.photo-credits {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
  text-align: right;
}

.photo-attribution {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.photo-powered {
  color: #667;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modal-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (min-width: 620px) {
  .venue-list { grid-template-columns: repeat(2, 1fr); }
  .guide-title { font-size: 1.7rem; }
}

@media (max-width: 480px) {
  .guide-title { font-size: 1.2rem; }
  .guide-tab { font-size: 0.85rem; padding: 12px 6px; }
  .venue-card { flex-direction: column; align-items: flex-start; }
  .venue-link { align-self: stretch; justify-content: center; }
  .photo-modal { padding: 10px; }
  .photo-nav { width: 34px; }
}
