* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem;
    color: var(--text-primary);
}

.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 10px 20px;
    margin: -2rem -2rem 20px -2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 1rem 1rem 0 0;
}

.navbar-brand {
    font-weight: bold;
    color: #667eea !important;
    font-size: 18px;
    text-decoration: none;
    margin: 0;
}

.btn-home {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-home:hover {
    background: #5568d3;
    color: white;
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

header h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.file-input-group {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 2px dashed var(--border-color);
    transition: all 0.3s ease;
}

.file-input-group:hover {
    border-color: var(--primary-color);
    background: #f1f5f9;
}

.file-input-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.label-icon {
    font-size: 1.5rem;
}

.file-input-group input[type="file"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.file-name {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

.process-btn {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.process-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.process-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.25rem;
}

.options-section {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
}

.options-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: white;
}

.checkbox-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.preview-section,
.logs-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.preview-section h3,
.logs-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.preview-content {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 0.75rem;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    margin-bottom: 1.5rem;
}

.preview-content .error {
    color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.preview-content .warning {
    color: var(--warning-color);
}

.preview-content .success {
    color: var(--success-color);
}

.actions {
    display: flex;
    gap: 1rem;
}

.download-btn,
.copy-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.download-btn {
    background: var(--success-color);
    color: white;
}

.download-btn:hover {
    background: #059669;
    transform: translateY(-2px);
}

.copy-btn {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.copy-btn:hover {
    background: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.logs-content {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
}

.log-entry {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--border-color);
    padding-left: 0.75rem;
}

.log-entry.info {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.log-entry.warning {
    border-color: var(--warning-color);
    background: rgba(245, 158, 11, 0.05);
}

.log-entry.error {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.05);
}

.log-entry.success {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.log-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .upload-section {
        grid-template-columns: 1fr;
    }

    .process-btn {
        grid-column: span 1;
    }

    .actions {
        flex-direction: column;
    }
}
