/* Chat Admin Actions CSS - 채팅 관리자 기능 스타일링 */
/* 모듈화된 채팅 메시지 삭제 및 관리 기능 CSS - 기존 스타일과 충돌 방지 */

/* ========================================
   관리자 메시지 삭제 버튼 (매우 구체적인 선택자 사용)
   ======================================== */
.chat-section #chatMessages .message .admin-delete-btn {
    background: none;
    border: none;
    color: #8e8e8e;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    margin-left: 8px;
    border-radius: 3px;
    opacity: 0;
    transition: all 0.2s ease;
    position: relative;
}

/* 메시지 호버 시 삭제 버튼 표시 (매우 구체적한 선택자) */
.chat-section #chatMessages .message:hover .admin-delete-btn {
    opacity: 1;
}

.chat-section #chatMessages .message .admin-delete-btn:hover {
    background: #ffebee;
    color: #e53e3e;
    transform: scale(1.1);
}

.chat-section #chatMessages .message .admin-delete-btn:active {
    transform: scale(0.95);
}

/* ========================================
   채널별 관리자 컨트롤 (상단 고정)
   ======================================== */
.keywork-chat-admin-controls {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
    margin-bottom: 12px;
    padding: 8px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.keywork-chat-admin-controls .admin-controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.keywork-chat-admin-controls .admin-badge {
    background: linear-gradient(135deg, #1428A0, #2B4CB8);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.keywork-chat-admin-controls .admin-actions {
    display: flex;
    gap: 6px;
}

.keywork-chat-admin-controls .admin-action-btn {
    background: white;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 3px;
}

.keywork-chat-admin-controls .admin-action-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.keywork-chat-admin-controls .bulk-delete-btn:hover {
    background: #ffebee;
    border-color: #ef5350;
    color: #e53e3e;
}

.keywork-chat-admin-controls .export-btn:hover {
    background: #e8f5e8;
    border-color: #4caf50;
    color: #2e7d32;
}

/* ========================================
   관리자 삭제 확인 모달 (고유한 클래스명 사용)
   ======================================== */
.keywork-admin-delete-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.keywork-admin-delete-modal-overlay.visible {
    opacity: 1;
}

.keywork-admin-delete-modal-overlay .keywork-admin-delete-modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.keywork-admin-delete-modal-overlay.visible .keywork-admin-delete-modal {
    transform: scale(1) translateY(0);
}

/* 모달 헤더 */
.keywork-admin-delete-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.keywork-admin-delete-modal .modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
}

.keywork-admin-delete-modal .modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.keywork-admin-delete-modal .modal-close:hover {
    background: #e9ecef;
    color: #495057;
}

/* 모달 바디 */
.keywork-admin-delete-modal .modal-body {
    padding: 20px;
}

.keywork-admin-delete-modal .modal-body p {
    margin: 0 0 16px 0;
    color: #495057;
    line-height: 1.5;
}

/* 메시지 미리보기 */
.keywork-admin-delete-modal .message-preview {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.keywork-admin-delete-modal .preview-author {
    font-weight: 600;
    color: #1428A0;
    font-size: 13px;
    margin-bottom: 4px;
}

.keywork-admin-delete-modal .preview-text {
    color: #212529;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 6px;
    word-wrap: break-word;
}

.keywork-admin-delete-modal .preview-time {
    font-size: 11px;
    color: #6c757d;
}

/* 채널 정보 */
.keywork-admin-delete-modal .channel-info {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.keywork-admin-delete-modal .channel-name {
    font-weight: 600;
    color: #1565c0;
    font-size: 14px;
    margin-bottom: 4px;
}

.keywork-admin-delete-modal .channel-id {
    font-size: 12px;
    color: #42a5f5;
    font-family: monospace;
}

/* 경고 텍스트 */
.keywork-admin-delete-modal .warning-text {
    color: #e53e3e !important;
    font-weight: 500 !important;
    background: #ffebee;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #e53e3e;
    margin: 16px 0 !important;
}

/* 확인 체크박스 */
.keywork-admin-delete-modal .confirmation-check {
    margin: 16px 0;
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
}

.keywork-admin-delete-modal .confirmation-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #856404;
    cursor: pointer;
    font-weight: 500;
}

.keywork-admin-delete-modal .confirmation-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 모달 푸터 */
.keywork-admin-delete-modal .modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.keywork-admin-delete-modal .btn-cancel,
.keywork-admin-delete-modal .btn-delete {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid;
}

.keywork-admin-delete-modal .btn-cancel {
    background: white;
    color: #6c757d;
    border-color: #adb5bd;
}

.keywork-admin-delete-modal .btn-cancel:hover {
    background: #f8f9fa;
    color: #495057;
    border-color: #6c757d;
}

.keywork-admin-delete-modal .btn-delete {
    background: #e53e3e;
    color: white;
    border-color: #e53e3e;
}

.keywork-admin-delete-modal .btn-delete:hover:not(:disabled) {
    background: #c53030;
    border-color: #c53030;
    transform: translateY(-1px);
}

.keywork-admin-delete-modal .btn-delete:disabled {
    background: #adb5bd;
    border-color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ========================================
   메시지 삭제 애니메이션 (매우 구체적한 선택자)
   ======================================== */
.chat-section #chatMessages .message.keywork-deleting {
    opacity: 0.5;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

.chat-section #chatMessages .message.keywork-deleted {
    opacity: 0;
    transform: translateX(-100%);
    margin: 0;
    padding: 0;
    height: 0;
    overflow: hidden;
}

/* ========================================
   빈 메시지 상태 (고유한 클래스명)
   ======================================== */
.keywork-no-messages {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

/* ========================================
   반응형 디자인
   ======================================== */
@media (max-width: 768px) {
    .keywork-admin-delete-modal {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .keywork-chat-admin-controls .admin-controls-header {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .keywork-chat-admin-controls .admin-actions {
        justify-content: center;
    }
    
    .keywork-chat-admin-controls .admin-action-btn {
        flex: 1;
        justify-content: center;
        min-height: 32px;
    }
    
    .chat-section #chatMessages .message .admin-delete-btn {
        font-size: 14px;
        padding: 4px;
    }
    
    .keywork-admin-delete-modal .message-preview {
        padding: 8px;
    }
    
    .keywork-admin-delete-modal .modal-footer {
        flex-direction: column;
    }
    
    .keywork-admin-delete-modal .btn-cancel,
    .keywork-admin-delete-modal .btn-delete {
        width: 100%;
        padding: 12px;
    }
}

/* ========================================
   다크 모드 지원
   ======================================== */
@media (prefers-color-scheme: dark) {
    .keywork-chat-admin-controls {
        background: linear-gradient(135deg, #2d3748, #4a5568);
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .keywork-chat-admin-controls .admin-action-btn {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .keywork-chat-admin-controls .admin-action-btn:hover {
        background: #2d3748;
    }
    
    .keywork-admin-delete-modal {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .keywork-admin-delete-modal .modal-header {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .keywork-admin-delete-modal .modal-footer {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .keywork-admin-delete-modal .message-preview {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .keywork-admin-delete-modal .channel-info {
        background: #2a4a6b;
        border-color: #3182ce;
    }
    
    .keywork-admin-delete-modal .warning-text {
        background: #553c3c !important;
        border-color: #e53e3e !important;
        color: #feb2b2 !important;
    }
    
    .keywork-admin-delete-modal .confirmation-check {
        background: #553c1a;
        border-color: #d69e2e;
        color: #faf089;
    }
}

/* ========================================
   접근성 및 고대비 모드
   ======================================== */
.chat-section #chatMessages .message .admin-delete-btn:focus,
.keywork-chat-admin-controls .admin-action-btn:focus,
.keywork-admin-delete-modal .modal-close:focus,
.keywork-admin-delete-modal .btn-cancel:focus,
.keywork-admin-delete-modal .btn-delete:focus {
    outline: 2px solid #3182ce;
    outline-offset: 2px;
}

@media (prefers-contrast: high) {
    .chat-section #chatMessages .message .admin-delete-btn:hover {
        background: #ff0000;
        color: #ffffff;
    }
    
    .keywork-admin-delete-modal {
        border: 2px solid #000000;
    }
    
    .keywork-admin-delete-modal .warning-text {
        background: #ff0000 !important;
        color: #ffffff !important;
    }
}

/* 애니메이션 감소 모드 */
@media (prefers-reduced-motion: reduce) {
    .chat-section #chatMessages .message .admin-delete-btn,
    .keywork-chat-admin-controls .admin-action-btn,
    .keywork-admin-delete-modal,
    .keywork-admin-delete-modal-overlay,
    .chat-section #chatMessages .message.keywork-deleting,
    .chat-section #chatMessages .message.keywork-deleted {
        transition: none;
        animation: none;
    }
}