/* 통합 대시보드 공용 스타일 — 각 도구는 이 변수들을 참고하되 style.css에서 자유롭게 오버라이드합니다 */

:root {
  --brand-primary: #2563eb;
  --brand-bg: #f7f7f7;
  --brand-text: #1e293b;
  --brand-text-muted: #53575e;
  --brand-radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--brand-bg);
  color: var(--brand-text);
  line-height: 1.6;
}

.dashboard-header {
  text-align: center;
  padding: 48px 16px 24px;
}

.brand-name {
  margin: 0 0 8px;
  font-family: "Encode Sans Expanded", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 800;
  font-size: 3.5rem;
  letter-spacing: -0.01em;
  color: var(--brand-primary);
}

.brand-mark {
  display: inline-block;
  height: 2.2em;
  width: auto;
  vertical-align: -0.52em;
}

.dashboard-header p {
  margin: 0;
  color: var(--brand-text-muted);
  font-size: 1.25rem;
  font-weight: 600;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.ads-container {
  margin: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--brand-radius);
  color: var(--brand-text-muted);
  font-size: 0.9rem;
}

.tool-category {
  margin-top: 20px;
}

.tool-category:first-child {
  margin-top: 20px;
}

.tool-category-heading {
  margin: 0;
  font-family: "Encode Sans Expanded", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--brand-text);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.tool-card {
  display: block;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--brand-radius);
  padding: 20px;
  text-decoration: none;
  color: var(--brand-text);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.tool-card-icon {
  display: block;
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
}

.tool-card-title {
  display: block;
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 6px;
  color: var(--brand-primary);
}

.tool-card-desc {
  display: block;
  font-size: 0.9rem;
  color: var(--brand-text-muted);
}

.dashboard-footer {
  text-align: center;
  padding: 24px 16px 40px;
  color: var(--brand-text-muted);
  font-size: 0.85rem;
}

.footer-links {
  margin: 8px 0 0;
}

.footer-links a {
  color: var(--brand-text-muted);
  text-decoration: underline;
}

.footer-links a:hover {
  color: var(--brand-primary);
}

/* privacy/about처럼 도구 전용 style.css 없이 이 공용 스타일을 그대로 쓰는
   정적 정보 페이지를 위한 규칙입니다. */
/* back-link을 position:fixed로 화면에 띄우면, 스크롤 중인 본문 텍스트가 그 아래를
   지나가는 순간마다 겹쳐 보이는 문제가 있었습니다(실사용 스크린샷으로 발견). 그래서
   버튼만 따로 띄우는 대신, 폭 전체를 덮는 불투명한 배경의 sticky 바(.top-bar) 안에
   버튼을 넣는 방식으로 바꿨습니다 — 그 바 아래로 지나가는 내용은 불투명 배경에
   완전히 가려지므로 어떤 화면 크기에서도 겹쳐 보이지 않습니다. */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 16px;
  background: var(--brand-bg);
}

/* PC처럼 넓은 화면에서는 스크롤을 올렸을 때 상단바 전체가 화면을 가리지 않도록,
   막대(.top-bar) 자체를 폭 전체가 아니라 버튼 크기만큼만 남기고 배경도 지웁니다.
   .back-link 자체가 이미 불투명한 배경(pill 버튼)을 갖고 있어서 겹침 문제 없이
   버튼만 떠 있는 것처럼 보입니다. */
@media (min-width: 768px) {
  .top-bar {
    width: fit-content;
    height: auto;
    padding: 12px 16px 0;
    background: transparent;
  }
}

.back-link {
  display: inline-block;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: var(--brand-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.back-link:hover {
  color: var(--brand-primary);
}

.page-header {
  text-align: center;
  padding: 10px 16px 16px;
}

.page-header h1 {
  margin: 0 0 8px;
  font-family: "Encode Sans Expanded", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 800;
  font-size: 2.2rem;
  color: var(--brand-primary);
}

.subtitle {
  margin: 0;
  color: var(--brand-text-muted);
  font-size: 1.1rem;
}

.info-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.info-section h2 {
  color: var(--brand-primary);
  font-size: 1.3rem;
  margin-top: 32px;
}

.info-section a {
  color: var(--brand-primary);
}

.info-section ul {
  padding-left: 20px;
}

.info-section li {
  margin-bottom: 8px;
}

.page-footer {
  text-align: center;
  padding: 24px 16px 40px;
  color: var(--brand-text-muted);
  font-size: 0.85rem;
}

.scroll-top-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
  transition: background 0.12s ease, transform 0.12s ease;
}

.scroll-top-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
}

/* [hidden] 속성과 .scroll-top-btn { display:flex }는 상세도(specificity)가 같아서
   나중에 선언된 쪽이 이겨 hidden이 무시되는 문제가 있었습니다(카테고리 폼에서 이미
   겪은 버그와 동일한 원인). 그래서 [hidden]을 명시적으로 다시 덮어씁니다. */
.scroll-top-btn[hidden] {
  display: none;
}
