/* Cache Buster: v1773559865 */
/* ========================================
   최종 헤더 레이아웃 - 로고 왼쪽, 액션 오른쪽
   ======================================== */

/* 헤더 고정 */
.app-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    background: white !important;
    border-bottom: 1px solid #E5E5E5 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

/* 헤더 내부 - Flexbox 레이아웃 */
.app-header-inner {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 12px 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    justify-content: space-between !important;
}

/* 왼쪽 그룹: 햄버거 + 로고 */
.app-sidebar-toggle,
.app-header-logo {
    flex-shrink: 0 !important;
}

/* 햄버거와 로고를 왼쪽에 붙임 */
.app-sidebar-toggle {
    margin-right: 8px !important;
}

.app-header-logo {
    margin-right: auto !important; /* 로고 뒤에 자동 여백 */
}

/* 중앙: 검색창 */
.app-header-search {
    flex: 0 1 500px !important; /* 고정 너비 */
    max-width: 500px !important;
    position: relative !important;
}

/* 오른쪽: 액션 버튼들 */
.app-header-actions {
    flex-shrink: 0 !important;
    margin-left: auto !important; /* 오른쪽 끝으로 */
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* 메인 콘텐츠 상단 여백 */
.app-main {
    margin-top: 60px !important;
}

/* 사이드바 위치 */
.app-sidebar {
    top: 60px !important;
    position: fixed !important;
}

/* 중복 헤더 숨김 */
.container > .header {
    display: none !important;
}

.container > .stats {
    display: none !important;
}

/* 정렬 컨트롤 고정 */
.sort-control {
    position: sticky !important;
    top: 60px !important;
    z-index: 999 !important;
    background: white !important;
    border-bottom: 1px solid #E5E5E5 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

/* 검색창 스타일 */
.app-header-search-input {
    width: 100% !important;
    padding: 10px 44px 10px 16px !important;
    border: 1px solid #E5E5E5 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background: #FAFAFA !important;
    transition: all 0.2s ease !important;
}

.app-header-search-input:focus {
    outline: none !important;
    border-color: #1E3A8A !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.08) !important;
}

/* 검색 아이콘 숨김 */
.app-header-search-icon {
    display: none !important;
}

/* 음성 버튼 */
.app-header-search-voice {
    position: absolute !important;
    right: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
}

.app-header-search-voice .icon {
    width: 18px !important;
    height: 18px !important;
    color: #8B5CF6 !important;
}

.app-header-search-voice:hover {
    background: #EDE9FE !important;
}

.app-header-search-voice.recording {
    background: #EDE9FE !important;
    animation: voicePulse 1.5s infinite !important;
}

@keyframes voicePulse {
    0%, 100% {
        background: #EDE9FE;
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
    }
    50% {
        background: #DDD6FE;
        box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
    }
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .app-header-inner {
        padding: 10px 12px !important;
        gap: 12px !important;
        flex-wrap: wrap !important; /* 2줄 레이아웃 */
    }
    
    /* 1줄: 햄버거 + 로고 (왼쪽) + 액션버튼들 (오른쪽) */
    .app-sidebar-toggle {
        order: 1 !important;
        margin-right: 8px !important;
    }
    
    .app-header-logo {
        order: 2 !important;
        margin-right: auto !important;
    }
    
    /* 로고 텍스트 모바일에서도 표시 */
    .app-header-logo span {
        display: inline !important;
        font-size: 16px !important;
        font-weight: 700 !important;
    }
    
    .app-header-logo .icon {
        width: 24px !important;
        height: 24px !important;
    }
    
    /* 액션 버튼들 오른쪽 */
    .app-header-actions {
        order: 3 !important;
        margin-left: auto !important;
        flex-shrink: 0 !important;
    }
    
    /* 2줄: 검색창 전체 너비 */
    .app-header-search {
        order: 4 !important;
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    .app-header-search-input {
        font-size: 14px !important;
        padding: 10px 40px 10px 14px !important;
    }
    
    .app-header-search-voice {
        width: 32px !important;
        height: 32px !important;
    }
    
    .app-header-search-voice .icon {
        width: 16px !important;
        height: 16px !important;
    }
}

/* 검색 제출 버튼 (텍스트 입력 시 표시) */
.app-header-search-submit {
    position: absolute !important;
    right: 44px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 32px !important;
    height: 32px !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    background: #1E3A8A !important;
    border: none !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
}

.app-header-search-submit .icon {
    width: 16px !important;
    height: 16px !important;
    color: #ffffff !important;
}

.app-header-search-submit:hover {
    background: #1e40af !important;
}

/* 녹음 중: 아이콘 색상을 빨간색으로 변경 (X 아이콘) */
.app-header-search-voice.recording .icon {
    color: #EF4444 !important;
}

/* 사이드바 완전 숨김 (햄버거 팝업으로 대체) */
.app-sidebar {
    display: none !important;
}

/* 사이드바 없을 때 메인 전체 너비 */
.app-main {
    margin-left: 0 !important;
}

/* 모바일: 헤더 2줄(검색창 줄바꿈) 높이 보정 */
@media (max-width: 768px) {
    .app-main {
        margin-top: 112px !important;
    }
}
