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

/* 공통 테마 (모든 도구 페이지에서 사용) */
:root {
  --gray-100: #f3f4f6;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --indigo-300: #a5b4fc;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --green-400: #4ade80;
  --blue-300: #93c5fd;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-korean: 'Noto Sans KR', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; line-height: 1.5; font-family: var(--font-sans); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--gray-900);
  color: var(--gray-100);
}

::selection { background: var(--indigo-500); color: #fff; }

h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; }
[hidden] { display: none !important; }

.font-korean { font-family: var(--font-korean); }

/* ---------- 상단 네비게이션 ---------- */
.nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  font-family: var(--font-korean);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.nav a {
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: var(--gray-800);
  color: var(--gray-400);
  transition: all 0.2s;
}
.nav a:hover { background: var(--gray-700); color: #fff; border-color: var(--gray-600); }
.nav a.active {
  background: var(--indigo-600);
  color: #fff;
  box-shadow: 0 10px 15px -3px rgb(99 102 241 / 0.3), 0 4px 6px -4px rgb(99 102 241 / 0.3);
}

/* ---------- 히어로 ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 1rem 3rem;
}
.hero-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
  animation: fadeInDown 0.8s ease-out;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.25;
  margin-bottom: 0.5rem;
  color: transparent;
  background: linear-gradient(to right, #60a5fa, #6366f1, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
}
.hero .tagline {
  color: var(--gray-300);
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-align: center;
  font-family: var(--font-korean);
}
@media (min-width: 768px) {
  .hero h1 { font-size: 4.5rem; line-height: 1; }
  .hero .tagline { font-size: 1.25rem; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes flow-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------- 검색창 ---------- */
.search {
  position: relative;
  width: 100%;
  max-width: 42rem;
  z-index: 10;
}
.search .icon {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  padding-left: 1.25rem;
  display: flex;
  align-items: center;
  pointer-events: none;
  color: var(--gray-500);
  transition: color 0.15s;
}
.search:focus-within .icon { color: var(--indigo-400); }
.search input {
  display: block;
  width: 100%;
  margin: 0;
  padding: 1.25rem 3rem 1.25rem 3.5rem;
  background: var(--gray-800);
  border: 2px solid var(--gray-700);
  border-radius: 9999px;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1.75rem;
  color: #fff;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  transition: all 0.15s;
}
.search input::placeholder { color: var(--gray-500); opacity: 1; }
.search input:hover { border-color: var(--gray-600); box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); }
.search input:focus {
  outline: none;
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 4px rgb(99 102 241 / 0.2), 0 20px 25px -5px rgb(0 0 0 / 0.1);
}
.search .clear {
  position: absolute;
  top: 0; bottom: 0; right: 1rem;
  display: flex;
  align-items: center;
  color: var(--gray-500);
  transition: color 0.15s;
}
.search .clear:hover { color: #fff; }

/* ---------- 카테고리 칩 ---------- */
.chips-wrap { margin-top: 2rem; width: 100%; max-width: 56rem; padding-bottom: 0.5rem; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; padding: 0 1rem; }
.chip {
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  font-family: var(--font-korean);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: var(--gray-800);
  color: var(--gray-400);
  transition: all 0.2s;
}
.chip:hover { background: var(--gray-700); color: #fff; border-color: var(--gray-600); }
.chip.active, .chip.active:hover {
  background: var(--indigo-600);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 15px -3px rgb(99 102 241 / 0.3), 0 4px 6px -4px rgb(99 102 241 / 0.3);
}

/* ---------- 결과 바 ---------- */
.result-bar {
  max-width: 64rem;
  margin: 0 auto 1rem;
  padding: 0 1.5rem 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem;
  border-bottom: 1px solid var(--gray-800);
}
.result-count { color: var(--gray-500); font-size: 0.875rem; }
.hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--indigo-300);
  background: rgb(49 46 129 / 0.3);
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid rgb(99 102 241 / 0.3);
  font-family: var(--font-korean);
  font-weight: 500;
  letter-spacing: -0.025em;
}
.hint svg { flex-shrink: 0; }

/* ---------- 아이템 카드 ---------- */
.list { max-width: 64rem; margin: 0 auto; padding: 0 1rem 5rem; }
.list > * + * { margin-top: 1rem; }

.card {
  position: relative;
  overflow: hidden;
  display: block;
  background: var(--gray-800);
  border: 1px solid var(--gray-700);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  transition: all 0.2s;
}
.card:hover { border-color: rgb(99 102 241 / 0.5); }
.card-arrow {
  position: absolute;
  top: 0; right: 0;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  color: var(--indigo-400);
  transition: opacity 0.3s;
}
.card-arrow svg { transform: translateX(0.5rem) rotate(-45deg); transition: transform 0.15s; }
.card:hover .card-arrow { opacity: 1; }
.card:hover .card-arrow svg { transform: translateX(0) rotate(-45deg); }

.card-body { display: flex; flex-direction: column; gap: 1.5rem; }
.card-main { flex: 1 1 0%; min-width: 0; }
.card-prices { width: 100%; display: flex; flex-direction: column; gap: 0.5rem; }
@media (min-width: 768px) {
  .card-body { flex-direction: row; align-items: flex-start; }
  .card-prices { width: auto; min-width: 300px; }
}

.badge {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--indigo-300);
  background: rgb(99 102 241 / 0.1);
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid rgb(99 102 241 / 0.2);
}
.card h3 {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  color: var(--gray-100);
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s;
}
.card:hover h3 { color: var(--indigo-300); }
.card .desc {
  color: var(--gray-400);
  font-size: 0.875rem;
  line-height: 1.625;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.prices-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gray-500);
}
.price {
  background: rgb(17 24 39 / 0.8);
  border: 1px solid rgb(55 65 81 / 0.5);
  border-radius: 0.5rem;
  padding: 0.75rem;
  transition: border-color 0.15s;
}
.price:hover { border-color: rgb(99 102 241 / 0.3); }
.price-raw { color: var(--green-400); font-size: 1rem; line-height: 1.5rem; font-weight: 600; }
.price-conv {
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgb(55 65 81 / 0.5);
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--blue-300);
}
.price-conv svg { margin-top: 0.125rem; flex-shrink: 0; opacity: 0.7; }
.price-conv span { opacity: 0.9; }
.price-none { color: var(--gray-500); font-size: 0.875rem; font-style: italic; }

.effect-volatile {
  font-weight: 900;
  background: linear-gradient(90deg, #ff4d4d, #f06292, #ff4d4d);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: flow-gradient 3s linear infinite;
  display: inline-block;
}
.effect-low-volume {
  font-style: italic;
  font-weight: 400;
  background: linear-gradient(90deg, #718096, #ffffff, #718096);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: flow-gradient 4s linear infinite;
  display: inline-block;
}

/* ---------- 빈 결과 ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 5rem 0;
  opacity: 0.5;
}
.empty svg { margin-bottom: 1rem; color: var(--gray-600); }
.empty .msg { font-size: 1.25rem; color: var(--gray-400); overflow-wrap: anywhere; }
.empty .sub { font-size: 0.875rem; color: var(--gray-600); margin-top: 0.5rem; }

/* ---------- 홈: 도구 목록 ---------- */
.tools {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1rem 5rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.tools .card h3 { white-space: normal; font-family: var(--font-korean); }
.tools .card .desc { font-family: var(--font-korean); }
.tools .card.soon { opacity: 0.5; pointer-events: none; }

/* ---------- 푸터 ---------- */
footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--gray-600);
  font-size: 0.875rem;
  border-top: 1px solid var(--gray-800);
  background: rgb(17 24 39 / 0.5);
}
footer p + p { margin-top: 0.25rem; opacity: 0.5; }
footer a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
