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

:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #252542;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b8;
  --accent-green: #22c55e;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-orange: #f59e0b;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
  --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 2rem 1rem;
  background-image:
    radial-gradient(ellipse at top, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

.header {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
}

.header-icon {
  margin-bottom: -150px;
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
  position: relative;
  z-index: 1;
}

.logo-img {
  width: 500px;
  max-width: 100%;
  /* Ensure it doesn't overflow */
  height: auto;
  display: block;
  margin: 0 auto;
}

.header h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 2;
  /* Solid non-transparent sign (skylt) effect */
  padding: 1rem 3rem;
  background-color: #1a1a2e;
  /* Solid background */
  border-radius: 8px;
  display: inline-block;
  border: 4px solid #252542;
  box-shadow:
    0 4px 0 #000,
    0 15px 30px rgba(0, 0, 0, 0.8);
  transform: rotate(-1deg);
  margin-top: 10px;
  max-width: calc(100vw - 40px);
  /* Prevent overflow */
  box-sizing: border-box;
}

.header h1 span {
  background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}

.header h1::before {
  content: '';
  position: absolute;
  top: -1000px;
  left: 30px;
  width: 4px;
  /* Slightly thicker for better visibility */
  height: 1000px;
  background: #252542;
  z-index: -1;
}

.header h1::after {
  content: '';
  position: absolute;
  top: -1000px;
  right: 30px;
  width: 4px;
  height: 1000px;
  background: #252542;
  z-index: -1;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  position: relative;
  z-index: 2;
  margin-top: 1.5rem;
  display: block;
}

.address-section {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--card-shadow);
}

.address-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.address-input-wrapper {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.address-input {
  flex: 1;
  min-width: 250px;
  padding: 0.875rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.address-input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.address-input::placeholder {
  color: var(--text-secondary);
}

.input-container {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.input-container .address-input {
  width: 100%;
  min-width: unset;
}

.suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  border-radius: 0 0 12px 12px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.suggestion-item {
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
}

.suggestion-item:last-child {
  border-bottom: none;
  border-radius: 0 0 12px 12px;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: rgba(139, 92, 246, 0.2);
  color: white;
}

.suggestion-item .highlight {
  color: var(--accent-purple);
  font-weight: 600;
}

.suggestions-loading {
  padding: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.fetch-btn {
  padding: 0.875rem 2rem;
  background: var(--gradient-1);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.fetch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.fetch-btn:active {
  transform: translateY(0);
}

.fetch-btn.loading .btn-text {
  opacity: 0;
}

.fetch-btn.loading .btn-loader {
  display: block;
}

.btn-loader {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading {
  text-align: center;
  padding: 3rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--bg-card);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

.loading p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.error-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.error-message {
  color: #fca5a5;
}

.hidden {
  display: none !important;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.waste-card {
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.waste-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent);
}

.waste-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.waste-card.restavfall {
  --card-accent: var(--accent-orange);
}

.waste-card.matavfall {
  --card-accent: var(--accent-green);
}

.waste-card.plast-papp {
  --card-accent: var(--accent-blue);
}

.waste-card.glas {
  --card-accent: var(--accent-cyan);
}

.waste-card.metallbeh {
  --card-accent: var(--accent-purple);
}

.waste-card.default {
  --card-accent: var(--accent-pink);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.waste-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.waste-type {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.next-pickup {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.next-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.next-date {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--card-accent);
}

.days-until {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.card-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.detail-label {
  color: var(--text-secondary);
}

.detail-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

.frequency-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

@media (max-width: 600px) {
  body {
    padding: 1rem 0.75rem;
  }

  .header h1 {
    font-size: 1.75rem;
    /* Smaller title for mobile */
    padding: 0.75rem 1.5rem;
    /* Less padding */
    margin-top: -20px;
    /* Bring it closer to the cat */
  }

  .header-icon {
    margin-bottom: -60px;
    /* Tighter overlap for mobile */
  }

  .logo-img {
    width: 320px;
    /* Reduced fixed initial width but still max-width: 100% */
  }

  .header h1::before,
  .header h1::after {
    height: 1000px;
    /* Keep them long */
    top: -1000px;
  }

  .header h1::before {
    left: 15px;
  }

  .header h1::after {
    right: 15px;
  }

  .address-input-wrapper {
    flex-direction: column;
  }

  .fetch-btn {
    width: 100%;
  }

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