:root {
  --bg-color: #f0f2f5;
  --card-bg: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --accent-warm: #ff5e3a; /* 더울 때 */
  --accent-cool: #007aff; /* 추울 때 */
  --accent-same: #34c759; /* 같을 때 */
  --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.container {
  background-color: var(--card-bg);
  width: 100%;
  max-width: 400px;
  border-radius: 24px;
  padding: 40px 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  text-align: center;
  transition: transform 0.2s ease;
}

header h1 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.diff-card {
  margin-bottom: 40px;
}

.diff-value {
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -2px;
}

.diff-text {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* 상태별 색상 클래스 */
.warmer .diff-value, .warmer .diff-text { color: var(--accent-warm); }
.cooler .diff-value, .cooler .diff-text { color: var(--accent-cool); }
.same .diff-value, .same .diff-text { color: var(--accent-same); }

.details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f5f5f7;
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 30px;
}

.weather-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.temp {
  font-size: 1.5rem;
  font-weight: 600;
}

.divider {
  width: 1px;
  height: 40px;
  background-color: #d2d2d7;
  margin: 0 20px;
}

.location-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

button {
  background-color: var(--text-primary);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

button:hover {
  opacity: 0.8;
}

/* Skeleton Loading Animation */
.skeleton .diff-value, .skeleton .diff-text, .skeleton .temp, .skeleton .more-details, .skeleton .weekly-forecast {
  color: transparent;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.more-details {
  display: flex;
  justify-content: space-around;
  padding: 20px;
  border-radius: 16px;
  background-color: #f5f5f7;
  margin-bottom: 30px;
}

.detail-item {
  text-align: center;
}

.weekly-forecast {
  margin-bottom: 30px;
}

.weekly-forecast h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: left;
}

.forecast-container {
  display: flex;
  overflow-x: auto;
  padding-bottom: 10px;
}

.forecast-item {
  flex: 0 0 80px;
  text-align: center;
  margin-right: 10px;
  padding: 10px;
  border-radius: 12px;
  background-color: #f5f5f7;
}

.forecast-item .day {
  font-weight: 600;
  margin-bottom: 5px;
}

.forecast-item .icon {
  width: 40px;
  height: 40px;
  margin: 5px 0;
}

.forecast-item .temp-range {
  font-size: 0.9rem;
}

footer {
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.modal {
    display: none; 
    position: fixed; 
    z-index: 1; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.4); 
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; 
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 12px;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

@media (max-width: 480px) {
  .container {
    padding: 20px 15px;
  }

  header h1 {
    font-size: 1rem;
    margin-bottom: 15px;
  }

  .diff-card {
    margin-bottom: 20px;
  }

  .diff-value {
    font-size: 4rem;
  }

  .diff-text {
    font-size: 1.2rem;
  }

  .details {
    padding: 15px;
    margin-bottom: 20px;
  }

  .temp {
    font-size: 1.2rem;
  }

  .more-details {
    padding: 15px;
    margin-bottom: 20px;
  }

  .weekly-forecast h2 {
    font-size: 1rem;
    margin-bottom: 15px;
  }

  .forecast-item {
    flex-basis: 70px;
    padding: 8px;
    margin-right: 8px;
  }

  button {
    padding: 12px 24px;
    font-size: 0.9rem;
  }
}