/* [최종 통합본] /css/header_v2.css */

/* ====================================================== */
/* 1. 기본 헤더 및 메뉴 스타일 (PC) */
/* ====================================================== */

/* 라이트 모드 헤더: 흰색 배경 + 상단 파란색 라인 + 글라스 효과 */
header.glass-header {
    position: sticky;
    top: 0;
    z-index: 50;
    isolation: isolate;
    background: rgba(255, 255, 255, 0.85); /* 흰색 배경에 85% 투명도 적용 */
    border-bottom: 1px solid rgba(229, 231, 235, 0.7); /* 경계선에도 투명도 적용 */
    box-shadow: 0 4px 12px -1px rgba(0, 0, 0, 0.07); /* 그림자 부드럽게 조절 */
    -webkit-backdrop-filter: blur(10px) saturate(150%); /* 웹킷 브라우저용 글라스 효과 */
    backdrop-filter: blur(10px) saturate(150%); /* 표준 글라스 효과 */
}
/* 상단 파란색 라인 */
header.glass-header::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffffff, #fafcff);
    opacity: 0.9;
}

/* 다크 모드 헤더: Glassmorphism 스타일 */
body.dark-mode .glass-header {
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    backdrop-filter: blur(12px) saturate(160%);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(59,130,246,.16)), rgba(17,25,40, .28);
    border-bottom-color: rgba(56,189,248,.22);
    box-shadow: 0 10px 26px rgba(0,0,0,.35);
}

/* [Fix] 다크모드 헤더 메뉴의 불필요한 배경색 제거 */
body.dark-mode header.glass-header .group {
    background-color: transparent;
    border-color: transparent;
}

/* PC 메뉴 링크 */
.menu-link {
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    color: #0f172a; /* slate-900 */
}
.menu-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
}
body.dark-mode .menu-link {
    color: #e2e8f0; /* slate-200 */
}
body.dark-mode .menu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* PC 드롭다운 메뉴 */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(255, 255, 255, 0.99);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    backdrop-filter: blur(10px) saturate(150%);
    min-width: 220px;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 0.75rem;
    padding: 8px 0;
    margin-top: 10px;
    right: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    border: 1px solid rgba(255,255,255,0.3);
}
.group:hover .dropdown-content {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* JS에서 .open 줄 때도 열림 유지 */
.group.open .dropdown-content { display:block; opacity:1; transform:translateY(0); }

/* hover 영역을 확장하는 브리지 */
.dropdown-content::before {
    content:"";
    position:absolute;
    left:0; right:0;
    top:-12px; height:12px;
}

.dropdown-content a {
    color: #374151; /* gray-700 */
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.875rem;
    transition: background-color 0.2s;
    white-space: nowrap;
}
.dropdown-content a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}
body.dark-mode .dropdown-content {
    background-color: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
}
body.dark-mode .dropdown-content a {
    color: #d1d5db; /* gray-300 */
}
body.dark-mode .dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}


/* ====================================================== */
/* 2. 모바일 하단 메뉴 패널 스타일 */
/* ====================================================== */

/* 메뉴가 활성화될 때 뒤에 깔리는 어두운 배경 */
.mobile-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040; /* 메뉴 패널보다 한 단계 아래 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
body.mobile-menu-active .mobile-menu-backdrop {
    opacity: 1;
    visibility: visible;
}

/* 메뉴 패널 본체 */
.mobile-menu-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #ffffff;
    z-index: 1050;
    border-top-left-radius: 1.5rem; /* 24px */
    border-top-right-radius: 1.5rem; /* 24px */
    box-shadow: 0 -10px 30px rgba(0,0,0,0.1);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(.29, .68, .22, 1);
    max-height: 70vh; /* 화면의 70% 이상은 넘지 않도록 */
    overflow-y: auto;
}
body.mobile-menu-active .mobile-menu-panel {
    transform: translateY(0);
}
body.dark-mode .mobile-menu-panel {
    background-color: #1e293b; /* slate-800 */
    box-shadow: 0 -10px 30px rgba(0,0,0,0.3);
}

/* 메뉴 콘텐츠 영역 */
.mobile-menu-panel .menu-content {
    padding: 2rem 0 1rem;
}

/* 대메뉴 링크 */
.main-menu-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem; /* 16px 24px */
    font-size: 1.125rem; /* 18px */
    font-weight: 700;
    color: #111827; /* gray-900 */
    cursor: pointer;
}
.main-menu-link::after {
    content: '';
    width: 0.625rem; /* 10px */
    height: 0.625rem; /* 10px */
    border: solid #6b7280; /* gray-500 */
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}
.main-menu-link.active::after {
    transform: rotate(225deg);
}
body.dark-mode .main-menu-link {
    color: #f3f4f6; /* gray-100 */
}
body.dark-mode .main-menu-link::after {
    border-color: #9ca3af; /* gray-400 */
}

/* 소메뉴 리스트 */
.submenu-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    background-color: #f9fafb; /* gray-50 */
}
body.dark-mode .submenu-items {
    background-color: #374151; /* gray-700 */
}

/* 소메뉴 링크 */
.submenu-items a {
    display: block;
    padding: 0.75rem 2.5rem; /* 12px 40px, 들여쓰기 효과 */
    color: #374151; /* gray-700 */
    font-size: 1rem; /* 16px */
}
body.dark-mode .submenu-items a {
    color: #d1d5db; /* gray-300 */
}
.submenu-items a:hover {
    background-color: #f3f4f6;
}
body.dark-mode .submenu-items a:hover {
    background-color: #4b5563; /* gray-600 */
}


/* ====================================================== */
/* 3. 기타 및 반응형 설정 */
/* ====================================================== */

/* 햄버거 버튼 색상 */
#menu-button {
    color: #374151; /* gray-700 */
}
body.dark-mode #menu-button {
    color: #ffffff;
}

/* 테마 아이콘 애니메이션 */
#theme-toggle-btn i, #mobile-theme-toggle-btn i {
    transition: transform 0.4s ease-in-out;
}


/* ====================================================== */
/* 4. 테마별 로고 변경 스타일 */
/* ====================================================== */

.logo-dark { display: none; }
.logo-light { display: block; }
body.dark-mode .logo-dark { display: block; }
body.dark-mode .logo-light { display: none; }


/* ====================================================== */
/* 5. 모바일 프로필 드롭다운 메뉴 */
/* ====================================================== */

.profile-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px); /* 아이콘 바로 아래에 위치 */
    right: 0;
    width: 180px;
    background-color: #ffffff;
    border-radius: 0.75rem; /* 12px */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #f3f4f6; /* gray-100 */
    z-index: 1100;
    padding: 0.5rem; /* 8px */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.profile-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

body.dark-mode .profile-dropdown-menu {
    background-color: #374151; /* gray-700 */
    border-color: #4b5563; /* gray-600 */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem; /* 12px */
    border-radius: 0.5rem; /* 8px */
    font-size: 1rem; /* 16px */
    color: #374151; /* gray-700 */
    text-align: left;
    transition: background-color 0.2s;
    cursor: pointer;
}

.profile-menu-item:hover {
    background-color: #f3f4f6; /* gray-100 */
}

.profile-menu-item i {
    width: 24px;
    margin-right: 0.75rem; /* 12px */
    text-align: center;
    color: #6b7280; /* gray-500 */
}

body.dark-mode .profile-menu-item {
    color: #e5e7eb; /* gray-200 */
}
body.dark-mode .profile-menu-item:hover {
    background-color: #4b5563; /* gray-600 */
}
body.dark-mode .profile-menu-item i {
    color: #9ca3af; /* gray-400 */
}

/* 헤더 로그인 버튼*/
body.dark-mode #desktop-login-area button,
body.dark-mode #mobile-login-area button {
    background-color: #374151; /* gray-700 */
}
body.dark-mode #desktop-login-area button:hover,
body.dark-mode #mobile-login-area button:hover {
    background-color: #4b5563; /* gray-600 */
}

/* 드롭다운 안에서 버튼을 링크처럼 보이게 */
.dropdown-content button { 
  display:block; width:100%; text-align:left; padding:10px 16px; font-size:.875rem;
}