/* =========================
   RESET + BASE
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  overflow-x: hidden;
}

/* =========================
   APP CONTAINER
========================= */
.weather-app {
  width: auto;
  padding: 24px;
  border-radius: 20px;
  backdrop-filter: blur(15px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.8s ease;

}

/* =========================
   HEADER
========================= */
.weather-app h1 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.8rem;
  letter-spacing: 1px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

/* =========================
   FORM
========================= */
form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

#city-input {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: none;
  outline: none;
  font-size: 14px;
  transition: all 0.3s ease;
}

#city-input:focus {
  transform: scale(1.03);
}

button {
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: #ffffff;
  color: #333;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

button:hover {
  transform: translateY(-2px);
  background: #f0f0f0;
}

/* =========================
   LOADING STATE
========================= */
#loading {
  text-align: center;
  font-size: 14px;
  margin-bottom: 15px;
  animation: pulse 1.2s infinite;
}

/* =========================
   ERROR STATE
========================= */
.error {
  background: rgba(255, 0, 0, 0.15);
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 15px;
  animation: shake 0.4s ease;
}

/* =========================
   WEATHER DISPLAY
========================= */
.weather-main {
  text-align: center;
  margin-bottom: 20px;
  animation: slideUp 0.5s ease;
}

#weather-icon {
  width: 80px;
  height: 80px;
  animation: float 3s ease-in-out infinite;
}

#temperature {
  font-size: 2.2rem;
  font-weight: bold;
}

#description {
  text-transform: capitalize;
  opacity: 0.9;
}

/* =========================
   DETAILS GRID
========================= */
.weather-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.detail {
  background: rgba(255, 255, 255, 0.12);
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.3s ease;
}

.detail:hover {
  transform: translateY(-4px);
}

/* =========================
   SEARCH HISTORY
========================= */
#recent-searches {
  margin-top: 20px;
}

#recent-searches h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

#search-history {
  list-style: none;
}

#search-history li {
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
}

#search-history li:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(5px);
}

/* =========================
   UTILITIES
========================= */
.hidden {
  display: none;
}

/* =========================
   ANIMATIONS
========================= */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-6px);
  }
  100% {
    transform: translateY(0px);
  }
}

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

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 480px) {
  .weather-app {
    margin: 10px;
    padding: 16px;
  }

  #temperature {
    font-size: 1.8rem;
  }
}
/* =========================
   WEATHER EFFECTS LAYER
========================= */
#weather-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* =========================
   RAIN
========================= */
.rain-drop {
  position: absolute;
  width: 2px;
  height: 15px;
  background: rgba(255, 255, 255, 0.5);
  animation: rainFall linear infinite;
}

@keyframes rainFall {
  from {
    transform: translateY(-100px);
  }
  to {
    transform: translateY(100vh);
  }
}

/* =========================
   SNOW
========================= */
.snowflake {
  position: absolute;
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
  animation: snowFall linear infinite;
}

@keyframes snowFall {
  0% {
    transform: translateY(-50px) translateX(0);
  }
  50% {
    transform: translateY(50vh) translateX(20px);
  }
  100% {
    transform: translateY(100vh) translateX(-20px);
  }
}
.cloud {
  position: absolute;
  width: 200px;
  height: 60px;
  background: rgba(255,255,255,0.2);
  border-radius: 50px;
  animation: floatCloud 20s linear infinite;
}

@keyframes floatCloud {
  from { transform: translateX(-200px); }
  to { transform: translateX(100vw); }
}
.city-silhouette {
  position: fixed;
  bottom: 0;
  width: 100%;
  opacity: 0.2;
  pointer-events: none;
}
.forecast-grid {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.forecast-card {
    margin-top: 20px;
    padding: 15px;
    border-radius: 15px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
}

/* 5-day layout */
.five-day {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.day-card {
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
}

/* 3-hour scrollable row */
.three-hour {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.hour-card {
    min-width: 90px;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
}
 /* Tablet */
  @media (min-width: 768px) {
  .row {
    grid-template-columns: 1fr 1fr;
  }

  .projects-grid,
  .grid,
  .skills-grid,
  .gallery,
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .contact-layout {
    grid-template-columns: 2fr 1fr;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .projects-grid,
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .magazine-layout {
    grid-template-columns: 250px 1fr;
    grid-template-areas:
      "header header"
      "sidebar main"
      "footer footer";
  }

  .mag-header { grid-area: header; }
  .mag-sidebar { grid-area: sidebar; }
  .mag-main { grid-area: main; }
  .mag-footer { grid-area: footer; }
}

/* Large Desktop */
@media (min-width: 1280px) {
  .container {
    width: min(1200px, 92%);
  }
}

/* Smaller screens only */
@media (max-width: 700px) {
  nav {
    flex-direction: column;
    align-items: flex-start;
  }

  nav ul {
    flex-direction: column;
    align-items: flex-start;
  }
}
section {
  margin-bottom: 40px;
}
.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
form {
  background: var(--color-surface);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 20px;
}

legend {
  font-weight: 600;
  padding: 0 8px;
}