/* Base reset & dark background */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body{
  overflow-x: hidden;
  width: 100%;
}

body {
  background-color: #0a0a0c;
  color: #e8e4d9;
  font-family: 'DM Sans', sans-serif;
  padding: 24px;
}

.page-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

/* Header */
header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid #2a2a2e;
  margin-bottom: 24px;
  position: relative;
}

h1 {
  font-size: 36px;
  letter-spacing: 4px;
  color: #e8e4d9;
}

h1 span {
  color: #c0392b;
}

/* logo */
#logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#hero {
  text-align: center;
  padding: 24px 20px 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid #2e1a1a;
}

#hero-temp {
  font-size: 96px;
  font-family: 'Bebas Neue', sans-serif;
  color: #e8e4d9;
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: 4px;
}

#hero-feels {
  font-size: 16px;
  color: #c8c4b8;
  margin-bottom: 2px;
}

#hero-location {
  font-size: 12px;
  color: #7a6a6a;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 8px;
}

#hero-verdict {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: #e8e4d9;
  letter-spacing: 3px;
  margin-bottom: 4px;
  margin-top: 2px;
}

#hero-commentary-1,
#hero-commentary-2 {
  font-size: 13px;
  color: #9a8f8f;
  font-style: italic;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Unit toggle */
#unit-toggle {
  display: flex;
}
.unit-btn {
  background: #110d0d;
  border: 1px solid #2e1a1a;
  color: #555;
  padding: 8px 14px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.unit-btn:first-child {
  border-radius: 6px 0 0 6px;
}

.unit-btn:last-child {
  border-radius: 0 6px 6px 0;
  border-left: none;
}

.unit-btn.active {
  background: #c0392b;
  color: #ffffff;
  border-color: #c0392b;
}

/* Search bar */

#search-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
}

#city-input {
  background: #16161a;
  border: 1px solid #2a2a2e;
  color: #e8e4d9;
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  border-radius: 6px;
  width: 220px;
}

#search-btn {
  background: #c0392b;
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
}

#search-error {
  text-align: center;
  padding: 8px;
  font-size: 13px;
  color: #c0392b;
  font-style: italic;
  min-height: 24px;
}

/* locate button */
#locate-btn {
  background: #110d0d;
  border: 1px solid #2e1a1a;
  color: #e8e4d9;
  padding: 10px 14px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  border-radius: 6px;
  cursor: pointer;
  margin-left: auto;
  transition: border-color 0.2s;
  white-space: nowrap;
}

#locate-btn:hover {
  border-color: #c0392b;
}

#suggestions {
  position: absolute;
  top: 44px;
  left: 0;
  background: #16161a;
  border: 1px solid #2e1a1a;
  border-radius: 6px;
  width: 280px;
  z-index: 100;
}

.suggestion {
  padding: 10px 14px;
  font-size: 13px;
  color: #e8e4d9;
  cursor: pointer;
  border-bottom: 1px solid #2e1a1a;
}

#suggestions:empty {
  border: none;
}

.suggestion:hover {
  background: #2e1a1a;
  color: #ffffff;
}

.suggestion:last-child {
  border-bottom: none;
}

#clear-btn {
  background: transparent;
  border: none;
  color: #555;
  font-size: 14px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
  transition: color 0.2s;
}

#clear-btn:hover {
  color: #e8e4d9;
}

/* Shite score banner */
#shite-banner {
  background: #140d0d;
  border: 1px solid #2e1a1a;
  border-left: 4px solid #c0392b;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

#shite-score {
  font-size: 48px;
  color: #c0392b;
  font-weight: bold;
}

#shite-verdict {
  font-size: 18px;
  margin: 8px 0 6px;
}

#shite-commentary {
  font-size: 13px;
  color: #a07070;

}

/* Stat cards grid */
#current-conditions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: #110d0d;
  border: 1px solid #2e1a1a;
  border-radius: 8px;
  padding: 16px;
}

.stat-label {
  font-size: 11px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  color: #e8e4d9;
}

/* Forecast sections */
#hourly, #daily {
  margin-bottom: 24px;
}

h2 {
  font-size: 11px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1e1e22;
}

/* hourly */
#hourly-container {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: #2e1a1a #0a0a0c;
}

.hourly-item {
  background: #110d0d;
  border: 1px solid #2e1a1a;
  border-radius: 8px;
  padding: 12px 16px;
  text-align: center;
  min-width: 80px;
  flex-shrink: 0;
}

.hourly-time {
  font-size: 11px;
  color: #7a6a6a;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.hourly-temp {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: #e8e4d9;
  margin-bottom: 4px;
}

.hourly-rain {
  font-size: 13px;
  color: #5a8ab0;
}

.hourly-emoji {
  font-size: 22px;
  margin-bottom: 6px;
}

.expand-wind {
  font-size: 12px;
  color: #7a6a6a;
  font-weight: 500;
  min-width: 70px;
  text-align: right;
}
.minute-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 52px;
  font-size: 12px;
  color: #7a6a6a;
  border-bottom: 1px solid #150d0d;
}

/* 7 Day */

#daily-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.daily-item {
  display: flex;
  align-items: center;
  background: #110d0d;
  border: 1px solid #2e1a1a;
  border-radius: 8px;
  padding: 14px 18px;
  gap: 16px;
}

.daily-day {
  font-size: 14px;
  color: #e8e4d9;
  width: 110px;
  flex-shrink: 0;
}

.daily-emoji {
  font-size: 22px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.daily-rain {
  font-size: 15px;
  color: #5a8ab0;
  flex: 1;
}

.daily-temps {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.daily-high {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: #e8e4d9;
}

.daily-low {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: #555;
}

.day-hourly-expand {
  margin-bottom: 4px;
}

.day-hourly-scroll {
  background: #0d0808;
  border: 1px solid #2e1a1a;
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.expand-hour-block {
  border-bottom: 1px solid #1e1010;
}

.expand-hour-block:last-child {
  border-bottom: none;
}

.expand-hour-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.15s;
}

.expand-hour-header:hover {
  background: #1a0f0f;
}

.expand-time {
  font-size: 13px;
  color: #9a8f8f;
  width: 55px;
  flex-shrink: 0;
}

.expand-emoji {
  font-size: 18px;
  width: 24px;
}

.expand-temp {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: #e8e4d9;
  flex: 1;
}

.expand-rain {
  font-size: 13px;
  color: #5a8ab0;
  font-weight: 500;
}

.expand-arrow {
  font-size: 12px;
  color: #555;
}

.expand-minutes {
  display: none;
  background: #080505;
  padding: 4px 0;
}

.minute-row {
  display: flex;
  gap: 24px;
  padding: 8px 52px;
  font-size: 12px;
  color: #7a6a6a;
  border-bottom: 1px solid #150d0d;
}

.minute-row:last-child {
  border-bottom: none;
}

.minute-row span:nth-child(2) {
  color: #c8c4b8;
  font-weight: 500;
}

.minute-row span:nth-child(3) {
  color: #5a8ab0;
}

.hourly-minutes-popup {
  background: #080505;
  border: 1px solid #2e1a1a;
  border-radius: 8px;
  padding: 8px 0;
  min-width: 160px;
  flex-shrink: 0;
}

.hminute-row {
  display: flex;
  gap: 12px;
  padding: 6px 14px;
  font-size: 12px;
  color: #7a6a6a;
  border-bottom: 1px solid #150d0d;
  justify-content: space-between;
}

.hminute-row:last-child {
  border-bottom: none;
}

.hminute-row span:nth-child(2) {
  color: #c8c4b8;
  font-weight: 500;
}

.hminute-row span:nth-child(3) {
  color: #5a8ab0;
}

#hourly-detail-panel {
  margin-top: 12px;
  background: #0d0808;
  border: 1px solid #2e1a1a;
  border-radius: 8px;
  overflow: hidden;
}

.hourly-detail-header {
  font-size: 11px;
  color: #7a6a6a;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 10px 18px;
  border-bottom: 1px solid #1e1010;
}

/* radar */
#radar {
  margin-bottom: 24px;
}

#radar-container {
  border: 1px solid #2e1a1a;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  height: 450px;
}

#radar-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/*background*/
#weather-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  transition: background 2s ease;
  overflow: hidden;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-width: 100vw;
}

.page-wrapper {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

#bg-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
@keyframes rainFall {
  0% { transform: translateY(-20px) rotate(15deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(100vh) rotate(15deg); opacity: 0; }
}

@keyframes snowFall {
  0% { transform: translateY(-20px) translateX(0px); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translateY(50vh) translateX(30px); }
  90% { opacity: 1; }
  100% { transform: translateY(100vh) translateX(-20px); opacity: 0; }
}

@keyframes cloudDrift {
  0% { transform: translateX(-400px); }
  100% { transform: translateX(120vw); }
}

@keyframes sunPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes lightningFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

#sun-section {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.sun-card {
  background: #110d0d;
  border: 1px solid #2e1a1a;
  border-radius: 8px;
  padding: 16px 32px;
  text-align: center;
  min-width: 140px;
}

.sun-label {
  font-size: 11px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.sun-emoji {
  font-size: 28px;
  margin-bottom: 8px;
}

.sun-time {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  color: #e8e4d9;
  letter-spacing: 2px;
}

/* tablet */

@media (max-width: 900px) {

  h1 {
    font-size: 24px;
    letter-spacing: 2px;
  }

  #city-input {
    width: 180px;
  }

  .page-wrapper {
    padding: 0 16px;
  }

  #current-conditions {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-value {
    font-size: 26px;
  }

  #hero-temp {
    font-size: 80px;
  }

  .daily-day {
    width: 90px;
  }

  .daily-high, .daily-low {
    font-size: 20px;
  }

  #radar-container {
    height: 380px;
  }

}

@media (max-width: 900px) and (orientation: landscape) {
  header {
    flex-wrap: nowrap;
  }
  
  body {
    min-height: 100vh;
  }

  #weather-bg {
    width: 100vw;
    height: 100vh;
  }

  h1 {
    font-size: 20px;
  }

  #city-input {
    width: 160px;
  }

  #hero-temp {
    font-size: 60px;
  }

  #hero {
    padding: 12px 20px;
  }
}

/* mobile */
@media (max-width: 600px) {

  header {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
  }

  h1 {
    width: 100%;
    text-align: center;
    font-size: 28px;
  }

  #search-wrap {
    order: 1;
    width: 100%;
    justify-content: center;
  }

  #locate-btn {
    order: 2;
    margin-left: 0;
    align-self: 0;
  }

  #unit-toggle {
    order: 2;
    width: 100%;
    justify-content: center;
    border: none;
    outline: none;
  }

  .unit-btn{
    border-bottom: none;
  }

  #city-input {
    width: 180px;
  }

  #current-conditions {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-value {
    font-size: 24px;
  }

  #hero-temp {
    font-size: 72px;
  }

  .hourly-item {
    min-width: 65px;
    padding: 10px 10px;
  }

  .hourly-temp {
    font-size: 18px;
  }

  #radar-container {
    height: 300px;
  }

  .daily-item {
    padding: 12px 10px;
    gap: 8px;
  }

  .daily-day {
    width: 80px;
    font-size: 13px;
  }

  .daily-high, .daily-low {
    font-size: 18px;
  }

  #sun-section {
    gap: 10px;
  }

  .sun-card {
    padding: 12px 20px;
  }
  .page-wrapper{
    width:100%;
    overflow-x: hidden;
    padding: 0 12px;
  
  }

  #hourly-container {
    width: 100%;
  }

  #suggestions {
    left: 0;
    width: 100%;
  }

}
