/* 컬러 팔레트 생성기 전용 스타일 */

nav { max-width: 980px; }
main { max-width: 980px; }

.subtitle {
  color: var(--text-sub);
  margin-bottom: 1.25rem;
}

/* 베이스 색상 입력 */
.base-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.base-input label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.base-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

#base-color-picker {
  width: 60px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  background: transparent;
}

#base-color-hex {
  flex: 1;
  padding: 0.6rem 0.8rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.1rem;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  text-transform: uppercase;
}

#base-color-hex:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

/* 모드 탭 */
.mode-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.mode-tab {
  flex: 1;
  min-width: 130px;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-sub);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}

.mode-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.mode-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 팔레트 */
.palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.swatch {
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.85rem 0.7rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
  position: relative;
}

.swatch:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.swatch:active {
  transform: translateY(-1px);
}

.sw-num {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.7;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.sw-hex {
  font-size: 1rem;
  font-weight: 800;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: -0.02em;
}

.sw-rgb {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.7;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* 출력 */
.output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.output-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.85rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.output-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.btn-copy {
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-copy:hover {
  filter: brightness(1.08);
}

.output-code {
  margin: 0;
  padding: 0.85rem 1rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  background: var(--surface);
  color: var(--text);
  white-space: pre;
  overflow-x: auto;
}

@media (max-width: 720px) {
  .palette { grid-template-columns: repeat(3, 1fr); }
  .swatch:nth-child(4), .swatch:nth-child(5) { /* 그대로 두 줄 */ }
  .mode-tab { min-width: 0; padding: 0.5rem 0.6rem; font-size: 0.74rem; }
  .sw-hex { font-size: 0.88rem; }
  .sw-rgb { font-size: 0.65rem; }
}

@media (max-width: 480px) {
  .palette { grid-template-columns: repeat(2, 1fr); }
}
