/* 파일 접수 시스템 스타일 */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 0.5rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
    transition: all 0.2s;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.file-preview-item {
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.file-preview-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.file-thumbnail {
    transition: all 0.3s ease;
}

.file-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.thumbnail-container {
    position: relative;
}

.thumbnail-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(255,255,255,0.1) 50%, transparent 51%);
    border-radius: 8px;
    pointer-events: none;
}

.file-preview-item .file-info {
    flex: 1;
    min-width: 0; /* flex item이 줄어들 수 있도록 */
}

.file-preview-item .file-name {
    font-weight: 500;
    color: #495057;
}

.file-preview-item .file-size {
    font-size: 0.875rem;
    color: #6c757d;
}

.upload-progress {
    min-width: 120px;
    text-align: center;
}

.upload-progress .progress {
    margin-bottom: 2px;
}

.upload-progress .progress-text {
    font-size: 0.75rem;
    line-height: 1;
}

#uploadProgressDiv {
    border: 2px solid rgba(13, 110, 253, 0.2);
    animation: fadeIn 0.3s ease-in;
    backdrop-filter: blur(10px);
}

#uploadProgressDiv .progress {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

#uploadProgressDiv .progress-bar {
    transition: width 0.3s ease;
    border-radius: 10px;
}

#uploadProgressDiv .progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 15px;
    color: white;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    font-size: 12px;
}

.upload-progress .progress-bar {
    transition: all 0.3s ease;
}

.file-thumbnail {
    border: 2px solid #e9ecef;
    background: #f8f9fa;
}

.file-thumbnail:hover {
    border-color: #0d6efd;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.progress-bar-striped.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite, pulse 2s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { opacity: 1; }
    to { opacity: 0.8; }
}

/* 파일 타입별 색상 */
.text-success {
    color: #198754 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-primary {
    color: #0d6efd !important;
}

/* 이미지 모달 스타일 */
#imageModal .modal-dialog {
    max-width: 90vw;
}

#imageModal .modal-body {
    padding: 1rem;
}

#imageModal #modalImage {
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#imageModal .image-navigation button {
    opacity: 0.7;
    transition: opacity 0.2s;
}

#imageModal .image-navigation button:hover {
    opacity: 1;
}

/* 성공 알림 개선 */
.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #badbcc;
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #f1b0b7;
    color: #721c24;
}

/* 파일 드래그앤드롭 영역 */
.file-drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-drop-zone:hover {
    border-color: #667eea;
    background-color: rgba(102, 126, 234, 0.05);
}

.file-drop-zone.dragover {
    border-color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
    box-shadow: 0 0.5rem 1rem rgba(102, 126, 234, 0.2);
}

/* 전체 페이지 드래그 상태 */
body.drag-active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

body.drag-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.1);
    z-index: 1000;
    pointer-events: none;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

body.drag-active .file-drop-zone {
    z-index: 1001;
    position: relative;
    border-color: #667eea;
    background-color: rgba(102, 126, 234, 0.15);
    transform: scale(1.05);
    box-shadow: 0 1rem 3rem rgba(102, 126, 234, 0.3);
}

@keyframes pulse {
    from { opacity: 0.3; }
    to { opacity: 0.1; }
}

.file-drop-zone .drop-text {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.file-drop-zone .drop-icon {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.file-drop-zone.dragover .drop-icon {
    color: #667eea;
}

/* 로딩 상태 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 0.3rem solid rgba(255, 255, 255, 0.3);
    border-top: 0.3rem solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.text-danger {
    color: #dc3545 !important;
}

.text-success {
    color: #198754 !important;
}

.alert {
    border-radius: 0.5rem;
}

.table th {
    background-color: #f8f9fa;
    border-top: none;
}

.badge {
    font-size: 0.75rem;
}

.status-접수 {
    background-color: #0d6efd;
}

.status-검토중 {
    background-color: #fd7e14;
}

.status-완료 {
    background-color: #198754;
}

.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
}

.admin-sidebar {
    background-color: #f8f9fa;
    min-height: calc(100vh - 120px);
}

.admin-sidebar .nav-link {
    color: #495057;
    padding: 0.75rem 1rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: #e9ecef;
    color: #667eea;
}

.search-form {
    background-color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1rem;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .admin-sidebar {
        min-height: auto;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    /* 메인 폼 모바일 최적화 */
    .container {
        padding: 0 15px;
    }
    
    .card {
        margin: 10px 0;
    }
    
    .file-preview-item {
        margin-bottom: 8px;
    }
    
    .file-preview-item .d-flex {
        flex-wrap: wrap;
    }
    
    .file-preview-item .file-info {
        min-width: 100%;
        margin-bottom: 8px;
    }
    
    .upload-progress {
        min-width: 100%;
        margin-bottom: 8px;
    }
    
    /* 버튼 그룹 모바일 최적화 */
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .btn-group .btn {
        flex: 1;
        min-width: 60px;
    }
    
    /* 모달 모바일 최적화 */
    #imageModal .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    #imageModal .modal-body {
        padding: 10px;
    }
    
    #imageModal #modalImage {
        max-height: 60vh;
    }
    
    /* 네비게이션 버튼 크기 조정 */
    #imageModal .image-navigation button {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    /* 업로드 진행률 모바일 */
    #uploadProgressDiv {
        padding: 15px;
        margin: 10px 0;
    }
    
    .progress {
        height: 25px;
    }
    
    .progress-bar {
        font-size: 14px;
        line-height: 25px;
    }
}

@media (max-width: 576px) {
    /* 아주 작은 화면 최적화 */
    .col-md-6 {
        margin-bottom: 15px;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .card-header h2 {
        font-size: 1.5rem;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .btn-group .btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    /* 파일 미리보기 아이템 최적화 */
    .file-preview-item .file-name {
        font-size: 0.85rem;
        word-break: break-all;
    }
    
    .file-preview-item .file-size {
        font-size: 0.75rem;
    }
    
    /* 이미지 모달 최소화 */
    #imageModal .modal-footer {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    #imageModal .modal-footer .btn {
        flex: 1;
        min-width: 100px;
    }
}

/* 파일 삭제 버튼 스타일 */
.delete-file-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    transition: all 0.2s ease;
    border: none;
    background-color: #dc3545;
    color: white;
    box-shadow: 0 1px 3px rgba(220, 53, 69, 0.3);
}

.delete-file-btn:hover {
    background-color: #c82333;
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.4);
    color: white;
}

.delete-file-btn:active {
    transform: scale(0.95);
}

.delete-file-btn i {
    font-size: 14px;
    font-weight: bold;
    font-style: normal;
    line-height: 1;
}

/* 모바일에서 삭제 버튼 크기 조정 */
@media (max-width: 576px) {
    .delete-file-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .delete-file-btn i {
        font-size: 16px;
    }
}

/* 언어 선택 드롭다운 스타일 */
.navbar .dropdown-menu {
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: none;
}

.navbar .dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.navbar .dropdown-item:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.navbar .dropdown-item.active {
    background-color: #667eea;
    color: white;
}

.navbar .dropdown-item img {
    flex-shrink: 0;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* 언어 선택 버튼 스타일 */
.nav-link img {
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    vertical-align: middle;
}

/* 반응형 언어 선택 */
@media (max-width: 768px) {
    .navbar .dropdown-item {
        font-size: 0.9rem;
    }
    
    .nav-link img {
        width: 16px !important;
        height: 12px !important;
    }
    
    .navbar .dropdown-item img {
        width: 16px !important;
        height: 12px !important;
        margin-right: 6px !important;
    }
}

/* 모달 백드롭 중복 방지 */
.modal-backdrop {
    opacity: 0.5 !important;
    z-index: 1040 !important;
}

.modal-backdrop + .modal-backdrop {
    display: none !important;
}

/* 이미지 모달 특별 설정 */
#imageModal {
    z-index: 1050 !important;
}

#imageModal .modal-backdrop {
    opacity: 0.5 !important;
}

/* 접수 완료 모달 스타일 */
#successModal .modal-content {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

#successModal .modal-header {
    border-bottom: none;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

#successModal .modal-body {
    padding: 2rem 1.5rem;
}

#successModal .list-group-item {
    border-radius: 8px !important;
    margin-bottom: 4px;
}

#successModal .alert-info {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(108, 117, 125, 0.05) 100%);
    border: 1px solid rgba(13, 110, 253, 0.2);
    border-radius: 10px;
}

/* 접수 완료 모달 애니메이션 */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

#successModal .fa-check-circle {
    animation: successPulse 2s ease-in-out;
}

/* 모달 반응형 */
@media (max-width: 576px) {
    #successModal .modal-body {
        padding: 1.5rem 1rem;
    }
    
    #successModal .list-group-item {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 4px;
    }
    
    #successModal .list-group-item small {
        align-self: flex-end;
    }
}

/* 메모 관리 스타일 */
.memo-list {
    max-height: 400px;
    overflow-y: auto;
}

.memo-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.memo-item:hover {
    background: #f1f3f4;
    border-color: #dee2e6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.memo-item:last-child {
    border-bottom: none !important;
    margin-bottom: 0;
}

.memo-meta {
    font-size: 0.75rem;
    color: #6c757d;
}

.memo-content {
    font-size: 0.875rem;
    line-height: 1.4;
    color: #495057;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin-top: 8px;
    word-break: break-word;
}

.memo-item .btn-outline-danger {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
}

.memo-item .btn-outline-danger:hover {
    transform: scale(1.1);
}

#newMemo {
    resize: vertical;
    min-height: 60px;
}

#memoCount {
    font-size: 0.75rem;
    min-width: 20px;
    text-align: center;
}

/* 메모 목록 스크롤바 스타일 */
.memo-list::-webkit-scrollbar {
    width: 6px;
}

.memo-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.memo-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.memo-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 메모 애니메이션 */
.memo-item {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 메모 추가 버튼 반응형 */
@media (max-width: 576px) {
    .memo-item {
        padding: 8px;
    }
    
    .memo-content {
        font-size: 0.8rem;
        padding: 6px 8px;
    }
    
    .memo-meta {
        font-size: 0.7rem;
    }
    
    #newMemo {
        min-height: 50px;
    }
    
    #addMemoBtn {
        padding: 8px 12px;
        font-size: 0.875rem;
    }
}

/* 새로운 메모 카드 스타일 (meno.jpg 참조) */
.memo-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.memo-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 16px;
}

.memo-section {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.memo-section:last-child {
    border-bottom: none;
}

.memo-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.memo-input-group {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.memo-textarea {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
    flex: 1;
}

.memo-add-btn {
    background-color: #007bff;
    color: white;
    border: 1px solid #007bff;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.2s;
}

.memo-add-btn:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: white;
}

.memo-history {
    max-height: 300px;
    overflow-y: auto;
    background-color: #fafafa;
    border-radius: 4px;
    padding: 8px;
    border: 1px solid #eee;
}

.memo-empty {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    padding: 20px;
    font-style: italic;
}

.memo-item-new {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.2s;
}

.memo-item-new:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.memo-content-area {
    flex: 1;
    min-width: 0;
}

.memo-meta {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

.memo-text {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #333;
    word-break: break-word;
}

.memo-delete-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 0.8rem;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 8px;
}

.memo-delete-btn:hover {
    background-color: #dc3545;
    color: white;
    opacity: 1;
    transform: scale(1.1);
}

/* 메모 스크롤바 */
.memo-history::-webkit-scrollbar {
    width: 4px;
}

.memo-history::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.memo-history::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.memo-history::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 반응형 */
@media (max-width: 768px) {
    .memo-section {
        padding: 12px;
    }
    
    .memo-input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .memo-add-btn {
        width: 100%;
        text-align: center;
    }
    
    .memo-item-new {
        padding: 10px;
        flex-direction: column;
        gap: 8px;
    }
    
    .memo-delete-btn {
        align-self: flex-end;
        margin-left: 0;
    }
}