@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css");

:root {
  /* 색상 토큰 */
  --bg: #10182b;            /* 깊은 네이비 - 밤약국의 배경 */
  --bg-elevated: #182238;   /* 카드 배경 */
  --bg-elevated-hover: #1e2a45;
  --line: #2a3552;          /* 구분선 */
  --text: #eef1f8;          /* 본문 밝은 텍스트 */
  --text-dim: #9aa5c0;      /* 보조 텍스트 */
  --mint: #22d3a6;          /* 약국 십자가 그린 (핵심 액센트) */
  --mint-dim: #17997a;
  --amber: #f5b942;         /* 영업중 상태 배지 */
  --red-dim: #6b7280;       /* 영업종료 배지 */

  --radius: 14px;
  --shadow: 0 8px 24px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- 헤더 ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(16, 24, 43, 0.92);
  backdrop-filter: blur(8px);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

/* 시그니처 요소: 발광하는 약국 십자가 아이콘 */
.cross-icon {
  width: 22px;
  height: 22px;
  position: relative;
  flex-shrink: 0;
}
.cross-icon::before,
.cross-icon::after {
  content: "";
  position: absolute;
  background: var(--mint);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(34, 211, 166, 0.75);
}
.cross-icon::before { top: 0; left: 42%; width: 16%; height: 100%; }
.cross-icon::after { top: 42%; left: 0; width: 100%; height: 16%; }

.brand-sub {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 400;
}

/* ---------- 히어로 / 검색 ---------- */
.hero {
  padding: 56px 24px 32px;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}

.hero h1 .mint { color: var(--mint); }

.hero p {
  color: var(--text-dim);
  margin: 0 0 28px;
  font-size: 15px;
}

.now-open-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--mint);
  color: #06261f;
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(34,211,166,0.5);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.now-open-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(34,211,166,0.35); }
.now-open-cta .pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #06261f;
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- 검색 폼 ---------- */
.search-form {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.search-form select,
.search-form input[type="text"] {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}
.search-form select:focus,
.search-form input:focus {
  outline: none;
  border-color: var(--mint);
}
.search-form input[type="text"] { flex: 1; min-width: 180px; }

.search-form button.submit {
  background: var(--bg-elevated);
  border: 1px solid var(--mint-dim);
  color: var(--mint);
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.search-form button.submit:hover { background: var(--bg-elevated-hover); }

/* ---------- 결과 영역 ---------- */
.results-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 8px 24px 64px;
}

.results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: 13px;
  margin: 24px 0 14px;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pharm-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pharm-card:hover { background: var(--bg-elevated-hover); border-color: var(--mint-dim); }

.pharm-card .name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.pharm-card .addr { color: var(--text-dim); font-size: 13px; margin-bottom: 6px; }
.pharm-card .tel { color: var(--mint); font-size: 13px; font-weight: 600; }

.badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.open { background: rgba(245, 185, 66, 0.15); color: var(--amber); }
.badge.closed { background: rgba(154, 165, 192, 0.12); color: var(--text-dim); }

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 20px;
  font-size: 14px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}
.pagination button {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.pagination button:disabled { opacity: 0.4; cursor: default; }
.pagination button.active { border-color: var(--mint); color: var(--mint); }

/* ---------- 광고 슬롯 ---------- */
.ad-slot {
  max-width: 880px;
  margin: 24px auto;
  padding: 0 24px;
  text-align: center;
}
.ad-slot .ad-label {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

/* ---------- 상세 페이지 ---------- */
.detail-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}
.detail-wrap .back-link {
  display: inline-block;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 20px;
}
.detail-wrap h1 { font-size: 24px; margin: 0 0 6px; }
.detail-wrap .addr { color: var(--text-dim); margin-bottom: 20px; }

.detail-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
}
.detail-card h2 { font-size: 14px; color: var(--mint); margin: 0 0 12px; }

.hours-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hours-table td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.hours-table tr:last-child td { border-bottom: none; }
.hours-table td:first-child { color: var(--text-dim); width: 70px; }

.call-btn {
  display: block;
  text-align: center;
  background: var(--mint);
  color: #06261f;
  font-weight: 700;
  padding: 14px;
  border-radius: 10px;
  margin-top: 8px;
}

/* ---------- 푸터 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}
.site-footer a { color: var(--text-dim); text-decoration: underline; }

/* ---------- 반응형 ---------- */
@media (max-width: 480px) {
  .search-form { flex-direction: column; align-items: stretch; }
  .search-form select, .search-form input, .search-form button.submit { width: 100%; }
}

/* 모션 최소화 설정 존중 */
@media (prefers-reduced-motion: reduce) {
  .now-open-cta .pulse-dot { animation: none; }
  * { transition: none !important; }
}
