/**
 * CSV 업로드 시스템 CSS
 * 모던하고 반응형 디자인
 */

/* CSS 변수 정의 */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    --bg-white: #ffffff;
    --bg-gray-50: #f9fafb;
    --bg-gray-100: #f3f4f6;
    --bg-gray-200: #e5e7eb;
    
    --border-gray: #d1d5db;
    --border-light: #e5e7eb;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

/* 기본 스타일 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-gray-50);
    min-height: 100vh;
}

/* 컨테이너 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 헤더 */
header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* 메인 콘텐츠 */
main {
    flex: 1;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* 업로드 영역 */
.upload-area {
    border: 2px dashed var(--border-gray);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    background-color: var(--bg-gray-50);
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-white);
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: var(--bg-white);
    box-shadow: var(--shadow-md);
}

.upload-content {
    max-width: 400px;
}

.upload-icon {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.upload-area h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.select-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 1rem;
}

.select-btn:hover {
    background-color: var(--primary-hover);
}

.file-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* 파일 미리보기 */
.file-preview {
    background-color: var(--bg-gray-50);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.file-size {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.remove-btn {
    background-color: var(--error-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.remove-btn:hover {
    background-color: #dc2626;
}

/* 진행률 표시 */
.progress-container {
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background-color: var(--bg-gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.progress-text span:first-child {
    color: var(--text-secondary);
}

.progress-text span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

/* 액션 버튼 */
.upload-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.upload-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.upload-btn:hover {
    background-color: var(--primary-hover);
}

.cancel-btn {
    background-color: var(--bg-gray-200);
    color: var(--text-primary);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cancel-btn:hover {
    background-color: var(--bg-gray-100);
}

/* 결과 표시 */
.result-container {
    text-align: center;
}

.result-message {
    margin-bottom: 1.5rem;
}

.result-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--success-color);
    font-size: 1.125rem;
    font-weight: 500;
}

.result-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--error-color);
    font-size: 1.125rem;
    font-weight: 500;
}

.new-upload-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.new-upload-btn:hover {
    background-color: var(--primary-hover);
}

/* 푸터 */
footer {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
}

.requirements h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.requirements ul {
    list-style: none;
    color: var(--text-secondary);
}

.requirements li {
    padding: 0.25rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.requirements li::before {
    content: '•';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* 토스트 메시지 */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background-color: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 400px;
    font-size: 0.875rem;
    font-weight: 500;
}

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

.toast-info {
    border-left: 4px solid var(--info-color);
    color: var(--text-primary);
}

.toast-success {
    border-left: 4px solid var(--success-color);
    color: var(--text-primary);
}

.toast-error {
    border-left: 4px solid var(--error-color);
    color: var(--text-primary);
}

.toast-warning {
    border-left: 4px solid var(--warning-color);
    color: var(--text-primary);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    main {
        padding: 1.5rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
        min-height: 250px;
    }
    
    .upload-actions {
        flex-direction: column;
    }
    
    .upload-btn,
    .cancel-btn {
        width: 100%;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .remove-btn {
        align-self: flex-end;
    }
    
    .toast {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    :root {
        --border-gray: #000000;
        --border-light: #000000;
        --text-secondary: #000000;
    }
}

/* 다크 모드 지원 (선택사항) */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        
        --bg-white: #1f2937;
        --bg-gray-50: #111827;
        --bg-gray-100: #374151;
        --bg-gray-200: #4b5563;
        
        --border-gray: #4b5563;
        --border-light: #374151;
    }
    
    body {
        background-color: var(--bg-gray-50);
    }
}
