/* 외국인 근로자용 가락시장 청양고추 시세 모바일 최적화 스타일시트 (심플 드롭다운 버전) */

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

:root {
  --bg-color: #0d1b12;
  --card-bg: rgba(22, 38, 28, 0.85);
  --card-border: rgba(255, 255, 255, 0.1);
  --text-main: #f0f7f2;
  --text-sub: #a3c2ac;
  --accent-red: #ff4d4d;
  --accent-green: #2ecc71;
  --accent-brand: #00e676;
  --gold-grade: #f1c40f;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', 'Noto Sans KR', sans-serif;
  background: var(--bg-color);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 230, 118, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(255, 77, 77, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  padding: 16px 12px 40px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.container {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header */
.header {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.badge {
  display: inline-block;
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent-brand);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(0, 230, 118, 0.3);
}

/* Compact Language Dropdown */
.lang-dropdown-wrapper {
  position: relative;
}

.lang-select {
  background: rgba(0, 0, 0, 0.4);
  color: var(--accent-brand);
  border: 1px solid rgba(0, 230, 118, 0.4);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300e676%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 10px top 50%;
  background-size: 10px auto;
  transition: all 0.2s ease;
}

.lang-select:focus, .lang-select:hover {
  border-color: var(--accent-brand);
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.3);
}

.lang-select option {
  background: #122217;
  color: #ffffff;
  padding: 10px;
}

.title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.title span {
  font-size: 1.7rem;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-sub);
  margin-top: 4px;
  text-align: center;
}

/* Date Info */
.info-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-item .lbl {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.info-item .val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-brand);
}

/* Price Cards Stack */
.price-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.price-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.price-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--accent-brand);
}

.price-card.grade-0::before { background: #f1c40f; } /* 특 (금) */
.price-card.grade-1::before { background: #3498db; } /* 상 (파) */
.price-card.grade-2::before { background: #2ecc71; } /* 중 (초) */
.price-card.grade-3::before { background: #9b59b6; } /* 하 (보) */

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

.grade-badge {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.grade-0 .grade-badge { color: #f1c40f; }
.grade-1 .grade-badge { color: #3498db; }
.grade-2 .grade-badge { color: #2ecc71; }
.grade-3 .grade-badge { color: #9b59b6; }

.unit-tag {
  font-size: 0.8rem;
  color: var(--text-sub);
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
}

.main-price-box {
  margin: 8px 0 14px 0;
}

.main-price-lbl {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-bottom: 2px;
}

.main-price-val {
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.main-price-val small {
  font-size: 1.1rem;
  font-weight: 600;
  margin-left: 4px;
  color: var(--text-sub);
}

.sub-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 12px;
  border-radius: 10px;
}

.detail-cell {
  display: flex;
  flex-direction: column;
}

.detail-cell .dt-lbl {
  font-size: 0.75rem;
  color: var(--text-sub);
}

.detail-cell .dt-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 2px;
}

.change-up { color: var(--accent-red) !important; }
.change-down { color: var(--accent-brand) !important; }

/* Loading & Empty state */
.loading-box {
  text-align: center;
  padding: 40px 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-brand);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin: 0 auto 16px auto;
}

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

.footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-top: 8px;
  line-height: 1.5;
}
