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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
}

.container {
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    gap: 20px;
    padding: 20px;
}

/* Header */
.main-header {
    grid-column: 1 / -1;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 15px;
    color: white;
    text-align: center;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

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

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

/* Sidebar */
.sidebar {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.sidebar-header h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.upload-section {
    margin-bottom: 2rem;
}

.upload-label {
    display: block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 500;
}

.upload-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.file-input {
    display: none;
}

.file-info {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #666;
}

.filters-section, .info-section {
    margin-bottom: 2rem;
}

.filters-section h4, .info-section h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.checkbox-group {
    max-height: 200px;
    overflow-y: auto;
}

.checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.checkbox-item:hover {
    background: #e9ecef;
}

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

/* Main Content */
.main-content {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    border-radius: 15px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 4rem 2rem;
}

.welcome-content i {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.welcome-content h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.feature {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature i {
    font-size: 1.5rem;
    color: #667eea;
    margin-right: 0.5rem;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 2rem;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Tab Content */
.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.metric-card {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
    transition: transform 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
}

.metric-value {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.metric-label {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.metric-delta {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 20px;
    background: #e3f2fd;
    color: #1976d2;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Tables */
.table-container {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Map Container */
.map-container {
    margin-bottom: 2rem;
}

#routeMap {
    height: 1000px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* External Visualizer */
.external-viz {
    margin-bottom: 2rem;
}

.external-viz iframe {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Suggestions */
.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.suggestion-card {
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.suggestion-card.success {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border-left: 4px solid #4caf50;
}

.suggestion-card.warning {
    background: linear-gradient(135deg, #fff3e0, #ffcc02);
    border-left: 4px solid #ff9800;
}

/* Animation Controls */
.animation-controls {
    margin-top: 20px;
}

.animation-controls button {
    transition: all 0.3s ease;
    font-weight: 500;
}

.animation-controls button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.animation-controls button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.animation-controls input[type="range"] {
    accent-color: #667eea;
}

/* Vehicle and Customer Markers */
.vehicle-marker {
    z-index: 1000;
    transition: transform 0.1s ease;
}

.vehicle-marker:hover {
    transform: scale(1.1);
}

.customer-marker.completed {
    z-index: 999;
}

/* Enhanced vehicle marker styling */
.leaflet-marker-icon.vehicle-marker {
    border: none !important;
    background: transparent !important;
}

/* Animation status with emojis */
#animationStatus {
    font-family: 'Segoe UI', sans-serif;
    line-height: 1.4;
}

/* Popup improvements */
.leaflet-popup-content {
    margin: 8px 12px !important;
    line-height: 1.4;
}

.leaflet-popup-content h4 {
    margin-bottom: 8px !important;
}
