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

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('./assets/fonts/Bricolage_Grotesque/static/BricolageGrotesque-Bold.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
}

body {
  /* background-color: rgb(4, 6, 23); */
  background: linear-gradient(to bottom right, #000b38, #000000);
  color: white;
  font-family: "Bricolage Grotesque", sans-serif;
  height: 100vh;
}

.title {
  text-align: center;
}

.search-container {
  display: flex;
  justify-content: center;
}

.error-message {
  text-align: center;
  color: white;
  font-size: 1rem;
  margin: 1rem 0;
  padding: 0.5rem;
}

.error-message.hidden {
  display: none;
}

#search {
  height: 25px;
  width: 300px;
  border-radius: 15px;
  padding: 5px 15px;
}

.unit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
  }
#unitsBtn:hover{
  background-color: #3b3e7a;
}

  
  .unit-toggle input {
    display: none;
  }
  
  .slider {
    width: 40px;
    height: 20px;
    background: #933535;
    border-radius: 20px;
    position: relative;
    transition: background 0.3s;
  }
  
  .slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
  }
  
  input:checked + .slider::before {
    transform: translateX(20px);
  }
  
  input:checked + .slider {
    background: #007bff;
  }

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

  .logo {
    display: flex;
    align-items: center;

  }

.weather-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: 15px auto;
}

.current-weather {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 150px;
  position: relative;
  border-radius: 16px;
  padding: 2rem;
  background-image: url("./assets/images/bg-today-large.svg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.loading-state {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(28, 30, 59, 0.9);
  border-radius: 16px;
  z-index: 10;
}

.loading-state.hidden {
  display: none;
}

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

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

.loading-state p {
  color: white;
  font-size: 1rem;
  margin: 0;
}

.section-loading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  min-height: 200px;
}

.section-loading.hidden {
  display: none;
}

.section-loading .loading-icon {
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 0.5rem;
}

.section-loading p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin: 0;
}

#cityname {
  font-size: 1.5rem;
}

#current-date {
  font-size: 1rem;
  font-weight: 100;
}

#curr-temp {
  /* font-size: 40px; */
  /* color:black; */
}

.day-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.day-detail {
  background: #1a1f3a;
  border-radius: 16px;
  padding: 1.5rem;
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.weather-grid-right {
  background: #15182a;
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.weather-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.weather-status-icon {
  width: 70px;
  height: 70px;
}

#curr-temp {
  font-size: 3rem;
  font-weight: 600;
  font-family: "Bricolage Grotesque", sans-serif;
}

/* .hourly-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1b1f3a;
  padding: 0.8rem 1rem;
  border-radius: 12px;
} */












.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .main-grid {
    grid-template-columns: 2fr 1fr;
  }
}

/* Left column */
.weather-card {
  position: relative;
  background: linear-gradient(to bottom right, #4F46E5, #6366F1);
  border-radius: 24px;
  padding: 2rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.weather-card .decor {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.8;
}

.decor1 { top: 3rem; left: 4rem; width: 12px; height: 12px; background: #FFD700; }
.decor2 { top: 5rem; right: 8rem; width: 8px; height: 8px; background: #FFA500; }
.decor3 { bottom: 6rem; left: 12rem; width: 8px; height: 8px; background: #FFEB3B; }
.decor4 { top: 50%; left: 5rem; width: 64px; height: 64px; background: rgba(255,255,255,0.1); filter: blur(20px); }
.decor5 { bottom: 5rem; right: 8rem; width: 100px; height: 100px; background: rgba(255,255,255,0.1); filter: blur(30px); }

.weather-info {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.weather-info h2 {
  font-size: 2rem;
  margin: 0;
}

.weather-info p {
  color: rgba(255,255,255,0.8);
}

.temp-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.temp {
  font-size: 4rem;
}

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

.stat {
  background: #1A1F3A;
  border-radius: 16px;
  padding: 1.5rem;
}

.stat div:first-child {
  color: #aaa;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.value {
  font-size: 1.8rem;
}

.section-title {
  margin: 2rem 0 1rem;
}

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

.day {
  background: #1A1F3A;
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
}

.day .label {
  color: #aaa;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.day small {
  color: #aaa;
}

/* Right column */
.right {
  background: #1A1F3A;
  border-radius: 24px;
  padding: 1.5rem;
}

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

.dropdown {
  background: none;
  border: none;
  color: #aaa;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.hourly {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hour {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0A0E27;
  border-radius: 12px;
  padding: 10px 16px;
}

.icon {
  vertical-align: middle;
}

.yellow {
  color: #FFD700;
}

.gray {
  color: #888;
}

.big {
  width: 64px;
  height: 64px;
}



.hourly-scroll {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 8px;
  padding: 5px;
  scroll-behavior: smooth;
  max-height: 400px;
}

.hourly-scroll::-webkit-scrollbar {
  width: 6px; 
}

.hourly-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(80, 80, 100, 0.4); 
  border-radius: 10px;
}

.hourly-scroll::-webkit-scrollbar-thumb:hover {
  background-color: rgba(120, 120, 140, 0.5); 
}

.hourly-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.hour-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* flex: 0 0 auto; */
  background: #1a1f3a;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  color: white;
  /* min-width: 90px; */
}

.hour-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
  margin-bottom: 6px;
}

.weather-icon {
  height: 50px;
}

.hour-time {
  font-size: 0.9rem;
  color: #d3cbcb;
}

.hour-temp {
  font-size: 1.2rem;
  font-weight: bold;
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.daily-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1a1f3a;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  color: white;
}

.daily-temp {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 70px;
  margin: 5px;
  gap: 5px;
}

#day-select {
  display: block !important;
  position: relative !important;
  z-index: 10 !important;
  opacity: 1 !important;
  background: #1a1f3a;
  color: white;
  border-radius: 15px;
  padding: 8px;
  margin: 10px;
}

#day-select:hover{
  background-color: #3b3e7a;
  cursor: pointer;
}

.units-dropdown {
  position: relative;
  display: inline-block;
  z-index: 1000;
}

.units-btn {
  background-color: #2c2f58;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}

.units-menu {
  position: absolute;
  right: 0;
  top: 110%;
  background: #1c1e3b;
  color: white;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  min-width: 200px;
  z-index: 1000;
}

.units-section {
  margin-bottom: 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 8px;
}

.units-section:first-child {
  border-top: none;
}

.units-title {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 4px;
}

.units-menu label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 0;
  position: relative;
}

.units-menu input[type="radio"] {
  display: none;
}

.units-menu label::after {
  content: '';
  width: 16px;
  height: 16px;
  background-image: url('./assets/images/icon-checkmark.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.units-menu label:has(input[type="radio"]:checked)::after {
  opacity: 1;
}

.units-switch-section {
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.units-toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.units-toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.units-toggle-switch input {
  display: none;
}

.units-toggle-switch .slider {
  width: 40px;
  height: 20px;
  background: #063098;
  border-radius: 20px;
  position: relative;
  transition: background 0.3s;
}

.units-toggle-switch .slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.units-toggle-switch input:checked ~ .slider::before {
  transform: translateX(20px);
}

.units-toggle-switch input:checked ~ .slider {
  background: #007bff;
}

.units-toggle-switch .label-text,
.units-toggle-switch .units-toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.hidden {
  display: none;
}

#search-button{
  background-color: #2c2f58;
  color: white;
  border: none;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
}

#search-button:hover{
  background-color: #3b3e7a;
}

