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

:root {
  --primary: #F59E0B;
  --primary-dark: #D97706;
  --primary-light: #FEF3C7;
  --bg: #F7F8FA;
  --white: #FFFFFF;
  --text: #1A1A2E;
  --text-light: #6B7280;
  --border: #E5E7EB;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(245,158,11,0.18);
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ───── Header ───── */
header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(245,158,11,0.35);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 20px;
  gap: 32px;
}

.logo {
  color: white;
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo span { opacity: 0.75; font-weight: 400; }

nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

nav a {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  transition: background 0.15s;
  white-space: nowrap;
}

nav a:hover { background: rgba(255,255,255,0.18); color: white; }

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ───── Our Sites Bar ───── */
.our-sites-bar {
  justify-content: center;
  background: #1A1A2E;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.our-sites-bar::-webkit-scrollbar { display: none; }
.our-sites-label {
  color: rgba(255,255,255,0.4);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.our-sites-links {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}
.our-sites-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.our-sites-links a:hover {
  background: rgba(255,255,255,0.12);
  color: white;
}
.our-sites-links a.active {
  background: var(--primary);
  color: #1A1A2E;
  font-weight: 700;
}

/* ───── Hero ───── */
.hero {
  background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
  padding: 56px 20px 80px;
  text-align: center;
}

.hero h1 {
  color: white;
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.hero p {
  color: rgba(255,255,255,0.92);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
}

.hero-install-btn {
  margin-top: 20px;
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.22);
  border: 2px solid rgba(255,255,255,0.6);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 30px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.hero-install-btn:hover { background: rgba(255,255,255,0.38); }

.hero-related {
  margin-top: 16px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.88);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.hero-related a {
  color: white;
  font-weight: 700;
  text-decoration: none;
  background: rgba(255,255,255,0.2);
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.4);
  font-size: 0.82rem;
}
.hero-related a:hover { background: rgba(255,255,255,0.38); }

/* ───── Tools Section ───── */
.tools-section {
  max-width: 1200px;
  margin: -36px auto 0;
  padding: 0 20px 80px;
}

.category-block { margin-bottom: 40px; }

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.category-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-desc {
  color: var(--text-light);
  font-size: 0.85rem;
  margin: 2px 0 0 0;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 16px 22px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid transparent;
  display: block;
  position: relative;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(245,158,11,0.2);
}

.tool-icon {
  font-size: 2.8rem;
  margin-bottom: 14px;
  display: block;
}

.tool-name {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 7px;
  color: var(--text);
}

.tool-desc {
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: break-word;
}

.free-badge {
  display: inline-block;
  background: #22C55E;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

/* ───── Tool Page Layout ───── */
.tool-page {
  max-width: 820px;
  margin: 40px auto 80px;
  padding: 0 20px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 28px;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

.tool-header {
  text-align: center;
  margin-bottom: 36px;
}

.tool-header-icon {
  font-size: 3.5rem;
  margin-bottom: 14px;
  display: block;
}

.tool-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.tool-header p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ───── Text Tool Panels ───── */
.text-panel {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.text-panel-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
}

textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.95rem;
  font-family: 'Noto Sans KR', -apple-system, monospace;
  resize: vertical;
  outline: none;
  color: var(--text);
  background: #FAFAFA;
  transition: border-color 0.15s, background 0.15s;
  line-height: 1.6;
}

textarea:focus {
  border-color: var(--primary);
  background: white;
}

textarea.mono {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
}

textarea[readonly] {
  background: #F9FAFB;
  cursor: default;
}

/* ───── Button Groups ───── */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: #F3F4F6;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #E5E7EB; }

.btn-success {
  background: #22C55E;
  color: white;
}
.btn-success:hover { background: #16A34A; }

.btn-danger {
  background: #EF4444;
  color: white;
}
.btn-danger:hover { background: #DC2626; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 13px 28px;
  font-size: 1rem;
  width: 100%;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ───── Stats Row (char counter) ───── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.stat-card {
  background: #F9FAFB;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
}

/* ───── Output area ───── */
.output-wrap {
  position: relative;
  margin-top: 8px;
}

.copy-btn-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  z-index: 2;
}
.copy-btn-overlay:hover { background: var(--primary-dark); }

/* ───── Options Panel ───── */
.options-panel {
  background: white;
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.options-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.option-row:last-child { margin-bottom: 0; }

.option-label {
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 110px;
  color: var(--text);
  flex-shrink: 0;
}

.option-control { flex: 1; }

.option-control select,
.option-control input[type="text"],
.option-control input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: #F9FAFB;
  outline: none;
  transition: border-color 0.15s;
}

.option-control select:focus,
.option-control input:focus {
  border-color: var(--primary);
  background: white;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
}

.checkbox-item input { cursor: pointer; accent-color: var(--primary); width: 16px; height: 16px; }

.radio-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 0.9rem;
}

.radio-item input { cursor: pointer; accent-color: var(--primary); }

/* ───── Range slider ───── */
.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-wrap input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
  height: 6px;
  cursor: pointer;
}

.range-value {
  min-width: 40px;
  text-align: center;
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
}

/* ───── Diff result ───── */
.diff-output {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.88rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 120px;
  max-height: 500px;
  overflow-y: auto;
}

.diff-add {
  background: #DCFCE7;
  color: #166534;
  border-radius: 3px;
  padding: 0 2px;
}

.diff-remove {
  background: #FEE2E2;
  color: #991B1B;
  text-decoration: line-through;
  border-radius: 3px;
  padding: 0 2px;
}

.diff-line-add {
  background: #F0FDF4;
  border-left: 3px solid #22C55E;
  padding: 2px 8px;
  display: block;
  margin: 1px 0;
}

.diff-line-remove {
  background: #FEF2F2;
  border-left: 3px solid #EF4444;
  padding: 2px 8px;
  display: block;
  margin: 1px 0;
}

.diff-line-same {
  padding: 2px 8px;
  display: block;
  color: var(--text-light);
  margin: 1px 0;
}

/* ───── JSON output ───── */
.json-output {
  background: #1E293B;
  color: #E2E8F0;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.88rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 120px;
  max-height: 500px;
  overflow-y: auto;
}

.json-key { color: #93C5FD; }
.json-string { color: #86EFAC; }
.json-number { color: #FCA5A5; }
.json-bool { color: #FBBF24; }
.json-null { color: #94A3B8; }

/* ───── Hash output ───── */
.hash-result-item {
  background: #F9FAFB;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.hash-result-item:last-child { margin-bottom: 0; }

.hash-algo {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.hash-value {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.85rem;
  color: var(--text);
  word-break: break-all;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hash-value span { flex: 1; }

/* ───── Password strength ───── */
.strength-bar {
  height: 6px;
  border-radius: 99px;
  background: #E5E7EB;
  overflow: hidden;
  margin-top: 8px;
}
.strength-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s, background 0.3s;
  width: 0%;
}
.strength-label {
  font-size: 0.8rem;
  margin-top: 4px;
  font-weight: 600;
}

.password-display {
  background: white;
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 1.1rem;
  word-break: break-all;
  color: var(--text);
  min-height: 56px;
  margin: 16px 0 8px;
  line-height: 1.6;
}

/* ───── Alert ───── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-top: 12px;
  display: none;
}

.alert.show { display: block; }

.alert-error {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.alert-success {
  background: #F0FDF4;
  color: #16A34A;
  border: 1px solid #BBF7D0;
}

.alert-info {
  background: var(--primary-light);
  color: #92400E;
  border: 1px solid #FDE68A;
}

/* ───── Cross link ───── */
.cross-link-tip {
  margin-top: 16px;
  padding: 10px 16px;
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  color: var(--text-light);
}
.cross-link-tip a {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}
.cross-link-tip a:hover { text-decoration: underline; }

.cross-link-banner {
  margin: 32px 0 0;
  padding: 16px 20px;
  background: var(--primary-light);
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
}
.cross-link-banner span { color: var(--text); font-weight: 600; }
.cross-link-banner a {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid var(--primary);
  border-radius: 20px;
  font-size: 0.82rem;
}
.cross-link-banner a:hover { background: var(--primary); color: white; }

/* ───── Features Strip ───── */
.features {
  background: white;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 40px 20px;
}

.features-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  text-align: center;
}

.feature-icon { font-size: 2rem; margin-bottom: 10px; }
.feature-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; }
.feature-desc { font-size: 0.82rem; color: var(--text-light); line-height: 1.5; }

/* ───── Footer ───── */
footer {
  background: #1F2937;
  color: #9CA3AF;
  padding: 44px 20px 28px;
  margin-top: 60px;
}

.footer-inner { max-width: 1200px; margin: 0 auto; }

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.footer-brand .logo-footer {
  color: white;
  font-size: 1.3rem;
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

.footer-brand p { font-size: 0.83rem; line-height: 1.6; max-width: 260px; }

.footer-links h4 {
  color: white;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.footer-links a {
  display: block;
  color: #9CA3AF;
  text-decoration: none;
  font-size: 0.83rem;
  margin-bottom: 8px;
  transition: color 0.15s;
}

.footer-links a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-bottom p { font-size: 0.8rem; }

.footer-bottom-links { display: flex; gap: 20px; }

.footer-bottom-links a {
  color: #9CA3AF;
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.15s;
}
.footer-bottom-links a:hover { color: white; }

/* ───── Responsive ───── */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.65rem; }
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
  nav { display: none; }
  .footer-top { flex-direction: column; }
  .option-row { flex-direction: column; align-items: flex-start; }
  .option-label { min-width: unset; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 520px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tool-card { padding: 20px 10px 16px; }
  .tool-icon { font-size: 2.2rem; }
  .hero { padding: 36px 20px 60px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
