/* Custom styles for Developer Admin */

/* 메인 콘텐츠로 이동 링크 숨기기 */
.skip-to-content-link,
a[href="#content"] {
    display: none !important;
}

/* 사이드바 필터 검색 인풋박스 숨기기 */
#nav-filter,
nav#nav-sidebar input[type="text"],
.sidebar input[type="text"] {
    display: none !important;
}

/* 헤더 user-tools 한 줄 표시 */
#user-tools {
    display: flex;
    align-items: center;
    gap: 5px;
}

#user-tools form {
    display: inline;
    margin: 0;
}

#user-tools form button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
}

#user-tools form button:hover {
    text-decoration: underline;
}

/* 사이드바 토글 버튼 및 검은박스 숨기기 */
#toggle-nav-sidebar,
.toggle-nav-sidebar,
button[aria-label*="sidebar"],
button[aria-label*="Toggle"],
#header .theme-toggle,
.theme-toggle {
    display: none !important;
}

/* ===== 사이드바 + 레이아웃 수정 ===== */
/* Django의 .shifted 클래스가 margin-left: 250px를 추가하는데, 토글 버튼을 숨겼으므로 제거 */
.main,
.main.shifted {
    display: flex !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* 사이드바 - 왼쪽 여백 없이 바로 표시 */
.main > #nav-sidebar {
    visibility: visible !important;
    display: block !important;
    position: sticky !important;
    left: 0 !important;
    margin-left: 0 !important;
    flex: 0 0 275px !important;
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
}

/* Django가 사이드바에 추가하는 숨김 클래스 무력화 */
#nav-sidebar[style*="display: none"],
#nav-sidebar.hidden {
    display: block !important;
    visibility: visible !important;
}

/* 콘텐츠 영역 - 남은 공간 채우기 + 가로 스크롤 */
.main > .content {
    flex: 1 !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow-x: auto !important;
}

/* ===== Admin 로그인 페이지 - 템플릿에서 인라인 스타일로 처리 ===== */
body.login .main {
    display: block !important;
    width: 100% !important;
    margin-left: 0 !important;
}

/* Admin 메인(index) 페이지 - 사이드바 없을 때 full width */
.main:not(:has(#nav-sidebar)) {
    display: block !important;
    width: 100% !important;
}

/* ===== 목록 테이블 ===== */
/* 결과 테이블 컨테이너에 가로 스크롤 */
#changelist-form,
#content > .results {
    overflow-x: auto !important;
}

/* 목록 테이블 셀 한 줄 표시 */
#result_list th,
#result_list td {
    white-space: nowrap;
}

#result_list td a {
    white-space: nowrap;
}

/* 목록에서 인풋 박스 너비 조정 */
#result_list input[name$="-phone"] {
    width: 95px;
}

#result_list input[name$="-current_workplace"] {
    width: 150px;
}

#result_list input[type="text"] {
    padding: 4px 6px;
    font-size: 12px;
}

/* Status badges in list view */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    color: white;
}

/* Button styles */
.button {
    display: inline-block;
    padding: 4px 10px;
    background: #417690;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 11px;
    margin-right: 5px;
    border: none;
    cursor: pointer;
}

.button:hover {
    background: #205067;
}

/* 프리뷰 버튼 */
button.preview-btn {
    background: #28a745;
}

button.preview-btn:hover {
    background: #218838;
}

/* Bulk upload button in changelist */
.bulk-upload-btn {
    margin-left: 10px;
    padding: 8px 15px;
    background: #28a745;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
}

.bulk-upload-btn:hover {
    background: #218838;
}

/* File preview link styling */
a[target="_blank"].button:after {
    content: " \2197";
}

/* Indexing status in detail view */
.field-indexing_status_badge .readonly {
    padding: 5px 0;
}

.field-file_preview_link .readonly {
    padding: 5px 0;
}

/* Collapsible fieldset styling */
fieldset.collapse h2 {
    cursor: pointer;
}

/* ResumeUpload admin styling */
.field-error_message .readonly {
    max-height: 200px;
    overflow-y: auto;
    background: #fff8f8;
    padding: 10px;
    border: 1px solid #ffcccc;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
}

/* 삭제 버튼 스타일 수정 - 저장 버튼과 한 줄로 표시 */
.submit-row {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 10px;
}

.submit-row .deletelink-box {
    float: none;
    margin: 0;
    background: none;
    width: auto;
}

.submit-row .deletelink {
    display: inline-block;
    padding: 10px 15px;
    background: #ba2121;
    border-radius: 4px;
}

