/**
 * Leaflet/OSM Custom Styles
 * 
 * Replace googleMapIcon styles with these leaflet-map-icon styles
 * Add this to your main CSS file or include separately
 */

/* Custom map control buttons (replaces .googleMapIcon) */
.leaflet-map-icon {
    background-color: #fff;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    margin-bottom: 10px;
    text-align: center;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.leaflet-map-icon:hover {
    background-color: #f4f4f4;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.leaflet-map-icon:active {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(0);
}

.leaflet-map-icon img {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

/* Top center control position */
.leaflet-top-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
}

.leaflet-top-center .leaflet-control {
    pointer-events: auto;
}

/* Left center control position */
.leaflet-left-center {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

/* Right center control position */
.leaflet-right-center {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

/* Bottom center control position */
.leaflet-bottom-center {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 1000;
}

/* Custom control container */
.leaflet-control-custom {
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Airport popup styling */
.airport-popup {
    font-family: Arial, sans-serif;
    min-width: 200px;
}

.airport-popup h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #2c3e50;
}

.airport-popup p {
    margin: 5px 0;
    font-size: 13px;
    color: #555;
}

.airport-popup strong {
    color: #2980b9;
    font-size: 14px;
}

/* Route info popup */
.route-popup {
    font-family: Arial, sans-serif;
}

.route-popup .route-info {
    margin: 5px 0;
    font-size: 12px;
}

.route-popup .airline-name {
    font-weight: bold;
    color: #3498db;
}

/* Animated plane marker */
.plane-marker {
    transition: transform 0.1s linear;
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
}

.leaflet-popup-content {
    margin: 13px 19px;
    line-height: 1.4;
}

.leaflet-popup-tip {
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
}

/* Hide Leaflet attribution in fullscreen if desired */
.leaflet-container.fullscreen-mode .leaflet-control-attribution {
    display: none;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .leaflet-map-icon {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .leaflet-map-icon img {
        width: 20px;
        height: 20px;
    }
    
    .leaflet-control-zoom {
        margin-left: 5px !important;
        margin-top: 5px !important;
    }
    
    .leaflet-control-attribution {
        font-size: 9px;
    }
}

/* Dark mode support */
body.dark-mode .leaflet-map-icon {
    background-color: #2c3e50;
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .leaflet-map-icon:hover {
    background-color: #34495e;
}

body.dark-mode .leaflet-popup-content-wrapper {
    background-color: #2c3e50;
    color: #ecf0f1;
}

body.dark-mode .leaflet-popup-tip {
    background-color: #2c3e50;
}

/* Disable pointer events on control containers to allow map interaction */
.leaflet-control-container {
    pointer-events: none;
}

.leaflet-control-container .leaflet-control {
    pointer-events: auto;
}

/* Fix for z-index issues with polylines and markers */
.leaflet-overlay-pane svg {
    z-index: 400;
}

.leaflet-marker-pane {
    z-index: 600;
}

.leaflet-popup-pane {
    z-index: 700;
}

/* Custom loading indicator for tiles */
.leaflet-tile-container.leaflet-zoom-animated {
    transition: opacity 0.2s ease-in-out;
}

/* Smooth zoom animation */
.leaflet-zoom-anim .leaflet-zoom-animated {
    transition: transform 0.25s cubic-bezier(0, 0, 0.25, 1);
}

/* Custom marker cluster styles (if using Leaflet.markercluster) */
.marker-cluster-small {
    background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster-small div {
    background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster-medium {
    background-color: rgba(240, 194, 12, 0.6);
}

.marker-cluster-medium div {
    background-color: rgba(240, 194, 12, 0.6);
}

.marker-cluster-large {
    background-color: rgba(241, 128, 23, 0.6);
}

.marker-cluster-large div {
    background-color: rgba(241, 128, 23, 0.6);
}

.marker-cluster {
    background-clip: padding-box;
    border-radius: 20px;
}

.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 15px;
    font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
}

.marker-cluster span {
    line-height: 30px;
}
