/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #4a4a4a;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #fafafa;
}

/* Header Styles */
header {
    background-color: rgba(255, 255, 255, 0.9);
    color: #4a4a4a;
    text-align: center;
    padding: 0.8rem 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

header h1 {
    margin-bottom: 0.2rem;
    font-weight: 500;
    color: #4CAF50;
    letter-spacing: -0.5px;
    font-size: 1.4rem;
}

header p {
    color: #757575;
    font-size: 0.85rem;
}

/* Main Content */
main {
    flex: 1;
    padding: 0;
    width: 100%;
    height: 100vh;
}

/* Map Container */
#map {
    height: 100vh;
    width: 100%;
    z-index: 1;
}

/* Remove hover effect since map is now full-width */

/* Footer Styles */
footer {
    background-color: rgba(255, 255, 255, 0.9);
    text-align: center;
    padding: 0.5rem;
    font-size: 0.8rem;
    color: #757575;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

footer a {
    color: #4CAF50;
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #388E3C;
    text-decoration: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header {
        padding: 0.6rem 1rem;
    }
    
    header h1 {
        font-size: 1.2rem;
    }
    
    header p {
        font-size: 0.75rem;
    }
    
    footer {
        padding: 0.4rem;
        font-size: 0.7rem;
    }
}

/* Custom Leaflet Overrides for Modern Look */
.leaflet-control-zoom,
.leaflet-control-layers {
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
    border: none !important;
}

/* Adjust control positions to account for header and footer */
.leaflet-top {
    top: 80px !important; /* Give space for the header */
}

.leaflet-bottom {
    bottom: 40px !important; /* Give space for the footer */
}

.leaflet-control-zoom a,
.leaflet-control-layers-toggle {
    background-color: white !important;
    color: #4a4a4a !important;
    transition: all 0.2s ease;
}

.leaflet-control-zoom a:hover,
.leaflet-control-layers-toggle:hover {
    background-color: #f5f5f5 !important;
    color: #4CAF50 !important;
}

/* Layer Control Styling */
.leaflet-control-layers {
    padding: 6px !important;
}

.leaflet-control-layers-expanded {
    padding: 10px 12px 10px 12px !important;
    background-color: white !important;
    font-family: 'Poppins', 'Segoe UI', sans-serif !important;
    font-size: 14px !important;
    color: #4a4a4a !important;
    min-width: 150px !important;
}

.leaflet-control-layers-selector {
    margin-right: 6px !important;
}

.leaflet-control-layers-selector:checked + span {
    font-weight: 500 !important;
    color: #4CAF50 !important;
}

.leaflet-control-layers-list {
    margin-bottom: 0 !important;
}

.leaflet-control-layers-base label {
    margin-bottom: 5px !important;
    display: flex !important;
    align-items: center !important;
}

.leaflet-control-layers-base label:last-child {
    margin-bottom: 0 !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1) !important;
}

.leaflet-popup-content {
    margin: 14px 20px !important;
    font-family: 'Poppins', 'Segoe UI', sans-serif !important;
}

.leaflet-popup-tip {
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1) !important;
}

/* Route and Node Popup Styles */
.route-popup h3, .node-popup h3 {
    color: #4CAF50;
    margin: 0 0 8px 0;
    font-weight: 600;
    font-size: 16px;
}

.route-popup p, .node-popup p {
    margin: 5px 0;
    color: #757575;
    font-size: 14px;
}

/* Legend Styles */
.route-legend {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    max-width: 250px;
}

.route-legend h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #4a4a4a;
}

.route-type {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.route-color {
    width: 20px;
    height: 4px;
    margin-right: 8px;
    border-radius: 2px;
}

.route-label {
    font-size: 13px;
    color: #757575;
}

/* Node Styles */
.node-icon {
    background: transparent;
    border: none;
}

.node-circle {
    width: 24px;
    height: 24px;
    background-color: #0000FF;
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #ffffff;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Custom Track Styles */
.custom-track-control a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    transition: all 0.2s ease;
}

.custom-track-control a:hover {
    background-color: #f5f5f5;
}

.distance-panel {
    transition: all 0.3s ease;
}

.distance-panel button {
    transition: all 0.2s ease;
}

.distance-panel button:hover {
    background-color: #e0e0e0 !important;
}

/* Highlight nodes when in custom track mode */
.custom-track-active .node-circle {
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(0, 0, 255, 0.6);
}

/* Highlight selected nodes in red */
.node-selected .node-circle {
    background-color: #FF0000 !important;
    transform: scale(1.2) !important;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.6) !important;
}
