* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --secondary: #7c3aed;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
}

header i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.upload-area {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.upload-box {
    border: 3px dashed var(--border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.upload-box:hover,
.upload-box.dragover {
    border-color: var(--primary);
    background: #eff6ff;
    transform: translateY(-2px);
}

.upload-box i {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-box h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.upload-box p {
    color: var(--text-light);
}

.file-types {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

.selected-files {
    margin-top: 1.5rem;
}

.selected-files h4 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

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

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.file-item i {
    color: var(--primary);
    font-size: 1.2rem;
}

.file-item span {
    color: var(--text);
}

.file-size {
    margin-left: auto;
    color: var(--text-light) !important;
    font-size: 0.9rem;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

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

.btn-analyze {
    width: 100%;
    padding: 1rem;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-analyze:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

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

.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.results {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.results h2 {
    color: var(--text);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat-card i {
    font-size: 2rem;
    padding: 1rem;
    border-radius: 12px;
}

.stat-card.total i {
    background: #dbeafe;
    color: var(--primary);
}

.stat-card.duplicated i {
    background: #fee2e2;
    color: var(--danger);
}

.stat-card.products i {
    background: #d1fae5;
    color: var(--success);
}

.stat-card.services i {
    background: #fef3c7;
    color: var(--warning);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.details-section {
    margin-top: 2rem;
}

.details-section h3 {
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background: #f8fafc;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text);
}

tr:hover {
    background: #f8fafc;
}

.key-text {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-light);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-product {
    background: #d1fae5;
    color: #065f46;
}

.badge-service {
    background: #fef3c7;
    color: #92400e;
}

.badge-duplicate {
    background: #fee2e2;
    color: #991b1b;
}

.badge-unique {
    background: #dbeafe;
    color: #1e40af;
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .upload-box {
        padding: 2rem 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .container {
        padding: 0;
    }
}