/* Header 컴포넌트 전용 스타일 */
.site-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* body에 헤더 높이만큼 패딩 추가 */
body {
    padding-top: 80px;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #4caf50;
    text-decoration: none;
    display: flex;
    align-items: center;
    height: 100%;
}

/* 로고 이미지 스타일 */
.logo img {
    max-height: 45px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* 텍스트와 이미지가 함께 있을 경우 */
.logo img + span,
.logo span + img {
    margin-left: 8px;
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    align-items: center;
}

.nav-item {
    position: relative;
    /*margin-right: 15px;
    margin-left: 15px;*/
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    padding: 25px 20px;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: #4caf50;
}

.nav-item.current .nav-link {
    color: #4caf50;
}

.sub-menu {
    position: absolute;
    top: calc(100% + 20px); /* 헤더 바로 아래에 5px 간격 */
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    z-index: 1001; /* 헤더보다 위에 표시 */
}

/* PC에서만 호버 적용 */
@media (min-width: 769px) {
    .nav-item:hover .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.sub-menu li a {
    display: block;
    padding: 8px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s;
}

.sub-menu li a:hover,
.sub-menu li a.active {
    background: #f8f9fa;
    color: #4caf50;
}

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

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-greeting {
    color: #6c757d;
    font-size: 14px;
}

.auth-links {
    display: flex;
    gap: 10px;
}

/* 헤더 버튼 스타일 */
.site-header .btn {
    display: inline-block !important;
    padding: 10px 20px !important;
    border: none !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15) !important;
    letter-spacing: 0.3px !important;
    min-width: auto !important;
}

.site-header .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
}

.site-header .btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.2);
}

.site-header .btn-outline {
    background: transparent !important;
    color: #667eea !important;
    border: 2px solid #667eea !important;
}

.site-header .btn-outline:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.2);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
}

/* Hero 섹션 스타일은 hero.css에서 분리 관리 */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle.mobile-only {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* header-actions가 없을 때 nav 확장 */
.header-content.no-actions .main-nav {
    flex: 1;
    justify-content: flex-end;
    margin-left: auto;
}

.header-content.no-actions {
    position: relative;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 2px 0;
    transition: 0.3s;
}

/* 데스크톱에서는 모바일 메뉴 요소들 숨기기 */
.mobile-menu-header,
.submenu-toggle,
.mobile-menu-backdrop {
    display: none;
}

.nav-item-wrapper {
    display: block;
    margin-right: 15px;
    margin-left: 15px;
}

/* 반응형 */
@media (max-width: 1024px) {
    .nav-link {
        font-size: 1.1rem;
        padding: 20px 15px;
    }
    .logo img {
    max-height: 35px;
    }
}

@media (max-width: 870px) {
    
    .main-nav {
        position: fixed;
        top: 0px;
        right: -280px; /* 메뉴 너비만큼 숨김 */
        width: 280px; /* 화면에 안전한 너비 */
        height: calc(100vh - 0px);
        background: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .main-nav.active {
        right: 0;
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 25px 20px;
        border-bottom: 1px solid #eee;
        background: #5a6fd8;
        width: 100%;
        flex-shrink: 0;
        order: -1;
        color: white;
    }

    .submenu-toggle {
        display: flex !important;
    }

    .main-nav .nav-menu {
        flex-direction: column;
        padding: 0;
        margin: 0;
        width: 100%;
        height: 100%;
        justify-content: flex-start;
        align-items: stretch;
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        position: static;
    }

    .company-name {
        font-size: 18px;
        font-weight: bold;
        color: #fff;
    }

    /* 768px 이하에서 logo 영역 좌측 여백 */
    .logo {
        margin-left: 10px;
    }

    /* 모바일에서 로고 이미지 크기 조정 */
    .logo img {
        max-height: 35px;
    }

    .logo a {
        font-size: 20px;
    }

    .mobile-menu-close {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #fff;
        padding: 0;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-nav .nav-item {
        border-bottom: 1px solid #eee;
        width: 100%;
        position: static;
        display: block;
        overflow: hidden;
    }

    .nav-item-wrapper {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin-right: 0;
        margin-left: 0;
        box-sizing: border-box;
        position: relative;
    }

    .main-nav .nav-link {
        padding: 20px;
        display: block;
        flex: 1;
        text-decoration: none;
        color: #333;
        font-size: 1.1rem;
        box-sizing: border-box;
        margin-right: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .submenu-toggle {
        background: none;
        border: none;
        padding: 15px 15px;
        cursor: pointer;
        font-size: 20px;
        color: #666;
        width: 50px;
        min-width: 50px;
        text-align: center;
        flex-shrink: 0;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-nav .sub-menu {
        display: none;
        background: #f8f9fa;
        width: 100%;
        margin: 0;
        padding: 0;
        list-style: none;
        position: static;
        box-shadow: none;
    }

    .main-nav .sub-menu.active {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: static !important;
        transform: none !important;
        animation: slideDown 0.3s ease-in-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .main-nav .sub-menu li {
        border-bottom: 1px solid #e0e0e0;
    }

    .main-nav .sub-menu li:last-child {
        border-bottom: none;
    }

    .main-nav .sub-menu a {
        padding: 15px 20px 15px 30px;
        display: block;
        color: #555;
        text-decoration: none;
        font-size: 1rem;
    }

    .main-nav .sub-menu a:hover {
        background: #e9ecef;
    }

    .mobile-menu-toggle,
    .mobile-menu-toggle.mobile-only {
        display: flex;
    }

    .header-actions .auth-links {
        display: none;
    }

    /* 모바일 메뉴 백드롭 */
    .mobile-menu-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        display: none;
    }

    .mobile-menu-backdrop.active {
        opacity: 1;
        visibility: visible;
        display: block;
    }
}

@media (max-width: 480px) {
    body {
            padding-top: 65px;
        }
    .header-content {
            height: 65px;
    }

    .mobile-menu-header {
            padding: 18px 20px;
    }

    .main-nav .nav-link {                    
        font-size: 1rem;
    }

    .main-nav .sub-menu a {
        font-size: 0.9rem;
    }

     .logo img {
        max-height: 30px;
    }

    .main-nav {
        width: calc(100vw - 20px); /* 좌우 10px 여백 */
        max-width: 280px;
        right: -calc(100vw - 20px);
    }

    .main-nav .nav-link {
        padding: 15px;

    }

    .submenu-toggle {
        width: 40px;
        min-width: 40px;
        padding: 12px 10px;
        font-size: 18px;
    }
}