/* ===== RESET & BASE STYLES ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 0.7rem; /* Base font size for rem calculations */
  scroll-behavior: smooth;
}

/* Responsive font scaling */
@media (max-width: 480px) {
  html {
      font-size: 14px;
  }
}

@media (min-width: 768px) {
  html {
      font-size: 18px;
  }
}

@media (min-width: 1024px) {
  html {
      font-size: 20px;
  }
}

body {
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #d166ea 0%, #ec5252 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 1rem;
}

/* ===== WATCH CONTAINER ===== */
.container {
  background-image: url("./images/watch-6.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  position: relative;
  width: clamp(20rem, 25vw, 25rem);
  height: clamp(25rem, 31.25vw, 31.25rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.container::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ===== WATCH SCREEN - RESPONSIVE DIMENSIONS ===== */
.weather-app-wrapper {
  position: relative;
  z-index: 2;
  width: clamp(10rem, 11.25rem, 12rem);
  height: clamp(12rem, 13.75rem, 15rem);
  padding: 0.7rem;
}

.weather-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: clamp(0rem, 3vw, 0.8rem); /* Bigger gaps on mobile, smaller on desktop */
}

@media (max-width: 768px) {
  .weather-app {
    gap: 2rem;
  }
}

/* ===== SECTION 1: SEARCH INTERFACE ===== */
.search-section {
  flex-shrink: 0;
margin-bottom: 1rem;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 100%;
}

.search-input-group {
  display: flex;
  gap: 0.5rem;
  height: clamp(2.4rem, 4vw, 1.8rem); /* Bigger on mobile, smaller on desktop */
}

@media (min-width: 768px) {
  .search-input-group {
    height: 1.8rem;
  }
}


.search-input {
  flex: 1;
  height: 100%;
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.536);
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(0.3125rem);
  color: #232323;
  font-size: clamp(1.4rem, 3vw, 1rem); /* Bigger on mobile, smaller on desktop */
  font-weight: 500;
  outline: none;
  transition: all 0.3s ease;
}

.search-input::placeholder {
  color: rgb(86, 86, 86);
  font-size: clamp(1.2rem, 2.5vw, 0.7rem); /* Bigger on mobile, smaller on desktop */
}

@media (min-width: 768px) {
  .search-input {
    font-size: 1rem;
  }

  .search-input::placeholder {
    font-size: 0.7rem;
  }
}





.search-input:focus {
  background: rgba(216, 216, 216, 0.274)7)
}

.search-btn {
  width: clamp(2.2rem, 4vw, 1.8rem); /* Bigger on mobile, smaller on desktop */
  height: clamp(2.2rem, 4vw, 1.8rem);
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #d166ea 0%, #ec5252 100%);
  color: #fff;
  font-size: clamp(1rem, 2vw, 0.7rem); /* Bigger icon on mobile */
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;

  box-shadow: 0 0.125rem 0.375rem rgba(238, 90, 36, 0.4);
}

@media (min-width: 768px) {
  .search-btn {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.7rem;
  }}

.search-btn:active {
  transform: scale(0.95);
}

.location-btn {
  width: clamp(2.2rem, 4vw, 1.8rem); /* Bigger on mobile, smaller on desktop */
  height: clamp(2.2rem, 4vw, 1.8rem);
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #d166ea 0%, #ec5252 100%);
  color: #fff;
  font-size: clamp(1rem, 2vw, 0.7rem); /* Bigger icon on mobile */
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem;
  box-shadow: 0 0.0625rem 0.1875rem rgba(72, 52, 212, 0.4);
}

@media (min-width: 768px) {
  .location-btn {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.7rem;
  }
}

.location-btn:active {
  transform: scale(0.95);
}

.location-btn i {
  font-size: clamp(1rem, 2vw, 0.7rem); /* Bigger on mobile, smaller on desktop */
}

@media (min-width: 768px) {
  .location-btn i {
    font-size: 0.7rem;
  }
}


.location-btn span {
  font-size: 0.7rem; /* 4px equivalent */
}

/* ===== SECTION 2: CURRENT WEATHER ===== */
.current-weather-section {
  flex-shrink: 0;
  height: 6.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.location-info {
  margin-bottom: 0.25rem;
}

.city-name {
  font-family: "Rubik", sans-serif;
  font-size: clamp(2.2rem, 4vw, 1.4rem); /* Bigger on mobile, smaller on desktop */  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.125rem;
  text-transform: uppercase;
  letter-spacing: 0.01875rem;
  text-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.5);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 15rem;
}

@media (min-width: 768px) {
  .city-name {
    font-size: 1.4rem;
  }
}


.weather-description {
  font-size: clamp(1.2rem, 2.5vw, 0.9rem); /* Bigger on mobile, smaller on desktop */  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  text-transform: capitalize;
  text-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.3);
  margin: 0;
}

@media (min-width: 768px) {
  .weather-description {
    font-size: 0.9rem;
  }}

.temperature-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
}

.weather-icon {
  width: 3rem;
  height: 3rem;
  filter: drop-shadow(0 0.125rem 0.375rem rgba(0, 0, 0, 0.3));
}

.temperature-info {
  display: flex;
  align-items: baseline;
  gap: 0.0625rem;
}

.temperature-value {
  font-family: "Rubik", sans-serif;
  font-size: clamp(5.5rem, 8vw, 4rem); /* Bigger on mobile, smaller on desktop */
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.4);
  color: #fff;
}

@media (min-width: 768px) {
  .temperature-value {
    font-size: 4rem;
  }
}

.temperature-unit {
  font-size: 1.4rem; /* 8px equivalent */
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);

}

/* ===== SECTION 3: WEATHER DETAILS ===== */
.weather-details-section {
  flex-shrink: 0;
  height: clamp(3rem, 4vw, 1.5rem); /* Bigger on mobile, smaller on desktop */
}

@media (min-width: 768px) {
  .weather-details-section {
    height: 1.5rem;
  }
}


.details-grid {
  display: flex;
  gap: 0.375rem;
  height: 100%;
}

.detail-card {
  flex: 1;
  border-radius: 0.25rem;
  padding: 0.1875rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.detail-icon {
  font-size: clamp(1.2rem, 2vw, 0.8rem); /* Bigger on mobile, smaller on desktop */  color: rgba(255, 255, 255, 0.7);
  width: 0.5rem;
  text-align: center;
}

@media (min-width: 768px) {
  .detail-icon {
    font-size: 0.8rem;
  }}

.detail-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.detail-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(1rem, 2vw, 0.8rem); /* Bigger on mobile, smaller on desktop */  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.0125rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .detail-label {
    font-size: 0.8rem;
  }}

.detail-value {
  color: #fff;
  font-size: clamp(1.1rem, 2.2vw, 0.7rem); /* Bigger on mobile, smaller on desktop */  font-weight: 700;
  text-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.5);
  line-height: 1;
}

@media (min-width: 768px) {
  .detail-value {
    font-size: 0.7rem;
  }
}

/* ===== SECTION 4: 3-DAY FORECAST (3 COLUMNS) ===== */
.forecast-section {

  display: flex;
  flex-direction: column;
}

.forecast-title {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.7rem; /* 6px equivalent */
  font-weight: 600;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 0.25rem;
  letter-spacing: 0.01875rem;
  text-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.5);
}

.weather-forecast {

  backdrop-filter: blur(0.3125rem);
  display: flex;
  flex-direction: row;
  gap: 0.3rem;
  overflow: hidden;
  justify-content: space-between;
}

/* Loading state for forecast */
.forecast-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.7rem; /* 5px equivalent */
  gap: 0.25rem;
}

.loading-spinner {
  width: 0.75rem;
  height: 0.75rem;
  border: 0.0625rem solid rgba(255, 255, 255, 0.2);
  border-top: 0.0625rem solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Individual forecast items */
.forecast-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.1875rem;
  border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  text-align: center;
}

.forecast-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(0.125rem);
}

.forecast-item:active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.98);
}

.forecast-day-info {

  align-items: center;
  gap: 0.3rem;
  flex: 1;
  min-width: 0;
  margin-bottom: 0.2rem;
}

.forecast-day {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 2vw, 0.8rem); /* Bigger on mobile, smaller on desktop */
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1;
  text-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.5);
  margin-bottom: 0.3rem;
}

.forecast-icon {
  width: clamp(2rem, 4vw, 1.3rem); /* Bigger on mobile, smaller on desktop */
  height: clamp(2rem, 4vw, 1.3rem);
  filter: drop-shadow(0 0.07rem 0.125rem rgba(0, 0, 0, 0.4));
  flex-shrink: 0;
  margin: 0.2rem 0;
}

.forecast-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(0.9rem, 1.8vw, 0.65rem); /* Bigger on mobile, smaller on desktop */
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
  margin-bottom: 0.3rem;
}

.forecast-temps {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 28px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.forecast-temp-max {
  color: #fff;
  font-weight: 700;
  font-size: clamp(1rem, 2vw, 0.7rem); /* Bigger on mobile, smaller on desktop */
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.forecast-temp-min {
  color: rgba(255, 255, 255, 0.6);
  font-size: clamp(1rem, 2vw, 0.7rem); /* Bigger on mobile, smaller on desktop */
  line-height: 1;
  font-weight: 500;
}

@media (min-width: 768px) {
  .forecast-day {
    font-size: 0.8rem;
  }

  .forecast-icon {
    width: 1.3rem;
    height: 1.3rem;
  }

  .forecast-description {
    font-size: 0.65rem;
  }

  .forecast-temp-max,
  .forecast-temp-min {
    font-size: 0.7rem;
  }
}

/* ===== SECTION 5: META INFORMATION ===== */
.meta-section {
  flex-shrink: 0;

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

.last-updated {
  display: flex;
  align-items: center;
  gap: 2px;
  color: rgba(255, 255, 255, 0.5);
  font-size: clamp(0.9rem, 1.8vw, 0.7rem); /* Bigger on mobile, smaller on desktop */
  font-weight: 400;
  text-align: center;
}

.last-updated i {
  font-size: clamp(0.8rem, 1.6vw, 0.5rem); /* Bigger on mobile, smaller on desktop */
}

@media (min-width: 768px) {
  .last-updated {
    font-size: 0.7rem;
  }

  .last-updated i {
    font-size: 0.5rem;
  }
}


/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 250px) {
  .container {
      width: 250px;
      height: 320px;
  }

  .weather-app-wrapper {
      width: 350px;
      height: 450px;
  }
}

@media (min-width: 350px) {
  .container {
      width: 450px;
      height: 800px;
  }

  .weather-app-wrapper {
      width: 350px;
      height: 430px;
  }
}

/* ===== TOUCH INTERACTIONS FOR SMARTWATCH ===== */
@media (hover: none) and (pointer: coarse) {
  .search-btn:active,
  .location-btn:active,
  .forecast-item:active {
      transform: scale(0.9);
  }

  .forecast-item:hover {
      transform: none;
      background: rgba(255, 255, 255, 0.05);
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.search-input:focus,
.search-btn:focus,
.location-btn:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 1px;
}

/* ===== ANIMATION ENHANCEMENTS ===== */
.forecast-item {
  animation: slideIn 0.3s ease-out;
}

.forecast-item:nth-child(1) { animation-delay: 0.1s; }
.forecast-item:nth-child(2) { animation-delay: 0.2s; }
.forecast-item:nth-child(3) { animation-delay: 0.3s; }
.forecast-item:nth-child(4) { animation-delay: 0.4s; }
.forecast-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideIn {
  from {
      opacity: 0;
      transform: translateX(-10px);
  }
  to {
      opacity: 1;
      transform: translateX(0);
  }
}

/* ===== ERROR STATES ===== */
.forecast-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.6);
  font-size: 5px;
  text-align: center;
  padding: 4px;
}

.forecast-error i {
  font-size: 0.7rem;
  margin-bottom: 2px;
  color: rgba(255, 107, 107, 0.8);
}

/* ===== SCROLLBAR STYLING ===== */
.weather-forecast::-webkit-scrollbar {
  width: 2px;
}

.weather-forecast::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
}

.weather-forecast::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 1px;
}

.weather-forecast::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}
