/* ==========================================================================
   Korea Weather App - Stylesheet (Vanilla CSS)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root {
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-highlight: rgba(56, 189, 248, 0.5);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-blue: #38bdf8;
  --accent-cyan: #22d3ee;
  --accent-gold: #fbbf24;
  --accent-purple: #c084fc;
  --accent-rose: #fb7185;
  --accent-hwacheon: #10b981; /* Emerald green highlight for Hwacheon */
  
  --glass-bg: rgba(15, 23, 42, 0.75);
  --glass-border: rgba(255, 255, 255, 0.12);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.2);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', 'Noto Sans KR', sans-serif;
}

body {
  background: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 70%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  padding-bottom: 60px;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Lighting Effect */
.bg-ambient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-blob-1 {
  position: absolute;
  top: -10%;
  left: 20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  border-radius: 50%;
  filter: blur(60px);
  animation: floatBlob 18s ease-in-out infinite alternate;
}

.bg-blob-2 {
  position: absolute;
  top: 40%;
  right: 10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  border-radius: 50%;
  filter: blur(80px);
  animation: floatBlob 22s ease-in-out infinite alternate-reverse;
}

@keyframes floatBlob {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 80px) scale(1.1); }
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Header Section */
header {
  padding: 32px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 28px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 8px 16px rgba(56, 189, 248, 0.3);
}

.logo-title h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-title p {
  font-size: 13px;
  color: var(--text-secondary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.time-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.unit-toggle {
  display: flex;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
}

.unit-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.unit-btn.active {
  background: var(--accent-blue);
  color: #0f172a;
}

/* Featured Banner: Hwacheon Highlight */
.featured-section {
  margin-bottom: 32px;
}

.featured-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(30, 41, 59, 0.85) 60%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 30px -10px rgba(16, 185, 129, 0.2), var(--shadow-lg);
  backdrop-filter: blur(16px);
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  align-items: center;
}

.featured-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}

.featured-location h2 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.featured-location p {
  color: var(--text-secondary);
  font-size: 15px;
}

.featured-temp-group {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 20px 0;
}

.featured-temp {
  font-size: 68px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.featured-condition {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.featured-condition-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-cyan);
}

.featured-feels {
  font-size: 14px;
  color: var(--text-secondary);
}

.featured-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 20px;
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.metric-icon {
  font-size: 18px;
  color: var(--accent-blue);
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
}

.metric-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Control & Filter Bar */
.controls-bar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.search-sort-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.search-box {
  flex: 1;
  position: relative;
}

.search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

.search-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 16px 12px 46px;
  border-radius: var(--radius-md);
  font-size: 15px;
  outline: none;
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.sort-select {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.sort-select:focus {
  border-color: var(--accent-blue);
}

/* Region Filter Pills */
.filter-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.pill.active {
  background: linear-gradient(135deg, var(--accent-blue), #0284c7);
  color: #0f172a;
  border-color: var(--accent-blue);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.pill.pill-hwacheon.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Grid & Cards */
.city-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.city-count {
  font-size: 14px;
  color: var(--text-secondary);
}

.city-count span {
  color: var(--accent-blue);
  font-weight: 700;
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* City Weather Card */
.weather-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-normal);
  cursor: pointer;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.weather-card:hover {
  transform: translateY(-6px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: var(--shadow-lg);
}

/* Hwacheon Special Card Style */
.weather-card.card-hwacheon {
  border: 2px solid rgba(16, 185, 129, 0.6);
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.12), rgba(30, 41, 59, 0.85));
}

.weather-card.card-hwacheon:hover {
  border-color: #10b981;
  box-shadow: 0 12px 25px rgba(16, 185, 129, 0.25);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.card-city-name {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-province {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-tag {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.card-weather-icon {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

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

.card-temp-desc {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.card-temp {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1px;
}

.card-desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-cyan);
  text-align: right;
}

.card-feels {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 2px;
}

.card-footer-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-secondary);
}

.footer-metric-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-metric-item i {
  color: var(--accent-blue);
  font-size: 13px;
}

/* Modal Window */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-normal);
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: var(--transition-normal);
  position: relative;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title h3 {
  font-size: 26px;
  font-weight: 800;
}

.modal-title p {
  font-size: 13px;
  color: var(--text-secondary);
}

.modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.modal-body {
  padding: 28px;
}

.forecast-title {
  font-size: 16px;
  font-weight: 700;
  margin: 24px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-blue);
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.forecast-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.forecast-day {
  font-size: 12px;
  color: var(--text-secondary);
}

.forecast-icon {
  width: 38px;
  height: 38px;
}

.forecast-temp {
  font-size: 15px;
  font-weight: 700;
}

/* Skeleton Loading State */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

/* Footer */
footer {
  margin-top: 60px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
}

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

/* Responsive adjustments */
@media (max-width: 900px) {
  .featured-card {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
  }
  
  .featured-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .search-sort-row {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .forecast-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
