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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
}

h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

/* Dropzone */
#dropzone {
    border: 3px dashed #667eea;
    border-radius: 8px;
    padding: 60px 40px;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

#dropzone:hover,
#dropzone.dragover {
    background: #eef1ff;
    border-color: #764ba2;
    transform: translateY(-2px);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    color: #667eea;
    opacity: 0.7;
}

.dropzone-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
}

.dropzone-subtext {
    font-size: 0.95rem;
    color: #7f8c8d;
}

/* Stats */
#stats {
    margin-bottom: 30px;
}

.stats-content {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
}

.badge-success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.badge-error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* Errors section */
#errors {
    background: #fff3cd;
    border-left: 4px solid #ff9800;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 6px;
}

.errors-header h2 {
    color: #856404;
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.errors-header p {
    color: #856404;
    margin-bottom: 15px;
}

#errorList {
    max-height: 300px;
    overflow-y: auto;
}

.error-item {
    background: white;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    border-left: 3px solid #f44336;
    font-size: 0.9rem;
}

.error-item strong {
    color: #d32f2f;
}

.error-data {
    color: #666;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

/* Preview section */
#preview {
    margin-bottom: 30px;
}

.preview-section {
    margin-bottom: 40px;
}

.preview-section h2 {
    margin-bottom: 15px;
}

.table-container {
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

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

th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

th:last-child {
    border-right: none;
}

tbody tr {
    border-bottom: 1px solid #eee;
}

tbody tr:hover {
    background: #f8f9fa;
}

td {
    padding: 10px 15px;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px solid #eee;
}

td:last-child {
    border-right: none;
}

/* Export section */
#exportSection {
    text-align: center;
    margin-top: 40px;
}

#exportBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#exportBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#exportBtn:active:not(:disabled) {
    transform: translateY(0);
}

#exportBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

#exportBtn svg {
    flex-shrink: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    #dropzone {
        padding: 40px 20px;
    }

    .dropzone-text {
        font-size: 1.1rem;
    }

    .stats-content {
        flex-direction: column;
    }

    .badge {
        width: 100%;
        text-align: center;
    }

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

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 8px 10px;
        max-width: 150px;
    }

    #exportBtn {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

/* Scrollbar styling */
.table-container::-webkit-scrollbar,
#errorList::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.table-container::-webkit-scrollbar-track,
#errorList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb,
#errorList::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover,
#errorList::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}
