/* 헤더 전용 격리된 스타일 - 모든 선택자에 .header-isolated 접두사 사용 */

/* 헤더 컨테이너 리셋 */
.header-isolated {
    /* 리셋 - 외부 스타일의 영향을 차단 */
    all: initial;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: block;
    width: 100%;
    position: relative;
    z-index: 1000;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.header-isolated * {
    /* 모든 자식 요소 리셋 */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: inherit;
}

/* 헤더 네비게이션 바 */
.header-isolated .hdr-navbar {
    background-color: #2c3e50;
    padding: 0.4rem 0;
    width: 100%;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    transform: none !important;
    transition: none !important;
}

.header-isolated .hdr-container {
    width: calc(100% - 40px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: relative !important;
    box-sizing: content-box !important;
}

/* 브랜드 로고 */
.header-isolated .hdr-nav-brand {
    flex-shrink: 0;
}

.header-isolated .hdr-brand-link {
    color: #fff !important;
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none !important;
    display: inline-block;
}

.header-isolated .hdr-brand-link:hover {
    color: #fff !important;
    text-decoration: none !important;
}

/* 네비게이션 메뉴 */
.header-isolated .hdr-nav-menu {
    display: flex;
    list-style: none !important;
    gap: 0.5rem;
    align-items: center;
    margin: 0 !important;
    padding: 0 !important;
}

.header-isolated .hdr-nav-item {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    position: relative;
}

.header-isolated .hdr-nav-link {
    color: #ecf0f1 !important;
    text-decoration: none !important;
    padding: 0.3rem 0.7rem !important;
    transition: background-color 0.3s;
    font-size: 0.9rem;
    display: inline-block;
    border-radius: 4px;
}

.header-isolated .hdr-nav-link:hover {
    background-color: #34495e !important;
    color: #ecf0f1 !important;
    text-decoration: none !important;
}

/* 사용자 정보 컨테이너 */
.header-isolated .hdr-user-info {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    width: 190px !important;
    border: 1px solid #ecf0f1 !important;
    border-radius: 4px !important;
    padding: 0.4rem 0.6rem !important;
    justify-content: center !important;
}

/* 프로필 사진 스타일 */
.header-isolated .hdr-profile-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ecf0f1;
    background-color: #fff;
    flex-shrink: 0;
}

/* 사용자 이름 스타일 */
.header-isolated .hdr-user-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

/* 로그아웃 폼 */
.header-isolated .hdr-logout-form {
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block;
}

/* 로그아웃 버튼을 오른쪽 끝으로 */
.header-isolated .hdr-nav-item:has(.hdr-logout-form) {
    margin-left: auto !important;
}

.header-isolated .hdr-logout-btn {
    background-color: #e74c3c !important;
    color: white !important;
    border: none !important;
    padding: 0.3rem 0.7rem !important;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-size: 0.9rem;
    font-family: inherit;
}

.header-isolated .hdr-logout-btn:hover {
    background-color: #c0392b !important;
}

/* 알림 배지 스타일 */
.header-isolated .hdr-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 5px;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .header-isolated .hdr-navbar {
        padding: 0.5rem 0;
    }

    .header-isolated .hdr-container {
        flex-direction: column;
        align-items: stretch;
        width: calc(100% - 20px) !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .header-isolated .hdr-nav-brand {
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .header-isolated .hdr-brand-link {
        font-size: 1.1rem;
    }

    .header-isolated .hdr-nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.3rem;
        width: 100%;
    }

    .header-isolated .hdr-nav-link {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem !important;
    }

    .header-isolated .hdr-user-info {
        width: auto !important;
        padding: 0.25rem 0.5rem !important;
    }

    .header-isolated .hdr-user-info span {
        max-width: 100px;
        font-size: 0.8rem;
    }

    .header-isolated .hdr-profile-img {
        width: 24px;
        height: 24px;
    }

    .header-isolated .hdr-logout-btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem !important;
    }

    .header-isolated .hdr-badge {
        font-size: 9px;
        min-width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .header-isolated .hdr-brand-link {
        font-size: 1rem;
    }

    .header-isolated .hdr-nav-link {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem !important;
    }

    .header-isolated .hdr-user-info span {
        max-width: 80px;
        font-size: 0.75rem;
    }

    .header-isolated .hdr-logout-btn {
        font-size: 0.75rem;
    }
}