:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg-dark: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(
      circle at 20% 20%,
      rgba(99, 102, 241, 0.15) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(16, 185, 129, 0.1) 0%,
      transparent 40%
    );
  color: var(--text-main);
  min-height: 100vh;
  padding: 2rem 1rem;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 3rem;
}

header h1 {
  font-family: "Outfit", sans-serif;
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #818cf8, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  color: var(--text-dim);
  font-size: 1.1rem;
}

.search-section {
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.search-box {
  display: flex;
  gap: 1rem;
  width: 100%;
  max-width: 600px;
}

input {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  backdrop-filter: blur(10px);
  transition: border-color 0.3s ease;
}

input:focus {
  outline: none;
  border-color: var(--primary);
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 2rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.status-message {
  margin-top: 1rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.hidden {
  display: none;
}

.info-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  padding: 2rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  margin-bottom: 2rem;
  text-align: center;
}

.info-card h2 {
  font-family: "Outfit", sans-serif;
  margin-bottom: 0.5rem;
}

.coordinates {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.chart-container {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  padding: 2rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  margin-bottom: 2rem;
  height: 400px;
}

.table-section {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: auto;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: none;
    box-shadow: none;
}

.table-container {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    width: 100%;
    margin-top: 1rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 2000px; /* Large enough to show full table */
    opacity: 1;
}

.table-container.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    border: none;
    pointer-events: none;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
}

td {
  padding: 1rem;
  border-top: 1px solid var(--glass-border);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.05);
}

.status-pill {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-good {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}
.status-moderate {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}
.status-unhealthy {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

@media (max-width: 600px) {
  .search-box {
    flex-direction: column;
  }
  button {
    padding: 1rem;
  }
}
