:root {
  --bg-color: #0c0c0e;
  --text-color: #f0f0f2;
  --accent-color: #3b82f6;
  --card-bg: #1a1a1e;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

@media (max-width: 600px) {
  .container {
    padding: 1.5rem 1rem;
  }
}

header {
  text-align: center;
  margin-bottom: 4rem;
  padding-top: 2rem;
}

header h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  background: linear-gradient(to right, #fff, #888);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}


header p {
  color: #888;
  font-size: 1.2rem;
}

.search-container {
  max-width: 600px;
  margin: 0 auto 4rem;
  position: relative;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  padding: 0.25rem 0.5rem 0.25rem 1.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.search-wrapper:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 8px 30px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.search-icon {
  color: #666;
  flex-shrink: 0;
}

.search-wrapper input {
  background: transparent;
  border: none;
  color: #fff;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  width: 100%;
  outline: none;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.search-wrapper input::placeholder {
  color: #555;
}

#clear-search {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #888;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

#clear-search:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

@media (max-width: 600px) {
  .search-container {
    margin-bottom: 3rem;
  }
}

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

@media (max-width: 480px) {
  .mountain-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.mountain-card {
  position: relative;
  background: var(--card-bg);
  border-radius: 1rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  min-height: 250px;
  background-size: cover;
  background-position: center;
}

.mountain-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.8) 100%);
  z-index: 1;
}

.mountain-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  border-color: rgba(59, 130, 246, 0.5);
}

.card-content {
  padding: 1.5rem;
  margin-top: auto;
  position: relative;
  z-index: 2;
}

.card-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.card-state {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Organization & Favorites */
.state-section {
  margin-bottom: 5rem;
}

.state-header {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #666;
  margin-bottom: 2.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 700;
}

.favorites-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-wrapper {
  position: relative;
  transition: transform 0.3s ease;
}

.card-wrapper:hover {
  transform: translateY(-8px);
}

.mountain-card {
  /* Remove translate from card itself since wrapper handles it */
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.favorite-star {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.favorite-star:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-color);
  transform: scale(1.1);
}

.favorite-star svg {
  width: 1.25rem;
  height: 1.25rem;
  transition: all 0.2s ease;
}

.favorite-star.is-active {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
}

.favorite-star.is-active svg {
  fill: #fbbf24;
}

/* Cam Grid View */
.cam-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(45%, 1fr));
  gap: 1px;
  background: #000;
  min-height: calc(100vh - 70px);
}

.video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
  overflow: hidden; /* Mask the overflow from translated iframe */
}

.video-container iframe {
  position: absolute;
  top: -60px; /* Shift up to hide title bar */
  left: 0;
  width: 100%;
  height: calc(100% + 120px); /* Tall enough to hide bottom bar too */
  border: 0;
  pointer-events: none; /* Prevents hover-triggered UI */
}

/* Allow interaction for Brownrice cameras so we can simulate clicks */
.video-container iframe.brownrice-iframe {
  pointer-events: auto;
}

.back-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.back-link:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .cam-grid {
    grid-template-columns: 1fr;
  }
}

/* Support Link at Top */

.support-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: var(--accent-color);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 0.5rem;
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}

.support-button:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.support-button svg {
  opacity: 1;
}

@media (max-width: 600px) {
  .top-support {
    text-align: center;
    padding: 1rem;
  }
  
  .support-button {
    width: 100%;
    justify-content: center;
  }
}
