/* =====================================================
   컬러 피커 전용 CSS
   위치: design-media/color-picker/style_color_picker.css
   ===================================================== */
:root {
  --bg: #f6f8ff;
  --card: #ffffff;
  --ink: #0b1220;
  --muted: #5a6b87;
  --line: #e6ecff;
  --blue: #2563eb;
  --blue2: #1d4ed8;
  --shadow: 0 10px 30px rgba(12,24,60,.10);
  --radius: 16px;
  --radius2: 12px;
  --focus: 0 0 0 4px rgba(37,99,235,.18);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0 }
body {
  font-family: 'Pretendard', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 30% -20%, rgba(37,99,235,.16), transparent 60%),
    radial-gradient(1200px 600px at 80% 0%, rgba(59,130,246,.10), transparent 60%),
    var(--bg);
}
a { color: inherit }

/* ── 기본 레이아웃 ── */
.wrap { max-width: 100%; padding: 0 0 60px }

/* ── 상단 헤더 ── */
.top { padding: 20px 0 16px }
.brand { display: flex; gap: 14px; align-items: center }
.logo {
  width:48px;height:48px;flex:0 0 auto;
  display:flex;align-items:center;justify-content:center;
  border-radius:13px;
  background:linear-gradient(135deg,#f59e0b,#ec4899);
  font-size:22px;
}
.logo span { font-size: 22px }
h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.3px }
.sub { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45 }

/* ── 카드 ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 14px;
}
.card-h {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.card-h h2 { margin: 0; font-size: 15px; font-weight: 800 }
.hint { color: var(--muted); font-size: 12px }

/* ── 색상 선택 영역 ── */
.picker-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) { .picker-layout { grid-template-columns: 1fr } }

.color-input-area { display: flex; flex-direction: column; gap: 12px }

/* 네이티브 컬러 피커 */
.native-picker-wrap {
  position: relative;
  border-radius: var(--radius2);
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
}
.native-picker-wrap input[type="color"] {
  display: block;
  width: 100%; height: 180px;
  border: none; padding: 0; margin: 0;
  cursor: pointer;
  border-radius: 0;
}

/* HEX 직접 입력 */
.hex-row {
  display: flex; gap: 8px; align-items: center;
}
.hex-row input[type="text"] {
  flex: 1; font-family: var(--mono); font-size: 14px; font-weight: 700;
  border: 1px solid var(--line); border-radius: var(--radius2);
  padding: 10px 12px; outline: none; background: #fff;
  text-transform: uppercase;
}
.hex-row input[type="text"]:focus {
  box-shadow: var(--focus); border-color: rgba(37,99,235,.35)
}

/* 랜덤 버튼 */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(37,99,235,.25); background: #fff; color: var(--ink);
  padding: 9px 13px; border-radius: var(--radius2);
  cursor: pointer; font-weight: 700; font-size: 13px;
  font-family: inherit; white-space: nowrap;
}
.btn:hover { border-color: rgba(37,99,235,.5) }
.btn:focus { outline: none; box-shadow: var(--focus) }
.btn.primary {
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: #fff; border-color: transparent;
}
.btn.primary:hover { filter: brightness(1.08) }
.btn.sm { padding: 7px 10px; font-size: 12px; border-radius: 10px }
.btn.icon-btn { padding: 8px; border-radius: 10px }

/* ── 색상 미리보기 패널 ── */
.preview-panel { display: flex; flex-direction: column; gap: 12px }
.color-preview-box {
  flex: 1; min-height: 140px; border-radius: var(--radius);
  border: 1px solid var(--line); transition: background .1s;
}
.color-info {
  background: rgba(246,248,255,.6); border: 1px solid var(--line);
  border-radius: var(--radius2); padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.color-hex-big {
  font-family: var(--mono); font-size: 28px; font-weight: 900;
  letter-spacing: .02em; line-height: 1;
}
.color-name { font-size: 12px; color: var(--muted) }

/* ── 색상 포맷 변환 그리드 ── */
.format-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 560px) { .format-grid { grid-template-columns: 1fr } }

.format-item {
  border: 1px solid var(--line); border-radius: var(--radius2);
  padding: 12px; background: rgba(246,248,255,.5);
  display: flex; flex-direction: column; gap: 8px;
}
.format-label { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em }
.format-value {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; width: 100%; outline: none;
  cursor: text;
}
.format-value:focus { box-shadow: var(--focus); border-color: rgba(37,99,235,.35) }
.copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; padding: 6px 10px;
  border: 1px solid rgba(37,99,235,.22); border-radius: 8px;
  background: #fff; color: var(--blue2); cursor: pointer;
  font-family: inherit; align-self: flex-start;
  transition: background .1s;
}
.copy-btn:hover { background: #eef2ff; border-color: rgba(37,99,235,.4) }
.copy-btn.copied { background: #dcfce7; border-color: #86efac; color: #15803d }
.copy-btn:focus { outline: none; box-shadow: var(--focus) }

/* ── 팔레트 섹션 ── */
.palette-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
}
.pal-tab {
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  font-size: 12px; font-weight: 700; color: var(--ink);
  cursor: pointer; font-family: inherit;
}
.pal-tab.active { border-color: rgba(37,99,235,.4); background: rgba(37,99,235,.08); color: var(--blue2) }
.pal-tab:focus { outline: none; box-shadow: var(--focus) }

.palette-strip {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.pal-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer;
}
.pal-swatch-box {
  width: 52px; height: 52px; border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  transition: transform .12s, box-shadow .12s;
}
.pal-swatch:hover .pal-swatch-box {
  transform: scale(1.08); box-shadow: 0 4px 12px rgba(0,0,0,.15)
}
.pal-swatch-hex {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
}

/* Tints & Shades — 가로 스트립 */
.tint-strip {
  display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto;
  padding-bottom: 4px; scrollbar-width: none;
}
.tint-strip::-webkit-scrollbar { display: none }
.tint-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 0 0 auto; cursor: pointer;
}
.tint-box {
  width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid rgba(0,0,0,.07);
  transition: transform .12s;
}
.tint-item:hover .tint-box { transform: scale(1.1) }
.tint-label { font-size: 9px; font-weight: 700; color: var(--muted) }

/* ── 히스토리 ── */
.history-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.hist-swatch {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid rgba(0,0,0,.08); cursor: pointer;
  transition: transform .1s;
}
.hist-swatch:hover { transform: scale(1.12) }
.hist-empty { font-size: 12px; color: var(--muted) }

/* ── 공통 유틸 ── */
.hidden { display: none !important }
.muted { color: var(--muted) }
.small { font-size: 12px }
.mono { font-family: var(--mono) }
.row-flex { display: flex; align-items: center; gap: 8px; flex-wrap: wrap }

/* ── 토스트 ── */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #0b1220; color: #fff; padding: 10px 18px;
  border-radius: 999px; font-size: 13px; font-weight: 700;
  opacity: 0; pointer-events: none; z-index: 9999;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0) }
