@font-face {
  font-family: 'DM Sans';
  src: url('./assets/fonts/DM_Sans/DMSans-VariableFont_opsz,wght.ttf') format('truetype');
  font-weight: 300 700;
}

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('./assets/fonts/Bricolage_Grotesque/BricolageGrotesque-VariableFont_opsz,wdth,wght.ttf') format('truetype');
  font-weight: 700;
}

:root {
  --neutral-900: hsl(243, 96%, 9%);
  --neutral-800: hsl(243, 27%, 20%);
  --neutral-700: hsl(243, 23%, 24%);
  --neutral-600: hsl(243, 23%, 30%);
  --neutral-300: hsl(240, 6%, 70%);
  --neutral-200: hsl(250, 6%, 84%);
  --neutral-0: hsl(0, 0%, 100%);
  --orange-500: hsl(28, 100%, 52%);
  --blue-500: hsl(233, 67%, 56%);
  --blue-700: hsl(248, 70%, 36%);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  background: var(--neutral-900);
  color: var(--neutral-0);
  min-height: 100vh;
}

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

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

.logo {
  height: 40px;
}

.units-dropdown {
  position: relative;
}

.units-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--neutral-800);
  border: none;
  color: var(--neutral-0);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s;
}

.units-btn:hover {
  background: var(--neutral-700);
}

.units-section label:hover {
  background: var(--neutral-600);
  border-radius: 6px;
}

.units-btn:focus {
  outline: 2px solid var(--neutral-0);
  outline-offset: 2px;
}

.search-input-wrapper:focus-within {
  outline: 2px solid var(--neutral-0);
  outline-offset: 2px;
}

.search-input:focus {
  outline: none;
}

.search-btn:focus {
  outline: 2px solid var(--neutral-0);
  outline-offset: 2px;
}

.day-btn:focus {
  outline: 2px solid var(--neutral-0);
  outline-offset: 2px;
}

.units-section input[type="radio"]:focus {
  outline: 2px solid var(--neutral-0);
  outline-offset: 2px;
}

.search-btn:hover {
  background: var(--blue-700);
  cursor: pointer;
}

.day-btn:hover {
  background: var(--neutral-700);
  cursor: pointer;
}

.suggestion-item:hover {
  background: var(--neutral-600);
  cursor: pointer;
}

.dropdown-icon {
  transition: transform 0.2s;
}

.units-dropdown.open .dropdown-icon {
  transform: rotate(180deg);
}

.units-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--neutral-700);
  border-radius: 12px;
  padding: 1.5rem;
  min-width: 280px;
  display: none;
  z-index: 10;
}

.units-dropdown.open .units-menu {
  display: block;
}

.units-header {
  font-size: 16px;
  font-weight: 600;
  color: var(--neutral-0);
  margin-bottom: 1.5rem;
}

.units-section {
  margin-bottom: 1.5rem;
}

.units-section:last-child {
  margin-bottom: 0;
}

.units-section h3 {
  font-size: 14px;
  margin-bottom: 0.75rem;
  color: var(--neutral-300);
  font-weight: 500;
}

.units-section label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  cursor: pointer;
  font-size: 14px;
  padding: 0.5rem 0;
}

.units-section label span {
  flex: 1;
  margin-left: 0.75rem;
}

.units-section input[type="radio"] {
  accent-color: var(--orange-500);
}

.checkmark {
  width: 16px;
  height: 16px;
  opacity: 0;
  transition: opacity 0.2s;
}

.units-section input[type="radio"]:checked + span + .checkmark {
  opacity: 1;
}

.search-section {
  text-align: center;
  margin-bottom: 3rem;
}

.search-section h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--blue-500), var(--orange-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  gap: 1rem;
}

.search-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--neutral-800);
  border-radius: 12px;
  padding: 0 1.5rem;
  gap: 1rem;
}

.search-icon {
  width: 20px;
  height: 20px;
  opacity: 0.6;
}

.search-input {
  flex: 1;
  padding: 1.25rem 0;
  background: transparent;
  border: none;
  color: var(--neutral-0);
  font-size: 16px;
  outline: none;
}

.search-input::placeholder {
  color: var(--neutral-300);
}

.search-btn {
  padding: 1.25rem 1.5rem;
  background: var(--blue-500);
  border: none;
  color: var(--neutral-0);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.search-btn:hover {
  background: var(--blue-700);
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--neutral-700);
  border-radius: 12px;
  margin-top: 0.5rem;
  display: none;
  z-index: 10;
}

.search-suggestions.show {
  display: block;
}

.suggestion-item {
  padding: 1rem 1.5rem;
  cursor: pointer;
  border-bottom: 1px solid var(--neutral-600);
  transition: background-color 0.2s;
}

.suggestion-item:hover {
  background: var(--neutral-600);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.search-progress {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--neutral-700);
  border-radius: 12px;
  margin-top: 0.5rem;
  padding: 1rem 1.5rem;
  display: none;
  align-items: center;
  gap: 0.75rem;
  z-index: 10;
}

.search-progress.show {
  display: flex;
}

.progress-icon {
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
}

.search-progress span {
  font-size: 14px;
  color: var(--neutral-200);
}

.error-message {
  margin-top: 1rem;
  color: #ff6b6b;
  font-size: 14px;
}

.weather-content {
  display: none;
}

.weather-content.show {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
}

.main-content {
  display: flex;
  flex-direction: column;
}

.current-weather {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  padding: 3rem 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.current-weather::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 10%;
  width: 8px;
  height: 8px;
  background: var(--orange-500);
  border-radius: 50%;
}

.current-weather::after {
  content: '';
  position: absolute;
  bottom: 30%;
  right: 15%;
  width: 4px;
  height: 4px;
  background: var(--neutral-0);
  border-radius: 50%;
}

.current-info {
  justify-self: start;
}

.location {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--neutral-0);
}

.current-date {
  font-size: 1rem;
  color: var(--neutral-200);
}

.current-temp {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 5rem;
  font-weight: 700;
  color: var(--neutral-0);
  justify-self: center;
}

.weather-icon {
  justify-self: end;
}

.weather-icon img {
  width: 100px;
  height: 100px;
}

.weather-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.stat {
  background: var(--neutral-800);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
}

.stat-label {
  display: block;
  color: var(--neutral-300);
  font-size: 14px;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
}

.hourly-section {
  background: var(--neutral-800);
  border-radius: 16px;
  padding: 1.5rem;
  height: fit-content;
}

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

.hourly-header h2 {
  font-size: 1.5rem;
  margin: 0;
}

.day-dropdown {
  position: relative;
}

.day-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--neutral-800);
  border: none;
  color: var(--neutral-0);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.day-dropdown-btn:hover {
  background: var(--neutral-700);
}

.day-dropdown-btn:focus {
  outline: 2px solid var(--neutral-0);
  outline-offset: 2px;
}

.day-dropdown.open .dropdown-icon {
  transform: rotate(180deg);
}

.day-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--neutral-700);
  border-radius: 8px;
  padding: 0.5rem 0;
  min-width: 120px;
  display: none;
  z-index: 10;
}

.day-dropdown.open .day-dropdown-menu {
  display: block;
}

.day-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.day-option:hover {
  background: var(--neutral-600);
}

.forecast-section {
  margin-bottom: 3rem;
}

.forecast-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.daily-forecast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.daily-item {
  background: var(--neutral-800);
  padding: 1.5rem 1rem;
  border-radius: 12px;
  text-align: center;
}

.daily-day {
  font-size: 14px;
  color: var(--neutral-300);
  margin-bottom: 1rem;
}

.daily-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
}

.daily-temps {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.daily-high {
  font-weight: 600;
}

.daily-low {
  color: var(--neutral-300);
}

.day-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.day-btn {
  padding: 0.75rem 1.5rem;
  background: var(--neutral-800);
  border: none;
  color: var(--neutral-0);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
  transition: background-color 0.2s;
}

.day-btn:hover {
  background: var(--neutral-700);
}

.hourly-section {
  margin-bottom: 3rem;
}

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

.hourly-header h2 {
  font-size: 1.5rem;
  margin: 0;
}

.day-dropdown {
  position: relative;
}

.day-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--neutral-800);
  border: none;
  color: var(--neutral-0);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.day-dropdown-btn:hover {
  background: var(--neutral-700);
}

.day-dropdown.open .dropdown-icon {
  transform: rotate(180deg);
}

.day-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--neutral-700);
  border-radius: 8px;
  padding: 0.5rem 0;
  min-width: 120px;
  display: none;
  z-index: 10;
}

.day-dropdown.open .day-dropdown-menu {
  display: block;
}

.day-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.day-option:hover {
  background: var(--neutral-600);
}

.day-option.active {
  background: var(--orange-500);
}

.forecast-section {
  margin-bottom: 3rem;
}

.forecast-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.hourly-forecast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
}

.hourly-item {
  background: var(--neutral-700);
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.hourly-item:hover {
  background: var(--neutral-600);
}

.hourly-item.selected {
  background: var(--orange-500);
}

.hourly-time {
  font-size: 12px;
  color: var(--neutral-300);
  margin-bottom: 0.75rem;
}

.hourly-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 0.75rem;
}

.hourly-temp {
  font-size: 14px;
  font-weight: 600;
}

.loading-skeleton {
  display: none;
}

.loading-skeleton.show {
  display: block;
}

.skeleton-current {
  background: var(--neutral-700);
  padding: 3rem 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
}

.skeleton-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.skeleton-dots span {
  width: 8px;
  height: 8px;
  background: var(--neutral-600);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.skeleton-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

.skeleton-text {
  color: var(--neutral-300);
  font-size: 1rem;
}

.skeleton-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.skeleton-stat {
  background: var(--neutral-800);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
}

.skeleton-stat .stat-label {
  display: block;
  color: var(--neutral-300);
  font-size: 14px;
  margin-bottom: 0.5rem;
}

.skeleton-line {
  font-size: 1.5rem;
  color: var(--neutral-600);
}

.skeleton-section {
  margin-bottom: 3rem;
}

.skeleton-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--neutral-0);
}

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

.skeleton-card {
  background: var(--neutral-700);
  height: 120px;
  border-radius: 12px;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-hourly {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.skeleton-hour {
  background: var(--neutral-700);
  height: 60px;
  border-radius: 12px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.api-error {
  display: none;
  text-align: center;
  padding: 4rem 2rem;
}

.api-error.show {
  display: block;
}

.error-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 2rem;
  opacity: 0.8;
}

.api-error h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--neutral-0);
}

.api-error p {
  font-size: 1rem;
  color: var(--neutral-300);
  margin-bottom: 2rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.retry-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--neutral-700);
  border: none;
  color: var(--neutral-0);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  margin: 0 auto;
  transition: background-color 0.2s;
}

.retry-btn:hover {
  background: var(--neutral-600);
}

.retry-btn:focus {
  outline: 2px solid var(--neutral-0);
  outline-offset: 2px;
}

.retry-btn img {
  width: 16px;
  height: 16px;
}

.no-results {
  display: none;
  text-align: center;
  padding: 3rem;
}

.no-results.show {
  display: block;
}

.no-results h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--neutral-0);
}

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

.loading.show {
  display: block;
}

.loading img {
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
}

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

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .header {
    margin-bottom: 2rem;
  }
  
  .logo {
    height: 32px;
  }
  
  .search-section h1 {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  .search-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .search-input-wrapper {
    width: 100%;
  }
  
  .search-btn {
    width: 100%;
    padding: 1.25rem;
    border-radius: 12px;
  }
  
  .weather-content.show {
    display: block;
  }
  
  .current-weather {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1rem;
    padding: 2rem 1.5rem;
  }
  
  .current-info {
    justify-self: center;
  }
  
  .current-temp {
    font-size: 4rem;
    justify-self: center;
  }
  
  .weather-icon {
    justify-self: center;
  }
  
  .weather-icon img {
    width: 80px;
    height: 80px;
  }
  
  .weather-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .daily-forecast {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
  
  .daily-item {
    padding: 1rem 0.75rem;
  }
  
  .hourly-section {
    background: transparent;
    padding: 0;
    margin-bottom: 3rem;
  }
  
  .hourly-forecast {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .hourly-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    text-align: left;
    background: var(--neutral-800);
    border-radius: 12px;
  }
  
  .hourly-time {
    font-size: 14px;
    margin-bottom: 0;
    min-width: 60px;
  }
  
  .hourly-icon {
    width: 24px;
    height: 24px;
    margin: 0;
  }
  
  .hourly-temp {
    font-size: 16px;
    min-width: 40px;
    text-align: right;
  }
}

@media (max-width: 480px) {
  .search-section h1 {
    font-size: 1.75rem;
  }
  
  .weather-stats {
    grid-template-columns: 1fr;
  }
  
  .daily-forecast {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
}
