* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: white;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    text-align: center;
    padding: 60px 20px;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header p {
    font-size: 1.3rem;
    opacity: 0.95;
    font-weight: 400;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Planning Section */
.planning-section {
    margin-bottom: 40px;
}

.transport-mode-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f8f9fa;
}

.transport-mode-section h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Map Section */
.map-section {
    margin-bottom: 40px;
}

.map-container {
    position: relative;
    height: 500px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

#routeMap {
    height: 100%;
    width: 100%;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.section h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 25px;
    font-weight: 600;
    position: relative;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    border-radius: 2px;
}

.route-planner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

select, input {
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

select:focus, input:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

select:hover, input:hover {
    border-color: #cdd5df;
}

.btn-primary {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.transport-toggle {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.toggle-btn {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
}

.toggle-btn:hover {
    border-color: #4A90E2;
    background: #f8fbff;
}

.toggle-btn.active {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    border-color: #4A90E2;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.selected-route {
    background: #f8fbff;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #4A90E2;
    color: #666;
    font-size: 15px;
    line-height: 1.6;
}

.analysis-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.chart-info, .selection-info {
    background: #e3f2fd;
    color: #1976d2;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

.chart-container {
    position: relative;
    height: 220px;
    margin-bottom: 20px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.legend-color.high-safety {
    background-color: #4caf50;
}

.legend-color.moderate-safety {
    background-color: #ff9800;
}

.legend-color.low-safety {
    background-color: #f44336;
}

.legend-color.bus-color {
    background-color: #4A90E2;
}

.legend-color.train-color {
    background-color: #8b5cf6;
}

.schedules-section {
    margin-bottom: 20px;
}

.schedule-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.schedule-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease;
}

.schedule-card:hover {
    transform: translateY(-2px);
}

.schedule-card h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 25px;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.route-item {
    background: #f8fbff;
    margin: 15px 0;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #4A90E2;
    cursor: pointer;
    transition: all 0.3s ease;
}

.route-item:hover {
    background: #f0f7ff;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.1);
}

.route-item.selected {
    background: #e3f2fd;
    border-left-color: #1976d2;
    box-shadow: 0 4px 15px rgba(25, 118, 210, 0.2);
}

.route-header {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 16px;
}

.route-details {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.price {
    font-weight: 700;
    color: #4caf50;
    font-size: 15px;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.info-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    text-align: center;
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.info-card h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.info-card p {
    color: #666;
    font-size: 15px;
    line-height: 1.7;
}

/* Emergency Contacts Section */
.emergency-section {
    margin-bottom: 40px;
}

.emergency-section h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 30px;
    font-weight: 600;
    text-align: center;
    position: relative;
}

.emergency-section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-radius: 2px;
}

.emergency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.emergency-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    border-left: 5px solid #e74c3c;
    transition: all 0.3s ease;
    position: relative;
}

.emergency-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-left-color: #c0392b;
}

.emergency-card h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.emergency-card p {
    color: #555;
    font-size: 14px;
    line-height: 1.8;
    font-family: 'Courier New', monospace;
}

.emergency-card strong {
    color: #2c3e50;
    font-weight: 600;
}

.hidden {
    display: none;
}

/* Custom Map Styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
}

/* Custom Marker Styles */
.blue-marker {
    background-color: #4A90E2;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.5);
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
    z-index: 1000;
    font-weight: 500;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .schedule-grid {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .emergency-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .header {
        padding: 40px 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1.1rem;
    }
    
    .container {
        padding: 20px 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .transport-toggle {
        flex-direction: column;
        gap: 10px;
    }
    
    .chart-legend {
        justify-content: space-around;
        gap: 15px;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 20px;
    }
    
    .map-container {
        height: 350px;
    }
    
    .content-grid {
        gap: 25px;
    }
    
    .emergency-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 30px 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .section h2 {
        font-size: 1.3rem;
    }
    
    .chart-container {
        height: 180px;
    }
    
    .schedule-card, .section {
        padding: 20px;
    }
    
    .emergency-card {
        padding: 20px;
    }
    
    .emergency-card h3 {
        font-size: 1.1rem;
    }
    
    .emergency-card p {
        font-size: 13px;
    }
}