/* ===========================================
   USA Road Trip - What to Watch
   Fun, warm travel preparation style
   =========================================== */

:root {
  /* Warm, inviting color palette */
  --color-cream: #FDF6E3;
  --color-sand: #F5E6D3;
  --color-coral: #FF6B6B;
  --color-coral-dark: #E85555;
  --color-ocean: #4ECDC4;
  --color-ocean-dark: #3DB9B0;
  --color-sky: #87CEEB;
  --color-sunset: #FFB347;
  --color-text: #2D3436;
  --color-text-light: #636E72;
  --color-white: #FFFFFF;

  /* Typography */
  --font-display: 'Fredoka', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Borders */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
}

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

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(180deg, #e8f4f8 0%, #d4e8ed 100%);
  color: var(--color-text);
  min-height: 100vh;
  position: relative;
}

/* ===========================================
   Header
   =========================================== */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-coral);
}

.search-container {
  flex: 0 1 300px;
}

.search-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--color-sand);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-ocean);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
}

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

/* ===========================================
   Main Layout
   =========================================== */

.main {
  position: relative;
  min-height: 100vh;
}

.map-container {
  padding: 0;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  min-height: 100vh;
}

.map-wrapper {
  position: relative;
  width: calc(100vw - 350px);
  height: 100vh;
  background: linear-gradient(180deg, #e8f4f8 0%, #d4e8ed 100%);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

/* Fade overlay to de-emphasize west coast */
.map-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg,
    rgba(232, 244, 248, 1) 0%,
    rgba(232, 244, 248, 0.95) 50%,
    rgba(232, 244, 248, 0.5) 80%,
    rgba(232, 244, 248, 0) 100%
  );
  z-index: 2;
  pointer-events: none;
}

.us-map-bg {
  position: absolute;
  top: 30%;
  left: 22%;
  transform: translate(-50%, -50%);
  width: 145%;
  height: auto;
  z-index: 1;
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.1));
}

/* State Labels on Hover */
.state-labels-container {
  position: absolute;
  top: 30%;
  left: 22%;
  transform: translate(-50%, -50%);
  width: 145%;
  aspect-ratio: 959 / 593;
  z-index: 15;
  pointer-events: none;
}

/* City icons container - matches map positioning exactly */
.city-icons-container {
  position: absolute;
  top: 30%;
  left: 22%;
  transform: translate(-50%, -50%);
  width: 145%;
  aspect-ratio: 959 / 593;
  z-index: 10;
  pointer-events: none;
}

.state-label {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  text-shadow:
    1px 1px 2px rgba(0, 0, 0, 0.5),
    -1px -1px 2px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 4;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.state-label.visible {
  opacity: 1;
}

.city-icon {
  position: absolute;
  width: 70px;
  height: 70px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10;
  transform: translate(-50%, -50%);
  object-fit: cover;
  pointer-events: auto;
}

.city-icon:hover {
  transform: translate(-50%, -50%) scale(1.4);
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  z-index: 20;
}

/* Placeholder for missing city images */
.city-placeholder {
  position: absolute;
  width: 70px;
  height: 70px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  text-align: center;
  line-height: 1.2;
  padding: 4px;
}

.city-placeholder:hover {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 10;
}

.city-placeholder.las-vegas { background: linear-gradient(135deg, #9B5DE5 0%, #F15BB5 100%); }
.city-placeholder.st-louis { background: linear-gradient(135deg, #00BBF9 0%, #00F5D4 100%); }
.city-placeholder.southeast { background: linear-gradient(135deg, #FEE440 0%, #F15BB5 100%); }
.city-placeholder.orlando { background: linear-gradient(135deg, #FF6B6B 0%, #FFE66D 100%); }
.city-placeholder.naples { background: linear-gradient(135deg, #4ECDC4 0%, #556270 100%); }
.city-placeholder.miami { background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%); }
.city-placeholder.cruise { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }

.city-placeholder-icon {
  font-size: 1.5rem;
  margin-bottom: 2px;
}

.map-note {
  position: absolute;
  bottom: var(--space-sm);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-style: italic;
  background: rgba(255,255,255,0.8);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  z-index: 10;
}

/* ===========================================
   Sidebar
   =========================================== */

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--color-white);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 200;
  overflow-y: auto;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 36px;
  height: 36px;
  border: none;
  background: var(--color-sand);
  border-radius: var(--radius-full);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.sidebar-close:hover {
  background: var(--color-coral);
  color: var(--color-white);
}

.sidebar-content {
  padding: var(--space-xl);
  padding-top: var(--space-2xl);
}

.city-header {
  margin-bottom: var(--space-lg);
}

.city-name {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--color-coral);
  margin-bottom: var(--space-sm);
}

.city-blurb {
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

.shows-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.show-card {
  display: block;
  background: var(--color-cream);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}

.show-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.show-why {
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.4;
  margin-top: var(--space-sm);
}

.show-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.show-poster {
  width: 60px;
  height: 90px;
  background: var(--color-sand);
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.show-poster-placeholder {
  width: 60px;
  height: 90px;
  background: linear-gradient(135deg, var(--color-sand) 0%, var(--color-ocean) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.show-info {
  flex: 1;
}

.show-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.show-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: var(--color-text-light);
}

.show-type {
  background: var(--color-ocean);
  color: var(--color-white);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 500;
}

.show-rating {
  display: flex;
  align-items: center;
  gap: 2px;
}

.show-rating::before {
  content: "★";
  color: var(--color-sunset);
}

/* ===========================================
   Modal
   =========================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 36px;
  height: 36px;
  border: none;
  background: var(--color-sand);
  border-radius: var(--radius-full);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}

.modal-close:hover {
  background: var(--color-coral);
  color: var(--color-white);
}

.modal-content {
  padding: var(--space-xl);
}

.modal-poster {
  width: 100%;
  max-width: 200px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.modal-poster-placeholder {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, var(--color-sand) 0%, var(--color-ocean) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin-bottom: var(--space-lg);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.modal-why {
  background: var(--color-cream);
  border-left: 4px solid var(--color-coral);
  padding: var(--space-md);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: var(--space-lg);
}

.modal-why-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-coral);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-xs);
}

.modal-why-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text);
}

.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.modal-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-sand);
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s;
}

.modal-link:hover {
  background: var(--color-ocean);
  color: var(--color-white);
}

/* ===========================================
   Search Results
   =========================================== */

.search-results {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 500px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 150;
  display: none;
}

.search-results.open {
  display: block;
}

.search-result {
  display: block;
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-sand);
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  color: inherit;
}

.search-result:hover {
  background: var(--color-cream);
}

.search-result:last-child {
  border-bottom: none;
}

.search-result-title {
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.search-result-city {
  font-size: 0.8rem;
  color: var(--color-ocean-dark);
}

.search-no-results {
  padding: var(--space-lg);
  text-align: center;
  color: var(--color-text-light);
}

/* ===========================================
   Responsive
   =========================================== */

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-md);
  }

  .search-container {
    width: 100%;
    flex: none;
  }

  .map-container {
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .map-wrapper {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
  }

  /* Adjust map to focus on East Coast on mobile */
  .us-map-bg {
    top: 45%;
    left: 10%;
    width: 180%;
  }

  .city-icons-container {
    top: 45%;
    left: 10%;
    width: 180%;
  }

  /* Smaller city icons on mobile */
  .city-icon {
    width: 50px;
    height: 50px;
  }

  .city-icon:hover {
    transform: translate(-50%, -50%) scale(1.2);
  }

  /* Move Las Vegas to visible left edge on mobile, aligned with Naples */
  .city-icon[data-city="las-vegas"] {
    left: 52% !important;
    top: 75% !important;
    z-index: 25 !important;
  }

  /* Smoother fade overlay on mobile to hide west coast */
  .map-wrapper::before {
    width: 55%;
    background: linear-gradient(90deg,
      rgba(232, 244, 248, 1) 0%,
      rgba(232, 244, 248, 0.95) 20%,
      rgba(232, 244, 248, 0.7) 50%,
      rgba(232, 244, 248, 0.3) 75%,
      rgba(232, 244, 248, 0) 100%
    );
  }

  .map-note {
    bottom: var(--space-lg);
    font-size: 0.75rem;
    padding: 6px 14px;
  }

  /* Full screen sidebar on mobile */
  .sidebar {
    width: 100%;
    max-width: none;
  }

  .sidebar-content {
    padding: var(--space-md);
    padding-top: var(--space-xl);
  }

  .city-name {
    font-size: 1.5rem;
  }

  .show-poster {
    width: 50px;
    height: 75px;
  }

  .show-poster-placeholder {
    width: 50px;
    height: 75px;
    font-size: 1.2rem;
  }

  .city-label {
    font-size: 10px;
  }

  .city-marker {
    stroke-width: 2;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .us-map-bg {
    top: 50%;
    left: 0%;
    width: 220%;
  }

  .city-icons-container {
    top: 50%;
    left: 0%;
    width: 220%;
  }

  .city-icon {
    width: 42px;
    height: 42px;
  }

  /* Las Vegas at left edge on extra small, aligned with Naples */
  .city-icon[data-city="las-vegas"] {
    left: 53% !important;
    top: 72% !important;
    z-index: 25 !important;
  }

  /* Smoother fade on extra small screens */
  .map-wrapper::before {
    width: 60%;
    background: linear-gradient(90deg,
      rgba(232, 244, 248, 1) 0%,
      rgba(232, 244, 248, 0.9) 25%,
      rgba(232, 244, 248, 0.5) 55%,
      rgba(232, 244, 248, 0.2) 80%,
      rgba(232, 244, 248, 0) 100%
    );
  }

  .sidebar-content {
    padding: var(--space-sm);
    padding-top: var(--space-lg);
  }

  .city-name {
    font-size: 1.25rem;
  }

  .show-card {
    padding: var(--space-sm);
  }

  .show-card-header {
    gap: var(--space-sm);
  }

  .show-title {
    font-size: 0.9rem;
  }

  .show-why {
    font-size: 0.8rem;
  }
}
