/* Base Styles */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    --light-bg: #f8fafc;
    --dark-bg: #1e293b;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-color: #334155;
    --text-light: #64748b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px 0;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-icon {
    font-size: 2.5rem;
}

.header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.header p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.02);
}

.card-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-content {
    padding: 20px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.upload-subtext {
    color: var(--text-light);
}

/* File Info */
.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius);
}

.file-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-details i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.file-size, .number-count {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-left: 10px;
}

.file-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #475569;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #059669;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: var(--radius);
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background-color: #fee2e2;
    color: #b91c1c;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Progress */
.progress-container {
    margin: 20px 0;
}

.progress-bar {
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    margin-bottom: 10px;
}

.current-number {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Live Log */
.live-log {
    margin-top: 20px;
}

.live-log h4 {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-container {
    height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px;
    font-family: monospace;
    font-size: 0.9rem;
    background-color: #f8fafc;
}

.log-entry {
    padding: 3px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.log-info {
    color: var(--info-color);
}

.log-success {
    color: var(--success-color);
}

.log-error {
    color: var(--error-color);
}

.log-warning {
    color: var(--warning-color);
}

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-section {
    margin-bottom: 20px;
}

.preview-section {
    margin-top: 20px;
}

.preview-section h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.csv-preview {
    background-color: #f1f5f9;
    border-radius: var(--radius);
    padding: 15px;
    overflow-x: auto;
    font-family: monospace;
}

.preview-note {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-light);
    text-align: center;
}

/* Config Section */
.config-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.config-section h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.config-option {
    margin-bottom: 10px;
}

.config-option label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.config-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .file-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .file-details {
        flex-wrap: wrap;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header-info {
        flex-direction: column;
        text-align: center;
    }
    
    .config-options {
        grid-template-columns: 1fr;
    }
}