/* 기본 스타일 */
* {
    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: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 헤더 */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 40px;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.header.scrolled {
    padding: 10px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.header.scrolled h1 {
    font-size: 2rem;
}

.header.scrolled .subtitle {
    font-size: 1rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-title {
    flex: 1;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-sticky-upload {
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.btn-sticky-upload.ready {
    animation: pulse 2s infinite;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-sticky-upload:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn-sticky-upload:disabled {
    opacity: 0.6;
    animation: none;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
    100% {
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
}

/* 메인 콘텐츠 */
.main-content {
    flex: 1;
}

/* 카드 그리드 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* 카드 스타일 */
.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.card-placeholder {
    opacity: 0.7;
}

.card-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 25px;
    text-align: center;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

.card-body p {
    margin-bottom: 20px;
    color: #666;
}

.feature-list {
    list-style: none;
    margin-bottom: 25px;
}

.feature-list li {
    padding: 8px 0;
    color: #555;
}

.feature-list i {
    color: #28a745;
    margin-right: 10px;
}

.required-files h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.file-tag {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.file-tag.required {
    background: #ffe6e6;
    color: #d63384;
    border: 1px solid #f8d7da;
}

.file-tag.optional {
    background: #e6f3ff;
    color: #0066cc;
    border: 1px solid #b8daff;
}

.coming-soon {
    text-align: center;
    padding: 40px;
    color: #999;
}

.coming-soon i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.card-footer {
    padding: 25px;
    background: #f8f9fa;
    text-align: center;
}

/* 버튼 스타일 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* 업로드 페이지 스타일 */
.upload-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    margin-top: 20px; /* 스티키 헤더를 위한 여백 */
}

.upload-grid {
    display: grid;
    gap: 30px;
}

.file-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.required-section h3 i {
    color: #dc3545;
}

.optional-section h3 i {
    color: #17a2b8;
}

.file-upload-area {
    margin-bottom: 20px;
}

/* 업로드 박스 */
.upload-box {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.upload-box:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-box.dragover {
    border-color: #667eea;
    background: #e6f3ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.upload-text {
    margin-bottom: 10px;
    color: #333;
}

.upload-text strong {
    color: #667eea;
}

.upload-hint {
    color: #6c757d;
    font-size: 0.9rem;
}

/* 파일 미리보기 */
.file-preview {
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.file-info i {
    font-size: 1.5rem;
    color: #28a745;
}

.file-name {
    font-weight: 500;
    color: #333;
}

.file-size {
    color: #6c757d;
    font-size: 0.9rem;
}

.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.btn-remove:hover {
    background: #c82333;
}

/* 탭 스타일 */
.option-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    color: #6c757d;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-btn:hover {
    color: #667eea;
}

/* JSON 입력 영역 */
.json-input-area {
    padding: 20px 0;
}

.json-input-help {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.json-input-help p {
    margin: 0;
    margin-bottom: 5px;
}

.json-input-help p:last-child {
    margin-bottom: 0;
}

.json-input-help code {
    background: #e9ecef;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85em;
}

.json-input-area label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
}

.json-input-area textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.json-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.json-status.valid {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.json-status.invalid {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 업로드 액션 */
.upload-actions {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #dee2e6;
}

.upload-note {
    margin-top: 15px;
    color: #6c757d;
    font-size: 0.9rem;
}

/* 진행 상황 */
.progress-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.progress-card h3 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-text {
    color: #333;
    font-weight: 500;
}

.progress-percent {
    color: #667eea;
    font-weight: 600;
}

.progress-details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #495057;
    max-height: 300px;
    overflow-y: auto;
}

.current-detail {
    background: #e3f2fd;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 4px solid #2196f3;
    margin-bottom: 10px;
    font-weight: 500;
}

.terminal-logs {
    background: #1e1e1e;
    color: #00ff00;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 0.85rem;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #333;
    margin-top: 10px;
}

.log-entry {
    margin: 2px 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-timestamp {
    color: #888;
    font-weight: bold;
}

.log-message {
    color: #00ff00;
    margin-left: 5px;
}

.log-details {
    color: #ffff00;
    margin-left: 5px;
    font-style: italic;
}

.log-progress {
    color: #00ccff;
    margin-left: 5px;
    font-weight: bold;
}

.terminal-logs::-webkit-scrollbar {
    width: 6px;
}

.terminal-logs::-webkit-scrollbar-track {
    background: #2e2e2e;
}

.terminal-logs::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.terminal-logs::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* 결과 섹션 */
.result-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.result-header {
    text-align: center;
    margin-bottom: 25px;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.result-icon.success {
    color: #28a745;
}

.result-icon.error {
    color: #dc3545;
}

.result-header h3 {
    color: #333;
    font-size: 1.8rem;
}

.result-body {
    text-align: center;
}

.result-stats {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #667eea;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 5px;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

/* 푸터 */
.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

/* 반응형 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 15px 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .btn-sticky-upload {
        width: 100%;
        max-width: 300px;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .upload-grid {
        gap: 20px;
    }
    
    .result-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .btn-sticky-upload {
        font-size: 0.9rem;
        padding: 12px 20px;
    }
}
