/* 관리자 페이지 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 비활성화 버튼 스타일 */
.btn.disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

body {
    font-family: 'Wanted Sans', 'Noto Sans KR', sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* 모달 스타일 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: #0201AD;
}

/* 관리자 인터페이스 */
.admin-interface {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 헤더 */
.admin-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.home-btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.admin-header h1 {
    color: #0201AD;
    font-size: 1.5rem;
    font-weight: 700;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.status-text {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 400;
}

/* 네비게이션 */
.admin-nav {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 0 2rem;
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.nav-tab {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-tab:hover {
    color: #0201AD;
    background: #f8f9fa;
}

.nav-tab.active {
    color: #0201AD;
    border-bottom-color: #0201AD;
}

/* 메인 콘텐츠 */
.admin-main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 섹션 헤더 */
.section-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.section-header h2 {
    color: #0201AD;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #6c757d;
    font-size: 0.95rem;
}

/* 폼 섹션 */
.form-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.form-section h3 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

/* 폼 그룹 */
.form-group {
    margin-bottom: 1.5rem;
}

/* 필터링 섹션 */
.filter-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.filter-label {
    font-weight: 500;
    color: #495057;
    margin: 0;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.filter-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.filter-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.filter-info {
    display: flex;
    align-items: center;
}

.filter-status {
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
}

/* 폼 도움말 텍스트 */
.form-help {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* 체크박스 라벨 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
    margin: 0;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    width: auto;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .filter-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-btn {
        flex: 1;
        text-align: center;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .filter-status {
        font-size: 0.8rem;
    }
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0201AD;
    box-shadow: 0 0 0 3px rgba(2, 1, 173, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 리치 에디터 */
.rich-editor {
    min-height: 120px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.95rem;
    line-height: 1.6;
}

.rich-editor:focus {
    outline: none;
    border-color: #0201AD;
    box-shadow: 0 0 0 3px rgba(2, 1, 173, 0.1);
}

/* 이미지 업로드 영역 */
.image-upload-zone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fafafa;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 업로드 존에 투명 파일 입력을 덮어씌움 */
.image-upload-zone .file-input-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* 파일 안내문구 스타일 */
.file-info {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
    text-align: center;
}

/* 비디오 미리보기 스타일 */
.video-preview {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.video-thumbnail {
    width: 200px;
    height: 150px;
    object-fit: cover;
    display: block;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 이미지 아이템 내 비디오 스타일 */
.image-item .video-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
}

.video-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.video-label {
    background: rgba(0, 0, 0, 0.7);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.video-placeholder {
    width: 200px;
    height: 150px;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    border-radius: 8px;
}

.video-placeholder .video-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.video-placeholder .video-label {
    background: #e0e0e0;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.image-upload-zone:hover {
    border-color: #0201AD;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 1, 173, 0.15);
}

.image-upload-zone.dragover {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    border-style: solid;
}

.image-upload-zone.dragover::before {
    content: "이미지를 여기에 놓으세요";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    z-index: 10;
    pointer-events: none;
}

.upload-placeholder p {
    color: #6c757d;
    margin-bottom: 1rem;
}

/* 이미지 리스트 */
.image-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.image-item:hover {
    transform: translateY(-2px);
}

.image-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.image-item .image-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
}

.image-item .image-actions button {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
}

.image-item .image-actions button:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* 이미지 미리보기 */
.image-preview {
    margin-top: 1rem;
}

.image-preview img {
    max-width: 200px;
    max-height: 120px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 카드/아이템 리스트 */
.cards-list,
.items-list,
.posts-list,
.slides-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-item,
.media-item,
.career-item,
.slide-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.card-item:hover,
.media-item:hover,
.career-item:hover,
.slide-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.item-title {
    font-weight: 600;
    color: #333;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.active-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #6c757d;
    cursor: pointer;
}

.active-toggle input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* 버튼 스타일 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #0201AD;
    color: white;
}

.btn-primary:hover {
    background: #0100a0;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline {
    background: transparent;
    color: #0201AD;
    border: 1px solid #0201AD;
}

.btn-outline:hover {
    background: #0201AD;
    color: white;
}

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

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0201AD;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 토스트 알림 */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 3000;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.toast.warning {
    background: #ffc107;
    color: #333;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .admin-header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .admin-header-left {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .admin-actions {
        width: 100%;
        justify-content: center;
    }
    
    .admin-status {
        display: none;
    }
    
    .admin-nav {
        padding: 0 1rem;
    }
    
    .admin-main {
        padding: 1rem;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .image-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .toast {
        right: 1rem;
        left: 1rem;
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .admin-header h1 {
        font-size: 1.2rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .nav-tab {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
}

/* 드래그 앤 드롭 스타일 */
.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.drop-zone {
    border-color: #0201AD !important;
    background: #f0f0ff !important;
}

/* 정렬 가능한 아이템 */
.sortable-item {
    cursor: move;
}

.sortable-item:hover {
    background: #f8f9fa;
}

.sortable-ghost {
    opacity: 0.4;
}

/* 아코디언 UI 스타일 */
.accordion-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.accordion-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    backface-visibility: hidden;
}

.accordion-item:hover {
    border-color: #0201AD;
    box-shadow: 0 4px 16px rgba(2, 1, 173, 0.12);
    transform: translateY(-2px) translateZ(0);
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    cursor: pointer;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-header:hover {
    background: #f0f0ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 1, 173, 0.15);
}

.accordion-header.active {
    background: #0201AD;
    color: white;
}

.accordion-title {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.accordion-title::before {
    content: "▼";
    margin-right: 0.5rem;
    font-size: 1rem;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

.accordion-item.collapsed .accordion-title::before {
    transform: rotate(-90deg);
}

.accordion-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.accordion-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #666;
    position: relative;
    z-index: 1;
}

.accordion-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #333;
    transform: scale(1.1);
}

.accordion-header.active .accordion-toggle {
    color: white;
}

.accordion-toggle::before {
    content: "";
}

.accordion-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top center;
}

.accordion-item:not(.collapsed) .accordion-content {
    padding: 1.5rem;
    max-height: 2000px;
    opacity: 1;
    transform: translateY(0);
    transform-origin: top center;
}

.accordion-content .form-group {
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0.1s;
}

.accordion-content .form-group:last-child {
    margin-bottom: 0;
}

.accordion-item:not(.collapsed) .accordion-content .form-group {
    opacity: 1;
    transform: translateY(0);
}

.accordion-item:not(.collapsed) .accordion-content .form-group:nth-child(1) { transition-delay: 0.1s; }
.accordion-item:not(.collapsed) .accordion-content .form-group:nth-child(2) { transition-delay: 0.15s; }
.accordion-item:not(.collapsed) .accordion-content .form-group:nth-child(3) { transition-delay: 0.2s; }
.accordion-item:not(.collapsed) .accordion-content .form-group:nth-child(4) { transition-delay: 0.25s; }
.accordion-item:not(.collapsed) .accordion-content .form-group:nth-child(5) { transition-delay: 0.3s; }

/* 미디어 아이템 아코디언 - 이모지 제거 */
.media-accordion .accordion-title::before {
    content: "▼";
}

/* 채용 아이템 아코디언 - 이모지 제거 */
.career-accordion .accordion-title::before {
    content: "▼";
}

/* 아코디언 아이템 상태 표시 */
.accordion-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.accordion-status.active {
    background: #d4edda;
    color: #155724;
}

.accordion-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* 반응형 아코디언 */
@media (max-width: 768px) {
    .accordion-header {
        padding: 0.75rem 1rem;
    }
    
    .accordion-content {
        padding: 1rem !important;
    }
    
    .accordion-item:not(.collapsed) .accordion-content {
        padding: 1rem !important;
    }
    
    .accordion-title {
        font-size: 0.9rem;
    }
    
    .accordion-actions {
        gap: 0.25rem;
    }
    
    .accordion-item:hover {
        transform: translateY(-1px) translateZ(0);
    }
}

/* 섹션 토글 스타일 */
.section-toggle {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.section-toggle label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
}

.section-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0201AD;
    cursor: pointer;
}

.section-toggle label:hover {
    color: #0201AD;
}

.sortable-chosen {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 파일 input 완전 숨김 처리 (클릭 호환성 보장) */
.file-input-hidden {
    position: absolute;
    left: -9999px;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* 드래그오버 상태 시각적 피드백 */
.image-upload-zone.drag-over {
    background-color: #f0f8ff;
    border-color: #0201AD;
    border-style: dashed;
    transform: scale(1.02);
}
