/* 공통 변수 */
:root {
  --primary-color: #1e3a5f;
  --primary-light: #2c5282;
  --primary-dark: #0f1f3d;
  --accent-gold: #d4af37;
  --secondary-color: #8B4513;
  --success-color: #4CAF50;
  --danger-color: #F44336;
  --light-color: #FFFFFF;
  --dark-color: #2C2C2C;
  --white: #ffffff;
  --gray-100: #FFFFFF;
  --gray-200: #F5F5F5;
  --gray-300: #E0E0E0;
  --gray-400: #BDBDBD;
  --gray-500: #9E9E9E;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;
  --font-sans: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans CJK KR', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 기본 스타일 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--gray-800);
  background-color: #fff;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 헤더 스타일 */
.header {
  width: 100%;
  background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
  box-shadow: 0 4px 20px rgba(30, 58, 95, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* 상단 유틸리티 바 */
.header-top {
  background-color: #f8f8f8;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.85rem;
}

.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 15px;
}

.header-top-left span {
  color: #666;
}

.header-top-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

#top-auth-buttons,
#top-user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

#top-auth-buttons a,
#top-user-menu a,
#top-user-menu button {
  color: #333;
  text-decoration: none;
  transition: color 0.2s;
}

#top-auth-buttons a:hover,
#top-user-menu a:hover,
#top-user-menu button:hover {
  color: var(--primary-color);
}

.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
}

.header-top-right .divider {
  color: #ccc;
}

.lang-selector {
  color: #333;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-selector:hover {
  color: var(--primary-color);
}

/* 메인 헤더 (로고 + 검색 + 아이콘) */
.header-main {
  border-bottom: 1px solid rgba(30, 58, 95, 0.08);
  background: #ffffff;
}

.header-main .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px;
  height: 80px;
}

.logo {
  flex-shrink: 0;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
  transition: all 0.3s ease;
}

.logo a:hover {
  color: var(--primary-light);
  transform: scale(1.02);
}

.logo img {
  height: 50px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

.logo-text {
  font-family: 'Arial Black', sans-serif;
  letter-spacing: -0.5px;
}

.header-search {
  flex: 0 1 500px;
  max-width: 500px;
  display: flex;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
  transition: all 0.3s ease;
}

.header-search:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.header-search .search-form {
  display: flex;
  flex: 1;
  align-items: center;
  width: 100%;
}

.header-search input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 10px 16px;
  font-size: 0.9rem;
  outline: none;
  background: transparent;
  color: #344054;
}

.header-search input::placeholder {
  color: #98a2b3;
}

.header-search .search-clear-btn {
  background: none;
  border: none;
  color: #98a2b3;
  padding: 0 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.header-search .search-clear-btn:hover {
  color: #667085;
}

.header-search .search-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 100%;
  flex-shrink: 0;
}

.header-search .search-btn i {
  font-size: 1.1rem;
}

.header-search .search-btn:hover {
  background: var(--primary-light);
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 20px;
}

.icon-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.75rem;
  position: relative;
  transition: all 0.3s ease;
  font-weight: 600;
}

.icon-link i {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.icon-link:hover {
  color: var(--primary-light);
  transform: translateY(-2px);
}

.icon-link:hover i {
  transform: scale(1.1);
}

.icon-link .badge {
  position: absolute;
  top: -5px;
  right: -10px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: bold;
}

/* 네비게이션 바 */
.header-nav {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.15);
}

.header-nav .container {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
}

.category-btn {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e8ba3 100%);
  color: white;
  border: none;
  padding: 15px 25px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(30, 60, 114, 0.3);
  position: relative;
  overflow: hidden;
}

.category-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.category-btn:hover::before {
  left: 100%;
}

.category-btn:hover {
  background: linear-gradient(135deg, #2a5298 0%, #1e3c72 50%, #6b7a8f 100%);
  box-shadow: 0 6px 20px rgba(30, 60, 114, 0.4);
  transform: translateY(-2px);
}

.category-btn i {
  font-size: 1.1rem;
}

.main-nav {
  display: flex;
  flex: 1;
  gap: 0;
  justify-content: flex-start;
  margin-left: 0;
}

.main-nav a {
  color: white;
  text-decoration: none;
  padding: 15px 20px;
  font-weight: 500;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  background-color: rgba(255, 255, 255, 0.1);
}

.main-nav .dropdown-link {
  display: flex;
  align-items: center;
  gap: 5px;
}

.theme-toggle {
  background: transparent;
  border: none;
  color: white;
  padding: 15px 20px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.theme-toggle i {
  font-size: 1.2rem;
}

/* 햄버거 버튼 */
.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  background: #fff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gray-800);
}

/* 접근성: 포커스 링 */
.btn:focus {
  outline: 2px solid rgba(74, 108, 247, 0.4);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  height: 44px;
  font-size: 0.95rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

/* 아웃라인 버튼 */
.btn.btn-outline {
  background: transparent;
  color: #1e3a5f;
  border: 2px solid #1e3a5f;
}

.btn.btn-outline:hover {
  background-color: #1e3a5f;
  color: white;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
  transform: translateY(-2px);
}

/* 프라이머리 버튼 */
.btn.btn-primary {
  background: #1e3a5f;
  color: white;
  border: 1px solid #1e3a5f;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.2);
}

.btn.btn-primary:hover {
  background: #2c5282;
  border-color: #2c5282;
  box-shadow: 0 6px 20px rgba(30, 58, 95, 0.4);
  transform: translateY(-2px);
}

/* 푸터 스타일 */
.footer {
  width: 100%;
  margin-top: auto;
}

/* 상단 링크 바 (하늘색) */
.footer-top {
  background-color: var(--primary-color)  ;
  padding: 12px 0;
  box-shadow: 0 -2px 10px rgba(14, 165, 233, 0.2);
}

.footer-links {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
}

.footer-links a {
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  transition: opacity 0.3s;
}

.footer-links a:hover {
  opacity: 0.8;
}

.footer-links .divider {
  color: #fff;
  opacity: 0.5;
}

/* 하단 정보 섹션 (어두운 배경) */
.footer-main {
  background-color: #2b2b2b;
  color: #999;
  padding: 40px 0;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr;
  gap: 60px;
}

.footer-section h4 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: #fff;
  font-weight: 600;
}

.footer-section p {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 6px;
  line-height: 1.6;
}

.footer-section.company-info p {
  margin-bottom: 4px;
}

.footer-section.site-info .phone {
  font-size: 1.3rem;
  color: #fff;
  font-weight: 600;
  margin: 15px 0 10px 0;
}

.footer-section.site-info .notice {
  color: #fff;
  font-weight: 600;
  margin-top: 15px;
  margin-bottom: 8px;
}

.footer-section.notice-info .notice-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.footer-section.notice-info .notice-icon {
  font-size: 1.2rem;
}

.footer-section.notice-info .btn-more {
  padding: 10px 20px;
  background-color: transparent;
  border: 1px solid #666;
  color: #999;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.footer-section.notice-info .btn-more:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: #999;
  color: #fff;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
  /* 상단 유틸리티 바 숨김 */
  .header-top {
    display: none;
  }

  /* 메인 헤더 */
  .header-main .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    height: auto;
    padding: 10px 15px;
  }

  .logo {
    grid-column: 1;
  }

  .logo a {
    font-size: 1rem;
  }

  .logo img {
    height: 35px;
    max-width: 100px;
  }

  .logo-text {
    display: none;
  }

  .header-search {
    display: none;
  }

  .header-icons {
    display: none;
  }

  .hamburger {
    display: flex;
    grid-column: 3;
  }

  /* 네비게이션 바 */
  .header-nav {
    display: none;
  }

  /* 푸터 반응형 */
  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .footer-links a {
    font-size: 0.8rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-section h4 {
    font-size: 1rem;
    margin-bottom: 10px;
  }

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

  .footer-section.site-info .phone {
    font-size: 1.1rem;
  }
}

@media (max-width: 600px) {
  .footer-links {
    font-size: 0.75rem;
  }

  .footer-section p {
    font-size: 0.75rem;
  }
}

/* 드로어 */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 999;
}
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }

.mobile-drawer {
  position: fixed;
  top: 0; right: -320px;
  width: 320px; max-width: 90vw;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 12px rgba(0,0,0,0.12);
  transition: right .25s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}
.mobile-drawer.open { right: 0; }
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 700;
}
.drawer-close {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
}
.drawer-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.drawer-search {
  margin-bottom: 16px;
}

.drawer-search-form {
  display: flex;
  align-items: center;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.drawer-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 12px 16px;
  font-size: 0.95rem;
  outline: none;
  background: transparent;
  color: #344054;
}

.drawer-search-input::placeholder {
  color: #98a2b3;
}

.drawer-search-clear-btn {
  background: none;
  border: none;
  color: #98a2b3;
  padding: 0 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.drawer-search-clear-btn:hover {
  color: #667085;
}

.drawer-search-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.drawer-search-btn i {
  font-size: 1.1rem;
}

.drawer-search-btn:hover {
  background: var(--primary-light);
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drawer-nav a {
  color: #333;
  text-decoration: none;
  padding: 10px 6px;
  border-radius: 6px;
}
.drawer-nav a.active { color: var(--primary-color); }
.drawer-divider {
  border: 0;
  border-top: 1px solid var(--gray-200);
  margin: 4px 0 8px;
}
.drawer-body #drawer-auth-buttons { 
  display: flex; 
  flex-direction: column;
  gap: 8px;
}

.drawer-body #drawer-user-menu { 
  flex-direction: column;
  gap: 8px;
}

.drawer-body #drawer-auth-buttons .btn, 
.drawer-body #drawer-user-menu .btn { 
  width: 100%; 
}
