/* ================================================================
   [Theme Variables] 라이트/다크 테마 설정
   ================================================================ */
:root {
    /* 라이트 모드 */
    --nav-bg: #ffffff;
    --nav-bg-rgba: rgba(255, 255, 255, 0.85);
    --nav-text: #111111;
    --nav-text-sub: #666666;
    --nav-border: #f2f2f2;
    --nav-border-light: #eeeeee;
    --nav-sub-bg: #f9f9f9;
    --nav-accent: #4ec09a;
    --nav-title: #002c5f;
    --logo-filter: none;

    /* 그림자 디자인 */
    --nav-shadow: 0 40px 40px rgba(0, 0, 0, 0.1);
    --container-shadow: 0 4px 24px color-mix(in srgb, #000 8%, transparent),
                        0 0 40px color-mix(in srgb, #000 5%, transparent);

    /* 보더 두께 설정 */
    --custom-border-strong: #7f858a;
}

[data-bs-theme="dark"] {
    /* 다크 모드 */
    --nav-bg: #121212;
    --nav-bg-rgba: rgba(18, 18, 18, 0.85);
    --nav-text: #ffffff;
    --nav-text-sub: #bbbbbb;
    --nav-border: #333333;
    --nav-border-light: #252525;
    --nav-sub-bg: #1a1a1a;
    --nav-accent: #4ec09a;
    --nav-title: #ffffff;
    --logo-filter: brightness(0) invert(1);

    --nav-shadow: 0 40px 40px rgba(0, 0, 0, 0.5);
    --container-shadow: 0 4px 24px rgba(0, 0, 0, 0.6),
                        0 0 40px rgba(0, 0, 0, 0.4);

    --custom-border-strong: var(--bs-border-color);
}

/* ================================================================
   1. 기본 초기화
   ================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--nav-text);
    line-height: 1.5;
    background-color: var(--nav-bg);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ================================================================
   2. 헤더 레이아웃
   ================================================================ */
#header {
    /*position: fixed;*/
    /*position: sticky;*/
    position: relative; /* 서브메뉴가 헤더를 기준으로 위치 잡게 함 */
    top: 0;
    left: 0;
    width: 100%;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    z-index: 1000;
}

.navigation-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--container-shadow);
    background: var(--nav-bg-rgba);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--nav-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    height: 90px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
}

.logo img,
.mb-logo {
    height: 56px;
    filter: var(--logo-filter);
}

/* ================================================================
   3. PC GNB
   ================================================================ */
.pc-nav .gnb-list {
    display: flex;
    gap: 80px;
}

.gnb-trigger, .gnb-trigger-nosub {
    font-size: 16px;
    font-weight: 700;
    padding: 33px 0;
    display: block;
    color: var(--nav-text);
}

.has-sub {
    position: static;
}

/* ================================================================
   4. PC 서브메뉴 패널
   ================================================================ */
.depth2-wrap {
    position: absolute;
    /*top: 91px;*/
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border-light);
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease-in-out;
    z-index: 999;
}

.depth2-wrap.is-open {
    height: auto;
    min-height: 180px;
    padding-bottom: 30px;
    box-shadow: var(--nav-shadow);
}

.sub-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 25%;
    display: flex;
    justify-content: center;
}

.align-box {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
}

.sub-title-area h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--nav-title);
    text-align: left;
    margin-bottom: 20px;
}

/* ================================================================
   5. PC 서브메뉴 리스트
   ================================================================ */
.sub-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px 20px;
    width: 100%;
}

.sub-menu a {
    display: inline-block;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 16px;
    color: var(--nav-text-sub);
    transition: 0.2s;
}

.sub-menu a:hover {
    color: var(--nav-accent);
    font-weight: 700;
}

/* ================================================================
   6. 서브 헤더 (Breadcrumb)
   ================================================================ */
.sub-header {
    margin-top: 91px;
    border-bottom: 1px solid var(--nav-border);
}

.breadcrumb {
    padding: 18px 0;
    font-size: 14px;
    color: var(--nav-text-sub);
}

.breadcrumb span::before {
    content: '';
    display: inline-block;
    width: 1px;
    height: 12px;
    background: var(--nav-border);
    margin-right: 15px;
    vertical-align: middle;
}

/* ================================================================
   7. 모바일 메뉴 레이아웃
   ================================================================ */
.mobile-toggle {
    display: none;
    cursor: pointer;
    color: var(--nav-text);
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: var(--nav-bg);
    z-index: 2000;
    transition: 0.4s ease;
    display: flex;
    flex-direction: column;
}

.mobile-nav.active {
    right: 0;
}

.mb-panel-header {
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--nav-border-light);
}

.mb-logo {
    height: 40px;
    filter: var(--logo-filter);
}

/* X 버튼 (SVG 네모 박스 방지 적용) */
.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--nav-text);
    display: flex;
    align-items: center;
    /* 부드러운 애니메이션을 위한 설정 */
  transition: transform 0.4s ease-in-out, background-color 0.3s;
}

/* 호버 시 효과 */
.close-btn:hover {
  /* 180도 회전 */
  transform: rotate(180deg);

  /* 색상 반전 효과 (선택 사항) */
  /*background-color: #fff;*/
}

.close-icon::before { transform: rotate(45deg); }
.close-icon::after { transform: rotate(-45deg); }

/* 닫기 버튼 SVG 색상 대응 */
.close-btn svg path {
    stroke: currentColor;
    stroke-width: 2;
}

.mb-title {
    width: 100%;
    text-align: left;
    padding: 20px 40px;
    font-size: 18px;
    font-weight: 700;
    background: none;
    border: none;
    border-bottom: 1px solid var(--nav-border-light);
    color: var(--nav-text);
}

/* ================================================================
   8. 모바일 서브메뉴
   ================================================================ */
.mb-depth2 {
    background: var(--nav-sub-bg);
    display: none;
    padding: 15px 20px;
    flex-wrap: wrap;
}

/* JS가 클릭 시 display: block을 주면 그 때만 flex로 작동 */
.mb-depth2[style*="display: block"] {
    display: flex !important;
}

.mb-depth2 li {
    width: 50%;
}

.mb-depth2 li a {
    display: block;
    padding: 10px;
    font-size: 15px;
    color: var(--nav-text-sub);
}

/* ================================================================
   9. 오버레이
   ================================================================ */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--nav-overlay, rgba(0, 0, 0, 0.6));
    z-index: 1500;
    display: none !important;
}
/* 최상단 바 설정 */
.top-util-bar {
    width: 100%;
    background-color: #f8f8f8; /* 아주 연한 회색 배경으로 영역 구분 */
    /*border-bottom: 1px solid #eee;*/
    padding: 5px 40px; /* 좌측 끝 여백 조절 */
    display: flex;
    justify-content: flex-end; /* 좌측 정렬 */
    align-items: center;
}

.user-status-left {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
}

.user-name strong {
    color: #000; /* 유저 이름은 블랙으로 강조 */
    margin-right: 2px;
}

.divider {
    margin: 0 10px;
    color: #ddd;
}

.top-logout-btn {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.top-logout-btn:hover {
    color: #000;
    text-decoration: underline;
}

/* 메인 헤더와의 간격 조정 */
.header-inner {
    padding-top: 10px; /* 상단 바가 생겼으므로 여백 조절 */
}

/* 유저 프로필 섹션 전체 */
.mb-user-profile {
    padding: 25px 20px;
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px; /* 아래 메뉴와의 간격 */
}

/* 텍스트 영역 */
.user-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-greeting {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-name {
    font-size: 1.1rem;
    color: #333;
}

.user-name strong {
    color: #000;
    font-weight: 700;
}

/* 로그아웃 버튼 (블랙 버튼 스타일) */
.mb-logout-btn {
    font-size: 12px;
    color: #ffffff;
    background-color: #000000;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.mb-logout-btn:hover {
    background-color: #333333;
}

/* 메뉴 리스트 여백 조정 */
.mb-menu-list ul {
    padding: 0 10px;
}


/* 모바일에서는 상단 바 숨기기 (선택 사항) */
@media (max-width: 1024px) {
    .top-util-bar {
        display: none;
    }
}
/* ================================================================
   10. 반응형 설정
   ================================================================ */
@media (max-width: 1130px) {
    .pc-nav {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .header-inner {
        height: 70px;
        padding: 0 20px;
    }

    .sub-header {
        margin-top: 71px;
    }

    .mobile-nav.active ~ .overlay.active {
        display: block !important;
    }
}

@media (min-width: 1130px) {
    /* PC에서는 오버레이 강제 차단 */
    .overlay {
        display: none !important;
    }

    /* 창 크기 조절 시 모바일 메뉴 강제 숨김 */
    .mobile-nav {
        display: none;
    }
}

/* 모바일 메뉴 리스트 항목 클릭(터치) 시 효과 */
.mb-menu-list li a:active {
    background-color: var(--nav-sub-bg);
    color: var(--accent-color) !important;
}

@media (hover: hover) {
    /* 마우스가 있는 기기에서만 호버 작동 */
    .mb-menu-list li a:hover {
        color: var(--accent-color);
    }
}