/* =================================================================== */
/* 공통 파일 업로드 모달 스타일 - Clean Version (No !important) */
/* CSS 우선순위를 제대로 설계한 버전 */
/* @version 3.0 - 2025-10-14 Clean 버전 */
/* =================================================================== */

/* 1. 모달 기본 구조 - 높은 특이성으로 우선순위 확보 */
body .upload-modal.upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

body .upload-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* 2. 모달 콘텐츠 - 더 높은 특이성 */
body .upload-modal .modal-content.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    
    /* 크기 설정 */
    width: auto;
    max-width: min(1000px, 90vw);
    min-width: min(800px, 80vw);
    max-height: 90vh;
    
    /* 박스 모델 */
    box-sizing: border-box;
    overflow: hidden;
    
    /* 레이아웃 */
    display: flex;
    flex-direction: column;
}

/* 3. 모달 헤더 - 청색 그라데이션 */
body .upload-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 4px;
}

body .upload-modal .modal-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

body .upload-modal .modal-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    width: 100%;
    order: 1;
}

body .upload-modal .modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.3rem;
    color: white;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

body .upload-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 4. 모달 바디 */
body .upload-modal .modal-body {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* 5. 업로드 컨테이너 - 핵심 레이아웃 */
body .upload-modal .upload-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
    box-sizing: border-box;
}

body .upload-modal .upload-left,
body .upload-modal .upload-right {
    display: flex;
    flex-direction: column;
    min-width: 0; /* 그리드 오버플로우 방지 */
    box-sizing: border-box;
}

/* 6. 업로드 영역 */
body .upload-modal .upload-label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
}

/* 업로드 버튼 그룹 - 통일된 스타일 */
body .upload-modal .upload-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

body .upload-modal .btn-upload-method {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
    color: #495057;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

body .upload-modal .btn-upload-method:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #ced4da;
}

body .upload-modal .btn-upload-method.active {
    background: #1E90FF;
    border-color: #1E90FF;
    color: white;
}

body .upload-modal .btn-upload-method:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body .upload-modal .upload-dropzone {
    border: 2px dashed #1E90FF;
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #e8f4ff;
    box-sizing: border-box;
}

body .upload-modal .upload-dropzone:hover {
    border-color: #1873CC;
    background: #d6ebff;
}

body .upload-modal .upload-dropzone.dragover {
    border-color: #1873CC;
    background: #d6ebff;
    transform: scale(1.02);
}

body .upload-modal .upload-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    display: block;
}

/* 드롭존 텍스트 - 통일된 폰트 크기 */
body .upload-modal .upload-text {
    font-size: 13px;
    color: #1E90FF;
    font-weight: 500;
    display: block;
}

body .upload-modal .upload-dropzone p {
    font-size: 13px;
    font-weight: 500;
    color: #1E90FF;
    margin: 0 0 8px 0;
}

body .upload-modal .upload-formats {
    font-size: 13px;
    color: #6c757d;
}

/* 파일 안내 텍스트 - 통일된 폰트 크기 */
body .upload-modal .upload-info {
    font-size: 13px;
    color: #6c757d;
    margin-top: 12px;
    line-height: 1.5;
}

/* 공지사항 - 통일된 폰트 크기 */
body .upload-modal .upload-notice {
    margin-top: 12px;
}

body .upload-modal .upload-notice .notice-item {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 6px;
    line-height: 1.5;
}

/* 7. 파일 목록 */
body .upload-modal .file-list {
    margin-top: 16px;
}

body .upload-modal .file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

body .upload-modal .file-name {
    font-weight: 500;
    color: #495057;
}

body .upload-modal .file-size {
    font-size: 0.85rem;
    color: #6c757d;
}

body .upload-modal .file-remove {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* 8. 작업메모 textarea - 스크롤 방지 핵심 */
body .upload-modal .upload-right textarea {
    flex: 1;
    width: 100%;
    max-width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 200px;
    transition: border-color 0.3s ease;

    /* 스크롤 방지 */
    box-sizing: border-box;
    overflow-x: hidden;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* placeholder 스타일 - 통일된 폰트 크기 */
body .upload-modal .upload-right textarea::placeholder {
    font-size: 13px;
    color: #adb5bd;
    line-height: 1.5;
}

body .upload-modal .upload-right textarea:focus {
    outline: none;
    border-color: #1E90FF;
}

/* 9. 모달 푸터 */
body .upload-modal .modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

body .upload-modal .order-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

body .upload-modal .order-summary {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
}

body .upload-modal .price-highlight {
    color: #1E90FF;
    font-size: 1.3rem;
}

body .upload-modal .modal-buttons {
    display: flex;
    gap: 12px;
}

body .upload-modal .btn-modal-cancel,
body .upload-modal .btn-modal-order {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

body .upload-modal .btn-modal-cancel {
    background: #6c757d;
    color: white;
}

body .upload-modal .btn-modal-cancel:hover {
    background: #5a6268;
}

body .upload-modal .btn-modal-order {
    background-color: #1E90FF;
    color: white;
}

body .upload-modal .btn-modal-order:hover {
    background-color: #1873CC;
}

/* 10. 반응형 디자인 */
@media (max-width: 900px) {
    body .upload-modal .modal-content.modal-content {
        min-width: min(600px, 95vw);
    }
    
    body .upload-modal .upload-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    body .upload-modal .upload-right textarea {
        min-height: 150px;
    }
}

@media (max-width: 700px) {
    body .upload-modal .modal-content.modal-content {
        min-width: auto;
        max-width: 98vw;
        margin: 10px;
    }
    
    body .upload-modal .modal-header,
    body .upload-modal .modal-body,
    body .upload-modal .modal-footer {
        padding: 16px;
    }
}

@media (max-width: 500px) {
    body .upload-modal .modal-content.modal-content {
        max-width: 100vw;
        margin: 5px;
        border-radius: 8px;
    }
    
    body .upload-modal .modal-header,
    body .upload-modal .modal-body,
    body .upload-modal .modal-footer {
        padding: 12px;
    }
}
