/* 아름다운 폰트 적용 */
@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Header Design System Variables */
:root {
    --header-height: 70px; /* 좀 더 슬림한 헤더 */
    --header-total-height: var(--header-height);
    
    /* Modern Color Palette */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --bg-primary: rgba(255, 255, 255, 0.95);
    --bg-secondary: #f9fafb;
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Animation */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modern Header Container */
.layout-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    width: 100%;
    background: var(--bg-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    font-family: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 스크롤 시 헤더 효과 */
.layout-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
    border-bottom-color: var(--border-medium);
}

/* Header Container Layout */
.layout-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 40px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    gap: clamp(20px, 5vw, 40px);
}

/* 왼쪽 영역: 로고 + 네비게이션 */
.layout-header-left {
    display: flex;
    align-items: center;
    gap: 60px;
    flex: 1;
}

/* 오른쪽 영역: 검색 + 사용자 액션 */
.layout-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 로고 영역 */
.layout-header-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.layout-header-logo-img {
    height: 36px;
    width: auto;
    display: block;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
}

.layout-header-logo:hover .layout-header-logo-img {
    transform: scale(1.05);
    filter: brightness(1.1) saturate(1.1);
}

/* 메인 네비게이션 - 통합 헤더용 */
.layout-header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.layout-header-nav-item {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
}

.layout-header-nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.4;
    letter-spacing: -0.01em;
    transition: all var(--transition-base);
    border-radius: 12px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.layout-header-nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.08);
    transform: translateY(-1px);
}

.layout-header-nav-link:active {
    transform: translateY(0);
}

.layout-header-nav-link.active,
.layout-header-nav-link.hover-active {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
    font-weight: 600;
}

/* 검색 영역 - 아이콘 버튼 형태 */
.layout-header-search-container {
    position: relative;
}

.layout-header-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.layout-header-search-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.layout-header-search-btn i {
    font-size: 18px;
    transition: all 0.2s ease;
}

.layout-header-search-btn:hover i {
    transform: scale(1.1);
}

.layout-header-search-btn::placeholder {
    color: #6c757d;
}

.layout-header-search-btn {
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.layout-header-search-btn:hover {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.08);
    transform: scale(1.05);
}

/* 사용자 액션 영역 */
.layout-header-user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    min-width: 120px;
    justify-content: flex-end;
}



/* 프로필 */
.layout-header-profile-container {
    position: relative;
}

.layout-header-profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.layout-header-profile-btn .profile-image-wrapper {
    width: 32px;
    height: 32px;
}

.layout-header-profile-btn .header-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.layout-header-profile-btn .level-icon-wrapper {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.layout-header-profile-btn .level-icon {
    font-size: 12px;
}

.layout-header-profile-btn .level-text {
    font-size: 8px;
}

.layout-header-profile-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

.layout-header-profile-icon {
    width: 32px;
    height: 32px;
    font-size: 28px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f4f6;
    border: 2px solid #e9ecef;
}

.layout-header-profile-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layout-header-profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    min-width: 200px;
    z-index: 1001;
}

.layout-header-profile-dropdown a,
.layout-header-profile-dropdown button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
}

.layout-header-profile-dropdown a:hover,
.layout-header-profile-dropdown button:hover {
    background-color: rgba(0, 123, 255, 0.08);
    color: #007bff;
    text-decoration: none;
}

.layout-header-profile-dropdown .admin-item {
    color: #dc3545;
}

.layout-header-profile-dropdown .admin-item:hover {
    background-color: rgba(220, 53, 69, 0.08);
    color: #dc3545;
}

/* 로그인 버튼 */
.layout-header-login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.layout-header-login-btn:hover {
    background-color: #0056b3;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

/* 구글 로그인 아이콘 */
.layout-header-google-icon {
    width: 16px;
    height: 16px;
}

/* 프로필 드롭다운 구분선 */
.layout-header-dropdown-divider {
    margin: 8px 16px;
    border: none;
    border-top: 1px solid #e9ecef;
}

/* 모바일 메뉴 버튼 - 기본 표시 */
.layout-header-mobile-menu-btn {
    display: flex; /* 기본적으로 표시 */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    min-width: 44px;
    min-height: 44px;
}

.layout-header-mobile-menu-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.layout-header-hamburger-line {
    width: 20px;
    height: 2px;
    background-color: #333;
    border-radius: 1px;
    transition: none; /* 애니메이션 제거 */
}

/* 데스크톱에서 햄버거 메뉴 숨김 */
@media (min-width: 1025px) {
    .layout-header-mobile-menu-btn {
        display: none !important;
    }
}



/* 사용자 액션 영역 (알림, 프로필 등) */
.layout-header-user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 프로필 버튼 */
.layout-header-profile-btn {
    position: relative;
    padding: 8px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}


/* 로그인 버튼 */
.layout-header-login-btn {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.layout-header-login-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.layout-header-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    color: #333333;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
    position: relative;
    min-height: 48px;
    box-sizing: border-box;
}

/* 밑줄 효과를 ::after로 구현 */
.layout-header-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #007bff;
    transform: translateX(-50%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.layout-header-nav-link:hover,
.layout-header-nav-link.hover-active {
    color: #007bff;
    text-decoration: none;
}

.layout-header-nav-link:hover::after,
.layout-header-nav-link.hover-active::after {
    width: 80%;
}

.layout-header-nav-link.active {
    color: #007bff;
    font-weight: 600;
}

.layout-header-nav-link.active::after {
    width: 100%;
}

/* 개별 네비게이션 드롭다운 */
.layout-header-nav-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    min-width: 220px;
    max-width: 280px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.layout-header-nav-item:hover .layout-header-nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.layout-header-dropdown-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(233, 236, 239, 0.3);
}

.layout-header-dropdown-link:last-child {
    border-bottom: none;
}

.layout-header-dropdown-link:hover {
    background-color: rgba(0, 123, 255, 0.05);
    color: #007bff;
}

/* 커뮤니티 드롭다운 특별 스타일 */
.layout-header-nav-item:nth-child(3) .layout-header-nav-dropdown {
    min-width: 280px;
}

.layout-header-board-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(233, 236, 239, 0.3);
}

.layout-header-board-link:last-child {
    border-bottom: none;
}

.layout-header-board-link:hover {
    background-color: rgba(0, 123, 255, 0.05);
    color: #007bff;
    transform: translateX(4px);
}

.layout-header-board-count {
    background-color: #007bff;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
    line-height: 1;
}

/* 드롭다운 화살표 아이콘 */
.layout-header-nav-link i {
    margin-left: 6px;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.layout-header-nav-item:hover .layout-header-nav-link i {
    transform: rotate(180deg);
}



/* 동적 게시판 메뉴 */
.layout-header-dynamic-boards {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.layout-header-board-link {
    padding: 10px 16px;
    text-decoration: none;
    font-size: 14px;
    color: #333333 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 6px;
    margin: 2px 0;
}

.layout-header-board-link:hover {
    text-decoration: none;
    color: #007bff !important;
    background-color: rgba(0, 123, 255, 0.08);
    transform: translateY(-1px);
}

.layout-header-board-count {
    display: none;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1024px) {
    .layout-header-top-container {
        padding: 0 16px;
        gap: 16px;
    }
    
    .layout-header-search-area {
        max-width: 300px;
    }
    
    .layout-header-bottom-container {
        padding: 0 16px;
    }
    
    .layout-header-nav-link {
        padding: 16px 20px;
        font-size: 15px;
    }
    
    .layout-header-nav-dropdown {
        min-width: 200px;
    }
}

/* 모바일 메뉴 버튼 */
.layout-header-mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.layout-header-mobile-menu-btn:hover {
    background-color: #f8f9fa;
}

.layout-header-hamburger-line {
    width: 20px;
    height: 2px;
    background-color: #333;
    transition: all 0.3s ease;
    border-radius: 1px;
}

/* 데스크톱에서 모바일 네비게이션 숨김 */
.layout-header-mobile-nav {
    display: none;
}

/* 모바일 사이드바 오버레이 */
.mobile-sidebar-overlay {
    display: none;
}

.mobile-sidebar-overlay.active {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

/* 모바일 사이드바 메뉴 */
.layout-header-mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    height: 100dvh; /* 동적 뷰포트 높이 지원 */
    background: white;
    z-index: 1001;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* iOS 부드러운 스크롤 */
    overscroll-behavior: contain; /* 스크롤 범위 제한 */
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    /* 스크롤바 스타일링 */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* WebKit 스크롤바 스타일 */
.layout-header-mobile-nav::-webkit-scrollbar {
    width: 6px;
}

.layout-header-mobile-nav::-webkit-scrollbar-track {
    background: transparent;
}

.layout-header-mobile-nav::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.layout-header-mobile-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* hidden 상태 - 최고 우선순위 */
.layout-header-mobile-nav.hidden {
    display: none !important;
}

/* 사이드바 열려있을 때 body 스크롤 방지 */
body.sidebar-open,
body.mobile-menu-open {
    overflow: hidden;
    position: fixed; /* iOS에서 더 확실한 스크롤 방지 */
    width: 100%;
    height: 100vh;
    touch-action: none; /* 터치 스크롤 완전 차단 */
}

/* 모바일 및 태블릿 대응 */
@media (max-width: 1024px) {
    .layout-header {
        position: sticky; /* 모바일에서도 sticky 유지 */
        top: 0;
        z-index: 1020;
    }
    
    .layout-header-container {
        flex-direction: row; /* 한 줄로 유지 */
        padding: 12px 16px;
        gap: 16px;
        min-height: 60px;
        justify-content: space-between;
        align-items: center;
    }
    
    .layout-header-left {
        flex: 0 0 auto;
        justify-content: flex-start;
        align-items: center;
        gap: 16px;
    }
    
    .layout-header-nav {
        display: none; /* 데스크톱 네비게이션 숨김 */
    }
    
    .layout-header-right {
        flex: 0 0 auto;
        justify-content: flex-end;
        align-items: center;
        gap: 8px; /* 버튼 간격 줄임 */
    }
    
    /* 사용자 액션 버튼들 크기 조정 */
    .layout-header-user-actions {
        gap: 8px;
    }
    
    .layout-header-search-btn,
    .layout-header-profile-btn {
        min-width: 44px; /* 터치 친화적 크기 */
        min-height: 44px;
        padding: 8px;
        border-radius: 8px;
    }
    
    .layout-header-mobile-menu-btn {
        display: flex; /* 모바일에서만 표시 */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-width: 44px;
        min-height: 44px;
        margin-left: 8px;
        gap: 4px;
    }
    
    /* 드롭다운 위치 조정 - 알림, 프로필만 */
    
    .layout-header-notification-dropdown,
    .layout-header-profile-dropdown {
        position: fixed;
        top: 60px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
        min-width: auto;
        transform: translateY(-8px);
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }
    
    .layout-header-profile-dropdown.main-show {
        transform: translateY(0);
    }
    
    /* 모바일 프로필 버튼 - 컴팩트하게 */
    .layout-header-profile-btn {
        gap: 8px;
        padding: 4px 8px;
    }
    
    .layout-header-profile-btn .profile-image-wrapper {
        width: 28px;
        height: 28px;
    }
    
    .layout-header-profile-img {
        width: 28px;
        height: 28px;
    }
    
    .layout-header-profile-btn .header-user-info {
        gap: 6px;
    }
    
    .layout-header-profile-btn .level-icon-wrapper {
        width: 28px;
        height: 28px;
    }
    
    .layout-header-profile-btn .level-icon {
        font-size: 10px;
    }
    
    .layout-header-profile-btn .level-text {
        font-size: 7px;
    }
    
    /* 프로필 닉네임 - 모바일에서도 표시 */
    .layout-header-profile-name {
        font-size: 12px;
        max-width: 80px;
    }
    
    /* 로그인 버튼 텍스트 조정 */
    .layout-header-login-btn span {
        display: none;
    }
    
    .layout-header-login-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
        justify-content: center;
    }
    
    /* 모바일 사이드바 메뉴 활성화 */
    .layout-header-mobile-nav {
        display: block;
    }
    
    /* hidden 상태는 우선순위 높게 */
    .layout-header-mobile-nav.hidden {
        display: none !important;
    }
    
    /* 사이드바 헤더 - 심플하고 깔끔하게 */
    .mobile-sidebar-header {
        height: 60px;
        padding: 0 20px;
        background: white;
        border-bottom: 1px solid #e9ecef;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .mobile-sidebar-logo {
        font-size: 18px;
        font-weight: 600;
        color: #333;
        display: flex;
        align-items: center;
    }
    
    .mobile-sidebar-close {
        background: none;
        border: none;
        font-size: 24px;
        color: #999;
        cursor: pointer;
        padding: 8px;
        line-height: 1;
        transition: color 0.2s ease;
        border-radius: 6px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-sidebar-close:hover {
        color: #666;
        background: #f1f3f5;
    }
    
    /* 사이드바 메뉴 아이템들 - 심플하게 */
    .layout-header-mobile-nav-item {
        border-bottom: none;
    }
    
    .layout-header-mobile-nav-header {
        padding: 20px 24px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: white;
        cursor: pointer;
        transition: all 0.2s ease;
        min-height: 60px;
        border-bottom: 1px solid #f1f3f5;
    }
    
    .layout-header-mobile-nav-header:hover {
        background: #f8f9fa;
    }
    
    .layout-header-mobile-nav-title {
        font-size: 16px;
        font-weight: 500;
        color: #333;
        flex: 1;
    }
    
    .layout-header-mobile-nav-toggle {
        font-size: 16px;
        color: #999;
        transition: all 0.2s ease;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
    }
    
    .layout-header-mobile-nav-toggle:hover {
        color: #666;
    }
    
    .layout-header-mobile-nav-toggle.active {
        transform: rotate(90deg);
        color: #007bff;
    }
    
    .layout-header-mobile-nav-dropdown {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .layout-header-mobile-nav-dropdown.active {
        max-height: 400px;
    }
    
    .layout-header-mobile-nav-dropdown a {
        display: block;
        padding: 16px 24px;
        color: #666;
        text-decoration: none;
        font-size: 15px;
        border-bottom: 1px solid #f1f3f5;
        transition: all 0.2s ease;
        border-radius: 8px 0 0 8px;
    }
    
    .layout-header-mobile-nav-dropdown a:hover {
        background: #f8f9fa;
        color: #007bff;
    }
    
    /* 작은 화면에서 사이드바 너비 조정 */
    @media (max-width: 480px) {
        .layout-header-mobile-nav {
            width: 300px;
            max-width: 85vw;
        }
        
        .mobile-sidebar-header {
            height: 56px;
            padding: 0 16px;
        }
        
        .layout-header-mobile-nav-header {
            padding: 18px 20px;
            min-height: 56px;
        }
        
        .layout-header-mobile-nav-dropdown a {
            padding: 14px 20px;
        }
    }
    
    .layout-header-mobile-nav-link {
        display: block;
        flex: 1;
        padding: 1rem 1.5rem 1rem 0;
        color: #333;
        text-decoration: none;
        font-weight: 500;
        font-size: 16px;
    }
    
    .layout-header-mobile-nav-title {
        display: block;
        flex: 1;
        padding: 1rem 1.5rem 1rem 0;
        color: #333;
        font-weight: 500;
        font-size: 16px;
        cursor: pointer;
    }
    
    .layout-header-mobile-nav-link:active,
    .layout-header-mobile-nav-link:focus,
    .layout-header-mobile-nav-title:active,
    .layout-header-mobile-nav-title:focus {
        color: #333 !important; /* 클릭/포커스 시 원래 색상 강제 유지 */
        outline: none; /* 포커스 아웃라인 제거 */
    }
    
    .layout-header-mobile-nav-dropdown {
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease;
    }
    
    .layout-header-mobile-nav-dropdown.active {
        max-height: 300px;
        border-top: 1px solid #e0e0e0;
    }
    
    .layout-header-mobile-nav-dropdown a {
        display: block;
        padding: 0.75rem 1.5rem;
        color: #666;
        text-decoration: none;
        font-size: 14px;
    }
    
    .layout-header-mobile-nav-dropdown a:hover {
        background: #e9ecef;
    }
    
    .layout-header-mobile-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .layout-header-mobile-nav-item {
        border-bottom: 1px solid #f0f0f0;
    }
    
    .layout-header-mobile-nav-link {
        display: block;
        padding: 16px 20px;
        color: #333;
        text-decoration: none;
        font-weight: 500;
        transition: background-color 0.2s ease;
    }
    
    .layout-header-mobile-nav-link:hover {
        background-color: #f8f9fa;
        color: #4285f4;
    }
    

}

@media (max-width: 480px) {
    .layout-header-container {
        padding: 10px 12px;
        gap: 12px;
        min-height: 56px;
    }
    
    .layout-header-logo-img {
        height: 28px;
    }
    
    .layout-header-user-actions {
        gap: 6px;
    }
    
    .layout-header-search-btn,
    .layout-header-notification-btn,
    .layout-header-profile-btn,
    .layout-header-mobile-menu-btn {
        min-width: 40px;
        min-height: 40px;
        padding: 6px;
    }
    

    
    .layout-header-profile-dropdown {
        top: 56px !important;
        right: 8px !important;
        left: 8px !important;
        width: auto !important;
        transform: translateY(-8px) !important;
    }
    
    .layout-header-profile-dropdown.main-show {
        transform: translateY(0) !important;
    }
    
    .layout-header-mobile-nav {
        max-height: calc(100vh);
    }
    
    .layout-header-mobile-nav-link {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .layout-header-mobile-nav-dropdown a {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* ===========================
   Utility Classes
   =========================== */
.main-hidden {
    display: none !important;
}

.main-visible {
    display: block !important;
}

.body-no-scroll {
    overflow: hidden !important;
}

/* 네비게이션 드롭다운 상태 */
.nav-dropdown--visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(0) !important;
    pointer-events: auto !important;
}

/* 검색 드롭다운 */
.layout-header-search-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: -10px;
    width: 300px;
    background: white;
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1015;
    overflow: hidden;
    border: 1px solid #e9ecef;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 모바일에서 검색 드롭다운 강제 위치 조정 */
@media (max-width: 768px) {
    .layout-header-search-dropdown {
        position: fixed !important;
        top: 60px !important;
        right: 12px !important;
        left: 12px !important;
        width: auto !important;
        max-width: none !important;
        min-width: auto !important;
        z-index: 1020 !important;
    }
    
    /* 모바일에서 헤더 터치 스와이프 방지 */
    .layout-header {
        touch-action: pan-y !important;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
        overscroll-behavior-x: contain !important;
    }
    
    /* 데스크톱 네비게이션 숨김 */
    .layout-header-nav {
        display: none;
    }
    
    /* 햄버거 메뉴 버튼 표시 */
    .layout-header-mobile-menu-btn {
        display: flex !important;
    }
    
    /* 모바일 네비게이션 표시 */
    .layout-header-mobile-nav {
        display: block;
    }
    
    /* 모바일 메뉴 열렸을 때 배경 스크롤 방지 - 통합 */
    body.mobile-menu-open,
    body.sidebar-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100vh !important;
        touch-action: none !important;
    }
    
    /* 모바일 네비게이션 자체는 스크롤 허용 */
    .layout-header-mobile-nav {
        touch-action: pan-y !important; /* 세로 스크롤만 허용 */
    }
}

@media (max-width: 480px) {
    .layout-header-search-dropdown {
        top: 56px !important;
        right: 8px !important;
        left: 8px !important;
    }
}

/* 검색 드롭다운 위치 조정 */
.layout-header-search-dropdown.search-dropdown--left-align {
    right: 0;
    left: auto;
}

.layout-header-search-dropdown.search-dropdown--right-align {
    right: -10px;
    left: auto;
}

.layout-header-search-dropdown.main-show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.layout-header-search-form {
    padding: 16px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.layout-header-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.layout-header-search-input:focus {
    border-color: #007bff;
}

.layout-header-search-submit {
    padding: 12px;
    background-color: #007bff;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-header-search-submit:hover {
    background-color: #0056b3;
}

/* Body 스크롤 방지 */
.body-no-scroll {
    overflow: hidden !important;
}

/* CSS 변수를 사용한 헤더 높이 설정 */
body {
    padding-top: 0; /* sticky 헤더이므로 padding 불필요 */
}

/* 드롭다운 hover 효과 */
.layout-header-nav-item:hover .layout-header-nav-link::after {
    width: 80%;
}

/* 드롭다운 활성화 상태 */
.layout-header-nav-item.dropdown-active .layout-header-nav-link::after {
    width: 80%;
}

.layout-header-nav-item.dropdown-active .layout-header-nav-link i {
    transform: rotate(180deg);
}

/* 로딩 상태 */
.layout-header--loading .layout-header-search-btn {
    pointer-events: none;
}

.layout-header--loading .layout-header-search-btn svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 포커스 스타일 (접근성) */
.layout-header-nav-link:focus,
.layout-header-notification-btn:focus,
.layout-header-profile-btn:focus,
.layout-header-search-btn:focus,
.layout-header-login-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-radius: 4px;
}

/* 스크롤바 스타일링 */
.layout-header-notification-list::-webkit-scrollbar {
    width: 6px;
}

.layout-header-notification-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.layout-header-notification-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.layout-header-notification-list::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}



/* 애니메이션 성능 최적화 */
.layout-header-mega-menu,
.layout-header-notification-dropdown,
.layout-header-profile-dropdown {
    will-change: opacity, transform, visibility;
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    .layout-header-mega-menu,
    .layout-header-notification-dropdown,
    .layout-header-profile-dropdown,
    .layout-header-nav-link,
    .layout-header-mega-menu-link,
    .layout-header-board-link {
        transition: none;
    }
}

/* 고해상도 디스플레이 대응 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .layout-header-logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===========================
   로그아웃 확인 모달
   =========================== */
.logout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.logout-modal.show {
    opacity: 1;
    visibility: visible;
}

.logout-modal-content {
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.logout-modal.show .logout-modal-content {
    transform: translateY(0);
}

.logout-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    font-family: 'Pretendard', sans-serif;
}

.logout-modal-message {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 24px 0;
}

.logout-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.logout-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: 'Pretendard', sans-serif;
}

.logout-confirm-btn {
    background: #dc3545;
    color: white;
}

.logout-confirm-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.logout-cancel-btn {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.logout-cancel-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .logout-modal-content {
        margin: 20px;
        padding: 24px;
        width: calc(100% - 40px);
    }
    
    .logout-modal-buttons {
        flex-direction: column;
    }
    
    .logout-modal-btn {
        width: 100%;
        padding: 14px;
    }
}
