:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --secondary: #f59e0b;
  --secondary-light: #fbbf24;
  --bg: #f0f4ff;
  --bg-card: #ffffff;
  --bg-hero: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  --text: #1e293b;
  --text-light: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --error: #ef4444;
  --error-bg: #fef2f2;
  --cat-landmark: #6366f1;
  --cat-food: #ef4444;
  --cat-nature: #22c55e;
  --cat-culture: #f59e0b;
  --cat-nightlife: #a855f7;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(99, 102, 241, 0.10);
  --shadow-lg: 0 8px 40px rgba(99, 102, 241, 0.15);
  --font-primary: 'Quicksand', sans-serif;
  --font-secondary: 'Nunito', sans-serif;
}

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

body {
  font-family: var(--font-primary);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Hero */
.hero {
  position: relative;
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--bg-hero);
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 40%, rgba(255,255,255,0.15) 0%, transparent 60%),
              radial-gradient(circle at 70% 80%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero-title {
  font-family: var(--font-secondary);
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 0.4rem;
}

.hero-sub {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

/* Main */
.main-content {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* Search */
.search-section {
  margin-top: -1.5rem;
  position: relative;
  z-index: 2;
}

.search-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.search-row {
  display: flex;
  gap: 0.75rem;
}

.input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.3rem;
  pointer-events: none;
}

.city-input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 3rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.city-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.city-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.city-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.explore-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-secondary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
}

.explore-btn:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.explore-btn:active:not(:disabled) {
  transform: translateY(0);
}

.explore-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-icon {
  font-size: 1.1rem;
}

.error-msg {
  margin-top: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--error-bg);
  color: var(--error);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Results */
.results-section {
  margin-top: 2rem;
}

/* Loading skeleton */
.loading-state {
  animation: fadeIn 0.3s ease;
}

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

.skeleton-header {
  height: 2rem;
  width: 60%;
  background: linear-gradient(90deg, var(--border) 25%, #f1f5f9 50%, var(--border) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.skeleton-card {
  height: 180px;
  background: linear-gradient(90deg, var(--border) 25%, #f1f5f9 50%, var(--border) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius);
  animation: shimmer 1.5s infinite;
}

/* Results content */
.results-content {
  animation: fadeIn 0.4s ease;
}

.results-header {
  margin-bottom: 1.5rem;
}

.city-heading {
  font-family: var(--font-secondary);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.results-subtitle {
  font-size: 1rem;
  color: var(--text-light);
  font-weight: 500;
}

.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.place-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: cardIn 0.4s ease both;
}

.place-card:nth-child(1) { animation-delay: 0.05s; }
.place-card:nth-child(2) { animation-delay: 0.1s; }
.place-card:nth-child(3) { animation-delay: 0.15s; }
.place-card:nth-child(4) { animation-delay: 0.2s; }
.place-card:nth-child(5) { animation-delay: 0.25s; }

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

.place-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.place-card.cat-landmark { border-top-color: var(--cat-landmark); }
.place-card.cat-food { border-top-color: var(--cat-food); }
.place-card.cat-nature { border-top-color: var(--cat-nature); }
.place-card.cat-culture { border-top-color: var(--cat-culture); }
.place-card.cat-nightlife { border-top-color: var(--cat-nightlife); }

.place-emoji {
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
}

.place-name {
  font-family: var(--font-secondary);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.place-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 0.8rem;
}

.place-category {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 20px;
  color: #fff;
  background: var(--primary);
}

.cat-landmark .place-category { background: var(--cat-landmark); }
.cat-food .place-category { background: var(--cat-food); }
.cat-nature .place-category { background: var(--cat-nature); }
.cat-culture .place-category { background: var(--cat-culture); }
.cat-nightlife .place-category { background: var(--cat-nightlife); }

/* History */
.history-section {
  margin-top: 2.5rem;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.history-title {
  font-family: var(--font-secondary);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.clear-btn {
  padding: 0.4rem 1rem;
  background: none;
  border: 2px solid var(--border);
  border-radius: 20px;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.clear-btn:hover {
  border-color: var(--error);
  color: var(--error);
  background: var(--error-bg);
}

.history-list {
  min-height: 60px;
}

.empty-history {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}

.empty-emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.empty-history p {
  font-size: 0.95rem;
  line-height: 1.6;
}

.history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.history-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem 0.5rem 0.8rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 24px;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.history-chip:hover {
  border-color: var(--primary-light);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
  transform: translateY(-1px);
}

.chip-icon {
  font-size: 1rem;
}

.chip-city {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--bg);
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}

.chip-remove:hover {
  background: var(--error-bg);
  color: var(--error);
}

/* Responsive */
@media (max-width: 600px) {
  .hero {
    padding: 2rem 1rem 2rem;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-sub {
    font-size: 0.95rem;
  }

  .search-row {
    flex-direction: column;
  }

  .explore-btn {
    justify-content: center;
  }

  .places-grid {
    grid-template-columns: 1fr;
  }

  .skeleton-grid {
    grid-template-columns: 1fr;
  }

  .city-heading {
    font-size: 1.3rem;
  }
}