/* =====================
   1. RESET & BASE
===================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}
html {
  min-height: 100%;
}

body {
 
  
 min-height: 100vh;
  margin: 0;

  background:
    linear-gradient(
      rgba(255, 255, 255, 0.45),
      rgba(255, 255, 255, 0.55)
    ),
    url("assets/back_img.jpg");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* =====================
   WEATHER BACKGROUNDS
===================== */
/* 
body.sunny {
  background-image:
    linear-gradient(rgba(255,255,255,0.45), rgba(255,255,255,0.55)),
    url("assets/snowy.jpg");
}

body.cloudy {
  background-image:
    linear-gradient(rgba(255,255,255,0.45), rgba(255,255,255,0.55)),
    url("assets/cloudy.jpg");
}

body.rainy {
  background-image:
    linear-gradient(rgba(255,255,255,0.45), rgba(255,255,255,0.55)),
    url("assets/rainy.jpg");
}

body.snowy {
  background-image:
    linear-gradient(rgba(255,255,255,0.45), rgba(255,255,255,0.55)),
    url("assets/sunny.jpg");
} */

/* =====================
   DARK MODE OVERRIDES
===================== */

body.dark {
  background-image: none !important;
  background-color: #272525 !important;
  color: #f5f5f5;
}

body.dark nav {
  background: #1e1e1e;
}

body.dark .weather-card,
body.dark .day {
  background: #1e1e1e;
  color: #f5f5f5;
}

body.dark .hour {
  background: #1e1e1e;
  color: #f5f5f5;
}

body.dark .details p {
  background: #2a2a2a;
}

/* =====================
   SMOOTH THEME TRANSITION
===================== */

body,
nav,
.weather-card,
.day,
.hour,
.details p {
  transition: 
    background-color 0.2s ease,
    color 0.2s ease,
    background-image 0.2s ease;
}









/* =====================
   2. NAVBAR
===================== */


/* =====================
   CLEAN NAVBAR (FINAL)
===================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;

  height: 60px;
  padding: 0 32px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background-color: #2196f3; /* 🔥 FIXES LIGHT MODE */
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Left & Right containers */
.nav-left,
.nav-right {
  display: flex;
  align-items: center;
}

/* Logo */
.logo {
  font-size: 1.3rem;
  font-weight: 600;
  color: white;
}

/* Theme toggle */
.theme-btn {
  height: 36px;
  width: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;

  background: white;
  color: #2196f3;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dark mode navbar */
body.dark .navbar {
  background-color: #1e1e1e;
}

/* search section */


.search-section {
  margin: 30px auto 10px;
  text-align: center;
}

#cityTitle {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.search-box {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.search-box input {
  padding: 10px 14px;
  border-radius: 20px;
  border: none;
  outline: none;
  width: 220px;
}

.search-box button {
  padding: 10px 18px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  background: #2196f3;
  color: white;
}





/* =====================
   3. CURRENT WEATHER
===================== */

#current {
  padding: 25px;
  text-align: center;
}

#cityName {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

#temperature {
  font-size: 1.4rem;
  margin: 8px 0;
}

#rainChance {
  font-size: 1rem;
  color: #555;
}

/* =====================
   4. FORECAST SECTION
===================== */

#forecast {
  display: flex;
  gap: 12px;
  padding: 20px;
  overflow-x: auto;
}

.day {
  background: white;
  padding: 12px;
  border-radius: 8px;
  min-width: 130px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.day p {
  margin: 6px 0;
}

/* =====================
   4.5. HOURLY SECTION
===================== */

#hourly {
  padding: 20px;
  text-align: center;
}

#hourly h3 {
  margin-bottom: 10px;
}

#hourlyContainer {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
}

.hour {
  background: white;
  padding: 10px;
  border-radius: 8px;
  min-width: 80px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  font-size: 0.9rem;
}

.hour p {
  margin: 4px 0;
}

.weather-card {
  background: white;
  margin: 25px auto;
  padding: 25px;
  max-width: 400px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.main-weather {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 15px 0;
}

.icon {
  font-size: 3rem;
}

.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 0.95rem;
  margin-top: 15px;
}

.details p {
  background: #f2f4f8;
  padding: 8px;
  border-radius: 6px;
}

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



/* =====================
   5. TABLET (>= 600px)
===================== */

@media (min-width: 600px) {
  nav {
    flex-wrap: nowrap;
  }

  #forecast {
    justify-content: center;
    overflow-x: visible;
    flex-wrap: wrap;
  }
}

/* =====================
   6. DESKTOP (>= 900px)    
===================== */
@media (min-width: 900px) {
  .details {
    grid-template-columns: 1fr 1fr 1fr;
  }
}




  @media (max-width: 768px) {

  .menu-btn {
    display: block;
  }

  .nav-controls {
    position: absolute;
    top: 60px;
    right: 50%;
    transform: translateX(50%);

    width: 90%;
    max-width: 360px;   /* 🔥 KEY LINE */

    background: #2196f3;
    flex-direction: column;
    align-items: stretch;

    display: none;
    padding: 12px;
    border-radius: 10px;

    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  }

  .nav-controls.active {
    display: flex;
  }
  .nav-controls input,
  .nav-controls button {
    width: 75%;
    font-size: 1rem;        /* prevents scaling */
    padding: 10px;
    margin: 8px auto;
  }
}







