/* Header 스타일 */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 15, 30, 0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  transition: all 0.3s ease;
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
}

/* 라이트 모드에서 페이지 헤더 텍스트 가시성 개선 */
[data-theme="light"] .page-header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #0891b2 100%) !important;
}

[data-theme="light"] .page-title {
  color: white !important;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="light"] .page-description {
  color: white !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 70px;
}

/* 로고 */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.375rem;
  color: var(--ink);
  font-family: 'Pretendard', system-ui, -apple-system, sans-serif;
  letter-spacing: -0.02em;
  height: 100%;
  line-height: 1;
}

.logo:hover {
  transform: scale(1.02);
  transition: all 0.2s ease;
}

.logo-icon {
  font-size: 1.75rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  display: flex;
  align-items: center;
}

.logo-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  display: flex;
  align-items: center;
}

/* 네비게이션 */
    .primary-nav {
      flex: 1;
      margin-left: 2rem;
      margin-right: 1rem;
      display: flex;
      align-items: center;
      height: 100%;
      min-width: 0;
      overflow: visible;
    }

    .nav-list {
      display: flex;
      list-style: none;
      gap: 0.25rem;
      align-items: center;
      height: 100%;
      margin: 0;
      padding: 0;
      flex-wrap: nowrap;
      overflow: visible;
    }

.nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

    .nav-link {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0.5rem 0.75rem;
      font-weight: 600;
      font-size: 0.8rem;
      text-decoration: none;
      color: var(--ink-secondary);
      transition: all 0.2s ease;
      border-radius: 8px;
      letter-spacing: -0.01em;
      font-family: 'Pretendard', system-ui, -apple-system, sans-serif;
      position: relative;
      overflow: hidden;
      height: 40px;
      min-width: fit-content;
      white-space: nowrap;
      flex-shrink: 0;
    }

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: -1;
}

.nav-link:hover {
  color: white;
  transform: translateY(-1px);
}

.nav-link:hover::before {
  opacity: 1;
}

.nav-item.active .nav-link {
  color: white;
  background: var(--gradient);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(76, 110, 245, 0.3);
}

.nav-item.active .nav-link::after {
  display: none;
}

/* 헤더 액션들 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
  flex-shrink: 0;
}

/* 검색 폼 */
.search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 200px;
  padding: 0.625rem 2.5rem 0.625rem 1rem;
  font-size: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  transition: all 0.3s ease;
  font-family: 'Pretendard', system-ui, -apple-system, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
  width: 250px;
  border-color: var(--brand);
  box-shadow: 0 4px 20px rgba(76, 110, 245, 0.15);
  background: var(--bg);
}

.search-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.search-btn {
  position: absolute;
  right: 0.625rem;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.375rem;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  color: var(--brand);
  background: rgba(76, 110, 245, 0.1);
}

/* 테마 토글 */
.theme-toggle {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  padding: 0.625rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  width: 36px;
  height: 36px;
}

.theme-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: -1;
}

.theme-toggle:hover {
  color: white;
  border-color: transparent;
  transform: translateY(-1px);
}

.theme-toggle:hover::before {
  opacity: 1;
}

/* 관리자 링크 */
.admin-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.admin-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: -1;
}

.admin-link:hover {
  color: white;
  border-color: transparent;
  transform: translateY(-1px);
}

.admin-link:hover::before {
  opacity: 1;
}

.admin-link.active {
  background: var(--gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.admin-text {
  font-family: 'Pretendard', system-ui, -apple-system, sans-serif;
  letter-spacing: -0.01em;
}

/* 모바일 메뉴 토글 */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: var(--line);
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 모바일 메뉴가 열렸을 때 스크롤 방지 */
body.mobile-menu-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
    order: 1;
  }

  .header-actions {
    order: 2;
    gap: 0.375rem;
  }

  .primary-nav {
    order: 3;
    margin-left: 0;
  }

  .search-form {
    display: none;
  }

  .admin-link {
    padding: 0.375rem;
    border-radius: 8px;
  }

  .admin-text {
    display: none;
  }

  .header-content {
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .logo {
    order: 0;
    flex: 1;
  }

  .header-actions .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    min-height: 36px;
  }
}

/* Breadcrumb */
.breadcrumb {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  list-style: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
  content: '>';
  margin: 0 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.breadcrumb-link {
  color: var(--brand);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.breadcrumb-link:hover {
  color: var(--accent);
}

.breadcrumb-item.current span {
  color: var(--ink-secondary);
  font-size: 0.875rem;
}

/* Footer */
.footer {
  background: var(--card);
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding: 3rem 0 1rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-brand {
  margin-bottom: 2rem;
}

.footer-brand h3 {
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.footer-brand p {
  color: var(--muted);
  max-width: 300px;
}

.footer-sitemap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.sitemap-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1rem;
}

.sitemap-links {
  list-style: none;
}

.sitemap-links li {
  margin-bottom: 0.5rem;
}

.sitemap-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

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

.footer-legal {
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer-legal p {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .header-content {
    padding: 0 1rem;
    height: 65px;
    position: relative;
  }

  .logo {
    font-size: 1.25rem;
  }

  .logo-icon {
    font-size: 1.5rem;
  }
  
  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    margin-left: 0;
    backdrop-filter: blur(20px);
  }
  
  .primary-nav.mobile-open {
    display: block;
  }
  
  .nav-list {
    flex-direction: column;
    padding: 1.5rem;
    gap: 0;
  }
  
  .nav-link {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    width: 100%;
    justify-content: flex-start;
    height: 52px;
    font-size: 1rem;
  }

  .nav-link:hover::before,
  .nav-item.active .nav-link::before {
    display: none;
  }

  .nav-item.active .nav-link {
    background: var(--brand);
    color: white;
  }
  
  .search-input {
    width: 180px;
    padding: 0.625rem 2.5rem 0.625rem 1rem;
  }
  
  .search-input:focus {
    width: 220px;
  }
  
  .header-actions {
    gap: 0.75rem;
  }

  .theme-toggle {
    padding: 0.625rem;
  }
  
  .footer-sitemap {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .breadcrumb-list {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .footer-sitemap {
    grid-template-columns: 1fr;
  }
  
  .search-form {
    display: none;
  }
}

/* 레이아웃 */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  padding: 2rem 0;
}

.page-header {
  background: var(--gradient);
  color: white;
  padding: 3rem 0;
  margin-bottom: 2rem;
}

.page-title {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 2.5rem;
}

.page-description {
  text-align: center;
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* 관리자 전용 스타일 */
.admin-only {
  display: none;
}

[data-admin="true"] .admin-only {
  display: block;
}
