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

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

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: #2c3e50;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 1.1rem;
    color: #5a6c7d;
}

.upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.upload-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.upload-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.upload-card p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: #667eea;
    background: #f0f4f8;
}

.file-status {
    margin-top: 10px;
    padding: 8px;
    border-radius: 5px;
    font-size: 0.9rem;
    display: none;
}

.file-status.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.file-status.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.config-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.column-mapper {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
}

.column-mapper h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.mapper-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.mapper-group h4 {
    color: #495057;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.mapping-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.mapping-row label {
    flex: 0 0 140px;
    color: #6c757d;
    font-size: 0.95rem;
}

.mapping-row select {
    flex: 1;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    background: white;
    color: #495057;
}

.state-selector {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
}

.state-selector h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.state-selector p {
    color: #6c757d;
    margin-bottom: 15px;
}

.selection-mode {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.selection-mode label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #495057;
}

.selection-mode input[type="radio"] {
    margin-right: 8px;
}

.or-divider {
    padding: 5px 15px;
    background: white;
    border-radius: 20px;
    font-weight: 600;
    color: #6c757d;
    border: 2px solid #dee2e6;
    font-size: 0.9rem;
}

.state-controls {
    margin-bottom: 15px;
}

.state-controls button {
    padding: 8px 16px;
    margin-right: 10px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 5px;
    cursor: pointer;
}

.state-controls button:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

.state-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.state-checkbox {
    display: flex;
    align-items: center;
    padding: 5px;
}

.state-checkbox input {
    margin-right: 8px;
}

.state-checkbox label {
    color: #495057;
    cursor: pointer;
}

.date-ranges {
    margin-bottom: 30px;
}

.date-ranges h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.date-range-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.date-range-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.date-range-card h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.date-range-card label {
    display: block;
    color: #6c757d;
    margin-bottom: 5px;
    margin-top: 10px;
    font-size: 0.9rem;
}

.date-range-card input[type="date"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    background: white;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.calculate-btn, .reset-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.calculate-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.reset-btn {
    background: #6c757d;
    color: white;
}

.reset-btn:hover {
    background: #5a6268;
}

.results-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.results-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    color: white;
}

.summary-card h4 {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.lift-value {
    font-size: 2rem;
    font-weight: bold;
}

.results-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}

.tab-btn.active {
    color: #667eea;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

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

table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    color: #495057;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

table tbody tr:hover {
    background: #f8f9fa;
}

.lift-analysis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.lift-table-container h4 {
    color: #495057;
    margin-bottom: 15px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.chart-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    height: 350px;
}

.export-section {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.export-section button {
    padding: 10px 25px;
    margin: 0 10px;
    border: none;
    border-radius: 5px;
    background: #28a745;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.export-section button:hover {
    background: #218838;
}

@media (max-width: 768px) {
    .upload-section,
    .mapper-grid,
    .date-range-grid,
    .summary-cards,
    .lift-analysis,
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .state-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    header h1 {
        font-size: 2rem;
    }
}