/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(135deg, #74b9ff 0%, #a29bfe 50%, #fd79a8 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 30px 16px 60px;
}

/* ===== Main container ===== */
.app-wrapper {
  width: 100%;
  max-width: 600px;
}

/* ===== Header ===== */
.app-header {
  text-align: center;
  margin-bottom: 28px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.logo-icon {
  font-size: 2.2rem;
}

.logo h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.subtitle {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
  margin-top: 6px;
}

/* ===== Search section card ===== */
.search-section {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  margin-bottom: 20px;
}

/* ===== Input group ===== */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #636e72;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group select,
.input-group input {
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: 'Nunito', sans-serif;
  color: #2d3436;
  background: #f9f9f9;
  outline: none;
  transition: border-color 0.25s, background 0.25s;
}

.input-group select:focus,
.input-group input:focus {
  border-color: #74b9ff;
  background: #fff;
}

.input-group select:hover,
.input-group input:hover {
  border-color: #b2bec3;
}

select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Dropdown row (country + city side by side) ===== */
.dropdown-row {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

/* ===== OR divider ===== */
.or-divider {
  text-align: center;
  margin: 4px 0 18px;
  position: relative;
}

.or-divider::before,
.or-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: #e0e0e0;
}

.or-divider::before { left: 0; }
.or-divider::after  { right: 0; }

.or-divider span {
  font-size: 0.82rem;
  color: #b2bec3;
  font-weight: 600;
  background: #fff;
  padding: 0 10px;
}

/* ===== Search row ===== */
.search-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.search-input-group {
  flex: 1;
}

/* ===== Search button ===== */
.search-btn {
  padding: 12px 22px;
  background: linear-gradient(135deg, #74b9ff, #a29bfe);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(116, 185, 255, 0.4);
}

.search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(116, 185, 255, 0.5);
}

.search-btn:active {
  transform: translateY(0);
  opacity: 0.9;
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 24px;
  color: #fff;
  font-weight: 600;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Error message ===== */
.error-msg {
  background: #fff5f5;
  border: 2px solid #fab1a0;
  border-radius: 14px;
  padding: 14px 18px;
  color: #d63031;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== Weather Card ===== */
.weather-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.city-info h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #2d3436;
}

.city-info p {
  font-size: 0.95rem;
  color: #636e72;
  margin-top: 2px;
}

#weatherIcon {
  width: 72px;
  height: 72px;
}

/* ===== Temperature ===== */
.temp-section {
  display: flex;
  align-items: flex-start;
  margin-bottom: 4px;
}

.big-temp {
  font-size: 3.8rem;
  font-weight: 800;
  color: #2d3436;
  line-height: 1;
}

.degree {
  font-size: 1.8rem;
  font-weight: 700;
  color: #636e72;
  margin-top: 8px;
}

.weather-desc {
  color: #636e72;
  font-size: 1rem;
  font-weight: 600;
  text-transform: capitalize;
  margin-bottom: 24px;
}

/* ===== Details grid ===== */
.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.detail-item {
  background: #f4f6fc;
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: transform 0.2s;
}

.detail-item:hover {
  transform: translateY(-3px);
}

.detail-icon {
  font-size: 1.3rem;
}

.detail-label {
  font-size: 0.72rem;
  color: #b2bec3;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.detail-value {
  font-size: 1rem;
  font-weight: 800;
  color: #2d3436;
}

/* ===== Footer ===== */
.app-footer {
  text-align: center;
  margin-top: 24px;
  color: rgba(255,255,255,0.75);
  font-size: 0.82rem;
}

.app-footer a {
  color: #fff;
  text-decoration: underline;
}

/* ===== Utility ===== */
.hidden {
  display: none !important;
}

/* ===== Responsive (mobile) ===== */
@media (max-width: 480px) {
  .dropdown-row {
    flex-direction: column;
  }

  .search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-btn {
    width: 100%;
    padding: 13px;
  }

  .logo h1 {
    font-size: 1.7rem;
  }

  .big-temp {
    font-size: 3rem;
  }

  .details-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}