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

:root {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --primary: 210 40% 98%;
  --primary-foreground: 222.2 47.4% 11.2%;
  --secondary: 217.2 32.6% 17.5%;
  --secondary-foreground: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 212.7 26.8% 83.9%;
  --radius: 0.5rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(to bottom, #111827, #020617);
  color: hsl(var(--foreground));
  line-height: 1.6;
  min-height: 100vh;
}

.app-container {
  min-height: 100vh;
  color: hsl(var(--foreground));
}

/* Header */
.header {
  padding: 1.5rem 1rem;
}

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

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  color: hsl(var(--primary));
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

/* Main content */
.main {
  padding-bottom: 2rem;
}

/* Hero section */
.hero {
  text-align: center;
  padding: 3rem 0 5rem;
}

.hero-title {
  font-size: clamp(1.875rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

.hero-description {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  max-width: 42rem;
  margin: 0 auto 2rem;
}

/* Search form */
.search-form {
  max-width: 36rem;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  height: 3rem;
  padding: 0 0.75rem;
  font-size: 1.125rem;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  color: hsl(var(--foreground));
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.search-input::placeholder {
  color: hsl(var(--muted-foreground));
}

.search-button {
  height: 3rem;
  padding: 0 2rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-button:hover {
  background: hsl(var(--primary) / 0.9);
}

.search-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading states */
.loading {
  text-align: center;
  padding: 2.5rem 0;
}

.loading-spinner {
  width: 2rem;
  height: 2rem;
  color: hsl(var(--primary));
  animation: spin 1s linear infinite;
}

.loading-icon {
  width: 1rem;
  height: 1rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Error and no results */
.error-message,
.no-results {
  text-align: center;
  padding: 2.5rem 0;
  color: hsl(var(--muted-foreground));
}

.error-message {
  color: hsl(var(--destructive));
}

/* Image grid */
.image-grid {
  column-count: 1;
  column-gap: 1rem;
  margin: 2rem 0;
}

.image-card {
  position: relative;
  display: block;
  margin-bottom: 1rem;
  break-inside: avoid;
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.image-card:hover {
  transform: scale(1.05);
}

.image-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
}

.image-card:hover .image-overlay {
  opacity: 1;
}

.photographer-name {
  color: white;
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.image-location {
  color: #d1d5db;
  font-size: 0.875rem;
}

/* Show more button */
.show-more-container {
  text-align: center;
  margin-top: 2rem;
}

.show-more-button {
  height: 2.75rem;
  padding: 0 2rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.show-more-button:hover {
  background: hsl(var(--primary) / 0.9);
}

.show-more-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive design */
@media (min-width: 640px) {
  .header {
    padding: 1.5rem;
  }
  
  .container {
    padding: 0 1.5rem;
  }
  
  .image-grid {
    column-count: 2;
  }
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
  
  .image-grid {
    column-count: 3;
  }
  
  .hero {
    padding: 5rem 0;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
  
  .image-grid {
    column-count: 4;
  }
}

@media (max-width: 639px) {
  .search-form {
    flex-direction: column;
  }
  
  .search-input {
    height: 3rem;
    font-size: 1rem;
  }
  
  .search-button {
    height: 3rem;
    justify-content: center;
  }
  
  .hero-title {
    font-size: 1.875rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
}
