/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

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

/* Upload Section */
.upload-section {
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    background-color: #fafafa;
    border-bottom: 1px solid #e0e0e0;
}

.file-upload {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px dashed #ccc;
    transition: border-color 0.3s;
}

.file-upload:hover {
    border-color: #2196F3;
}

.file-upload h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #2196F3;
}

.file-upload input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.file-info {
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-left: 3px solid #2196F3;
    font-size: 0.9rem;
    color: #666;
}

/* Config Section */
.config-section {
    padding: 30px;
    background-color: white;
}

.config-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
}

.config-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.config-item {
    display: flex;
    flex-direction: column;
}

.config-item.full-width {
    grid-column: 1 / -1;
}

.config-item label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 0.95rem;
}

.config-item select,
.config-item input[type="text"],
.config-item input[type="number"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.config-item select:focus,
.config-item input[type="text"]:focus,
.config-item input[type="number"]:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.config-item small {
    margin-top: 5px;
    color: #999;
    font-size: 0.85rem;
}

/* Checkbox Group */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    max-height: 200px;
    overflow-y: auto;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.checkbox-group label:hover {
    background-color: #e3f2fd;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-primary {
    background-color: #2196F3;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.btn-secondary {
    background-color: #4CAF50;
    color: white;
}

.btn-secondary:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.btn-primary:disabled,
.btn-secondary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Results Section */
.results-section {
    padding: 30px;
    background-color: white;
    border-top: 1px solid #e0e0e0;
}

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

.results-header h3 {
    font-size: 1.5rem;
    color: #333;
}

.results-stats {
    background-color: #e3f2fd;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    color: #1976D2;
}

.results-stats span {
    color: #2196F3;
    font-size: 1.1rem;
}

/* Table Container */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

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

thead th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 2px solid #1976D2;
}

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

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

tbody tr:hover {
    background-color: #e3f2fd;
}

tbody td {
    padding: 12px 15px;
    font-size: 0.9rem;
    color: #555;
}

tbody td:first-child {
    font-weight: 600;
    color: #2196F3;
}

/* Error Message */
.error-message {
    margin: 20px 30px;
    padding: 15px;
    background-color: #ffebee;
    border-left: 4px solid #F44336;
    border-radius: 5px;
    color: #c62828;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    header p {
        font-size: 0.9rem;
    }

    .upload-section,
    .config-section,
    .results-section {
        padding: 20px;
    }

    .config-row {
        grid-template-columns: 1fr;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-container {
        font-size: 0.85rem;
    }

    thead th,
    tbody td {
        padding: 10px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(33, 150, 243, 0.3);
    border-radius: 50%;
    border-top-color: #2196F3;
    animation: spin 1s ease-in-out infinite;
}

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

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
