/* =========================================
   GLOBAL RESET
========================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


/* =========================================
   VARIABLES
========================================= */

:root {

  --primary: #2563eb;

  --secondary: #38bdf8;

  --text: #0f172a;

  --muted: #64748b;

  --white: #ffffff;

  --border: rgba(255, 255, 255, 0.65);

}


/* =========================================
   BODY
========================================= */

body {

  font-family: "Inter", sans-serif;

  min-height: 100vh;

  background:

    radial-gradient(
      circle at 10% 20%,
      rgba(56, 189, 248, 0.35),
      transparent 30%
    ),

    radial-gradient(
      circle at 90% 10%,
      rgba(37, 99, 235, 0.30),
      transparent 30%
    ),

    linear-gradient(
      135deg,
      #e0f2fe,
      #dbeafe,
      #eef2ff
    );

  color: var(--text);

}


/* =========================================
   APP
========================================= */

.app {

  width: min(1100px, 92%);

  margin: auto;

  padding: 35px 0;

}


/* =========================================
   HEADER
========================================= */

.header {

  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 35px;

}


.brand {

  display: flex;

  align-items: center;

  gap: 14px;

}


.brand-icon {

  width: 55px;

  height: 55px;

  display: flex;

  justify-content: center;

  align-items: center;

  background:
    rgba(255, 255, 255, 0.70);

  border:
    1px solid var(--border);

  border-radius: 17px;

  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.08);

  overflow: hidden;

}


.brand-icon img {

  width: 43px;

  height: 43px;

  object-fit: contain;

}


.brand h1 {

  font-size: 27px;

  font-weight: 800;

  letter-spacing: -1px;

}


.brand p {

  color: var(--muted);

  font-size: 13px;

  margin-top: 3px;

}


/* =========================================
   LIVE STATUS
========================================= */

.live-status {

  display: flex;

  align-items: center;

  gap: 8px;

  padding: 8px 14px;

  background:
    rgba(255, 255, 255, 0.65);

  border-radius: 30px;

  font-size: 13px;

  font-weight: 600;

}


.live-status span {

  width: 8px;

  height: 8px;

  background: #22c55e;

  border-radius: 50%;

  box-shadow:
    0 0 0 4px rgba(34, 197, 94, 0.15);

}


/* =========================================
   SEARCH
========================================= */

.search-section {

  margin-bottom: 28px;

}


.search-box {

  display: flex;

  align-items: center;

  max-width: 700px;

  margin: auto;

  padding: 7px;

  background:
    rgba(255, 255, 255, 0.78);

  border:
    1px solid rgba(255, 255, 255, 0.85);

  border-radius: 18px;

  box-shadow:
    0 15px 40px rgba(15, 23, 42, 0.08);

  backdrop-filter: blur(15px);

}


.search-icon {

  font-size: 20px;

  margin-left: 14px;

  opacity: 0.65;

}


.search-box input {

  flex: 1;

  border: none;

  outline: none;

  background: transparent;

  padding: 15px;

  font-size: 15px;

  color: var(--text);

}


.search-box input::placeholder {

  color: #94a3b8;

}


.search-box button {

  border: none;

  padding: 13px 23px;

  border-radius: 13px;

  background:
    linear-gradient(
      135deg,
      #2563eb,
      #0ea5e9
    );

  color: white;

  font-weight: 700;

  cursor: pointer;

  transition: 0.25s;

  box-shadow:
    0 7px 18px rgba(37, 99, 235, 0.25);

}


.search-box button:hover {

  transform: translateY(-2px);

  box-shadow:
    0 10px 25px rgba(37, 99, 235, 0.35);

}


.search-box button:disabled {

  cursor: not-allowed;

  opacity: 0.7;

  transform: none;

}


.search-hint {

  text-align: center;

  color: #64748b;

  font-size: 12px;

  margin-top: 10px;

}


/* =========================================
   DASHBOARD
========================================= */

.weather-dashboard {

  display: grid;

  grid-template-columns: 1.3fr 1fr;

  gap: 20px;

}


/* =========================================
   COMMON CARD
========================================= */

.main-weather-card,
.details-card,
.aqi-card {

  border:
    1px solid rgba(255, 255, 255, 0.85);

  border-radius: 25px;

  box-shadow:
    0 20px 50px rgba(15, 23, 42, 0.08);

  backdrop-filter: blur(18px);

  overflow: hidden;

}


/* =========================================
   MAIN WEATHER CARD
========================================= */

.main-weather-card {

  padding: 30px;

  background:

    linear-gradient(
      135deg,
      rgba(37, 99, 235, 0.94),
      rgba(14, 165, 233, 0.90)
    );

  color: white;

}


/* =========================================
   LOCATION
========================================= */

.location {

  display: flex;

  gap: 12px;

  align-items: center;

}


.location > span {

  font-size: 23px;

}


.location h2 {

  font-size: 21px;

}


.location p {

  font-size: 12px;

  opacity: 0.75;

  margin-top: 4px;

}


/* =========================================
   MAIN WEATHER
========================================= */

.weather-main {

  display: flex;

  align-items: center;

  gap: 20px;

  margin: 35px 0;

}


.weather-icon-container {

  width: 130px;

  height: 130px;

  display: flex;

  justify-content: center;

  align-items: center;

  background:
    rgba(255, 255, 255, 0.16);

  border-radius: 35px;

}


.weather-icon {

  font-size: 82px;

  line-height: 1;

  filter:
    drop-shadow(
      0 8px 12px rgba(0, 0, 0, 0.12)
    );

  animation:
    weatherFloat 3s ease-in-out infinite;

}


@keyframes weatherFloat {

  0%,
  100% {

    transform: translateY(0);

  }

  50% {

    transform: translateY(-6px);

  }

}


/* =========================================
   TEMPERATURE
========================================= */

.temperature {

  font-size: 68px;

  font-weight: 800;

  line-height: 1;

  letter-spacing: -4px;

}


.temperature sup {

  font-size: 30px;

  vertical-align: top;

  margin-left: 3px;

  letter-spacing: 0;

}


#condition {

  font-size: 17px;

  font-weight: 600;

  margin-top: 8px;

}


.feels {

  font-size: 13px;

  margin-top: 7px;

  opacity: 0.75;

}


/* =========================================
   WEATHER FOOTER
========================================= */

.weather-footer {

  display: grid;

  grid-template-columns:
    repeat(3, 1fr);

  gap: 10px;

  border-top:
    1px solid rgba(255, 255, 255, 0.2);

  padding-top: 20px;

}


.weather-footer div {

  text-align: center;

}


.weather-footer span {

  font-size: 18px;

}


.weather-footer p {

  font-size: 11px;

  opacity: 0.7;

  margin: 5px 0;

}


.weather-footer strong {

  font-size: 14px;

}


/* =========================================
   DETAILS CARD
========================================= */

.details-card {

  padding: 25px;

  background:
    rgba(255, 255, 255, 0.72);

}


.card-heading {

  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 22px;

}


.card-heading h3 {

  font-size: 18px;

}


.card-heading p {

  color: var(--muted);

  font-size: 12px;

  margin-top: 4px;

}


.card-heading > span {

  font-size: 24px;

  width: 45px;

  height: 45px;

  display: flex;

  justify-content: center;

  align-items: center;

  background: #eff6ff;

  border-radius: 14px;

}


/* =========================================
   DETAILS GRID
========================================= */

.details-grid {

  display: grid;

  grid-template-columns:
    repeat(2, 1fr);

  gap: 12px;

}


.detail {

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 14px;

  border-radius: 15px;

  background: #f8fafc;

  border:
    1px solid #f1f5f9;

  transition: 0.2s;

}


.detail:hover {

  transform: translateY(-2px);

  background: #eff6ff;

}


.detail-icon {

  width: 38px;

  height: 38px;

  display: flex;

  justify-content: center;

  align-items: center;

  background: white;

  border-radius: 11px;

  font-size: 17px;

}


.detail p {

  color: var(--muted);

  font-size: 11px;

}


.detail h4 {

  margin-top: 4px;

  font-size: 14px;

}


/* =========================================
   AQI CARD
========================================= */

.aqi-card {

  grid-column: 1 / -1;

  padding: 25px;

  background:
    rgba(255, 255, 255, 0.72);

}


.aqi-content {

  display: flex;

  align-items: center;

  gap: 25px;

}


.aqi-circle {

  width: 95px;

  height: 95px;

  flex-shrink: 0;

  border-radius: 50%;

  display: flex;

  flex-direction: column;

  justify-content: center;

  align-items: center;

  background:

    linear-gradient(
      135deg,
      #dcfce7,
      #bbf7d0
    );

  border:
    6px solid white;

  box-shadow:
    0 8px 25px rgba(34, 197, 94, 0.15);

}


.aqi-circle strong {

  font-size: 25px;

}


.aqi-circle span {

  font-size: 10px;

  color: #64748b;

}


.aqi-info h4 {

  font-size: 18px;

  margin-bottom: 5px;

}


.aqi-info p {

  font-size: 12px;

  color: var(--muted);

  line-height: 1.6;

}


/* =========================================
   LOADING
========================================= */

.loading {

  display: none;

  text-align: center;

  margin: 30px 0;

  color: #475569;

}


.spinner {

  width: 35px;

  height: 35px;

  border:
    4px solid #dbeafe;

  border-top-color:
    #2563eb;

  border-radius: 50%;

  animation:
    spin 0.8s linear infinite;

  margin:
    auto auto 10px;

}


@keyframes spin {

  to {

    transform: rotate(360deg);

  }

}


/* =========================================
   ERROR
========================================= */

.error-box {

  display: none;

  max-width: 600px;

  margin: 0 auto 20px;

  padding: 13px 18px;

  background: #fef2f2;

  color: #dc2626;

  border:
    1px solid #fecaca;

  border-radius: 12px;

  text-align: center;

  font-size: 13px;

  font-weight: 500;

}


/* =========================================
   FOOTER
========================================= */

footer {

  text-align: center;

  margin-top: 28px;

  color: #64748b;

  font-size: 11px;

  line-height: 1.8;

}


.developer-name {

  color: #0f172a;

  font-weight: 700;

}


/* =========================================
   TABLET
========================================= */

@media (max-width: 800px) {

  .weather-dashboard {

    grid-template-columns: 1fr;

  }


  .aqi-card {

    grid-column: auto;

  }

}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 550px) {

  .app {

    width: 94%;

    padding: 20px 0;

  }


  .header {

    margin-bottom: 25px;

  }


  .brand h1 {

    font-size: 22px;

  }


  .brand-icon {

    width: 48px;

    height: 48px;

  }


  .brand-icon img {

    width: 38px;

    height: 38px;

  }


  .live-status {

    display: none;

  }


  .search-box {

    border-radius: 15px;

  }


  .search-box button {

    padding: 12px 15px;

  }


  .search-box input {

    min-width: 0;

  }


  .weather-main {

    flex-direction: column;

    text-align: center;

  }


  .weather-icon-container {

    width: 110px;

    height: 110px;

  }


  .weather-icon {

    font-size: 65px;

  }


  .temperature {

    font-size: 58px;

  }


  .weather-footer {

    gap: 5px;

  }


  .details-grid {

    grid-template-columns: 1fr;

  }


  .aqi-content {

    gap: 18px;

  }

}