/* BinaryAI 스타일의 깔끔한 디자인 */

/* 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3B82F6;
    --primary-hover: #2563EB;
    --secondary-color: #6B7280;
    --success-color: #10B981;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
    --background: #FFFFFF;
    --surface: #F9FAFB;
    --border: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* 헤더 */
.header {
    background: var(--background);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
    text-decoration: none;
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 8px;
    box-sizing: border-box;
}

.nav-link:hover {
    color: var(--text-primary);
}

.dataset-link {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    height: 40px;
    box-sizing: border-box;
}

.dataset-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.dataset-link svg {
    transition: transform 0.2s ease;
}

.dataset-link:hover svg {
    transform: scale(1.1);
}

/* 메인 콘텐츠 */
.main {
    flex: 1;
    padding: 80px 0;
}

/* 히어로 섹션 */
.hero {
    text-align: center;
    margin-bottom: 80px;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 업로드 섹션 */
.upload-section {
    max-width: 600px;
    margin: 0 auto;
}

.upload-card {
    background: var(--background);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-card:hover::before {
    opacity: 1;
}

.upload-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Dragover state should look like hover */
.upload-card.dragover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: rgba(59, 130, 246, 0.03);
}

.upload-area {
    position: relative;
    z-index: 1;
    cursor: pointer;
    border-radius: var(--radius-lg);
    transition: background 0.2s ease, outline-color 0.2s ease, transform 0.2s ease;
}

.upload-icon {
    color: var(--primary-color);
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    transition: transform 0.2s ease;
}

.upload-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.upload-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    width: 100%;
}

.file-type,
.file-size {
    background: var(--surface);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
}

.upload-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.upload-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* 진행 상황 섹션 */
.progress-section {
    max-width: 600px;
    margin: 0 auto;
}

.progress-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.progress-icon {
    color: var(--primary-color);
}

.progress-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--surface);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--success-color) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 결과 섹션 */
.result-section {
    max-width: 600px;
    margin: 0 auto;
}

.result-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.result-header {
    margin-bottom: 32px;
}

.success-icon {
    color: var(--success-color);
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.result-header h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.result-header p {
    color: var(--text-secondary);
}

.file-info {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 32px;
    text-align: left;
}

.file-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.file-info-item:last-child {
    border-bottom: none;
}

.file-info-label {
    font-weight: 500;
    color: var(--text-primary);
}

.file-info-value {
    color: var(--text-secondary);
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.download-btn,
.new-upload-btn,
.retry-btn {
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    text-decoration: none;
}

.download-btn.primary {
    background: var(--primary-color);
    color: white;
}

.download-btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.new-upload-btn.secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.new-upload-btn.secondary:hover {
    background: var(--border);
    transform: translateY(-1px);
}

.retry-btn {
    background: var(--error-color);
    color: white;
}

.retry-btn:hover {
    background: #DC2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* 오류 섹션 */
.error-section {
    max-width: 600px;
    margin: 0 auto;
}

.error-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.error-header {
    margin-bottom: 32px;
}

.error-icon {
    color: var(--error-color);
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.error-header h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.error-message {
    background: #FEF2F2;
    color: #B91C1C;
    padding: 16px;
    border-radius: var(--radius);
    border-left: 4px solid var(--error-color);
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
}

/* 푸터 */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-left p {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-right {
    display: flex;
    gap: 24px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--text-primary);
}

/* 드래그 앤 드롭 상태 */
.upload-area.dragover {
    background: transparent;
}

.upload-area.dragover::after { content: none; }

.upload-area.dragover .upload-icon {
    color: var(--primary-color);
    transform: scale(1.06);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header-content {
        padding: 0 16px;
    }
    
    .nav {
        display: none;
    }
    
    .dataset-link {
        display: none;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .upload-card {
        padding: 32px 24px;
    }
    
    .upload-title {
        font-size: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .download-btn,
    .new-upload-btn,
    .retry-btn {
        width: 100%;
        justify-content: center;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-right {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 40px 0;
    }
    
    .hero {
        margin-bottom: 40px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .upload-card {
        padding: 24px 16px;
    }
    
    .upload-info {
        flex-direction: column;
        gap: 8px;
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-section,
.progress-section,
.result-section,
.error-section {
    animation: fadeIn 0.5s ease-out;
}

/* 로딩 애니메이션 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.progress-icon svg {
    animation: spin 2s linear infinite;
}

/* 포커스 상태 */
.upload-btn:focus,
.download-btn:focus,
.new-upload-btn:focus,
.retry-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 접근성 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}