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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #3858A6 0%, #0097F4 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #3858A6 0%, #0097F4 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.logo {
    width: 200px;
    height: auto;
    margin-bottom: 20px;
}

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

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 40px;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f7fafc;
}

.upload-area:hover {
    border-color: #0097F4;
    background: #f0f7ff;
}

.upload-area.dragover {
    border-color: #0097F4;
    background: #e6f4ff;
    transform: scale(1.02);
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: #718096;
    margin-bottom: 20px;
}

.upload-area h3 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.upload-area p {
    color: #718096;
    font-size: 1rem;
}

.file-info {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    width: 40px;
    height: 40px;
    color: #3858A6;
}

.file-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

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

.remove-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s;
}

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

.remove-btn svg {
    width: 20px;
    height: 20px;
    color: #718096;
}

.action-section {
    text-align: center;
    margin: 30px 0;
}

.process-btn {
    background: linear-gradient(135deg, #3858A6 0%, #0097F4 100%);
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(56, 88, 166, 0.4);
}

.process-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 151, 244, 0.5);
}

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

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.process-btn.loading .spinner {
    display: block;
}

.process-btn.loading #processText {
    display: none;
}

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

.results-section {
    background: #f7fafc;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-header h3 {
    color: #2d3748;
    font-size: 1.3rem;
}

.row-count {
    background: #0097F4;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #3858A6;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s;
}

tbody tr:hover {
    background: #f7fafc;
}

td {
    padding: 12px;
    color: #4a5568;
    font-size: 0.95rem;
}

.download-section {
    text-align: center;
    margin-top: 25px;
}

.download-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.5);
}

.download-btn svg {
    width: 20px;
    height: 20px;
}

.error-message {
    background: #fed7d7;
    border: 1px solid #fc8181;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.error-message svg {
    width: 24px;
    height: 24px;
    color: #c53030;
    flex-shrink: 0;
}

.error-message p {
    color: #742a2a;
    font-size: 0.95rem;
}

/* Scrollbar Styles */
.table-container::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Responsive Design */
@media (max-width: 640px) {
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    main {
        padding: 20px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .upload-icon {
        width: 48px;
        height: 48px;
    }
    
    .table-container {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 8px;
    }
}
