@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@400;500;600;700&display=swap');

/**
 * Frontend styles for the Paragliding Map plugin
 */

/* Map container styles */
.paragliding-map-container {
    position: relative;
    margin: 18px auto 40px;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box; /* Include padding in width calculation */
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: none;
    clear: both;
    overflow: hidden;
    overflow-x: hidden; /* Prevent horizontal scroll */
    max-width: 1440px;
    font-family: 'Urbanist', sans-serif;
}

@media (min-width: 1520px) {
    .paragliding-map-container {
        padding: 0 40px;
    }
}

.paragliding-map {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: none;
    z-index: 1;
    min-height: 400px !important;
}

/* Fix for Leaflet attribution control */
.leaflet-control-attribution {
    clear: both;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.7);
    padding: 0 5px;
    margin: 0;
}

.leaflet-control-attribution a {
    color: #0078A8;
    text-decoration: none;
}

.leaflet-bottom {
    z-index: 900 !important;
}

/* Popup styles */
.leaflet-popup-content {
    text-align: center;
}

.leaflet-popup-content .view-details-btn {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 8px;
    font-size: 12px;
    display: inline-block;
}

.leaflet-popup-content .view-details-btn:hover {
    background-color: #005177;
}

.leaflet-popup-content .google-maps-link {
    display: block;
    margin-top: 8px;
    padding: 5px 10px;
    background-color: #34A853;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

.leaflet-popup-content .google-maps-link:hover {
    background-color: #2D8E47;
    text-decoration: none;
}

/* Site details panel */
.paragliding-site-details {
    position: absolute;
    top: 0;
    right: 0;
    width: 350px;
    max-width: 90%;
    height: 100%;
    background-color: white;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
    overflow-y: auto;
}

.paragliding-site-details.active {
    transform: translateX(0);
    border-left: 1px solid #ddd;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
}

.site-details-header {
    background-color: #0073aa;
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.site-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-details {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.site-details-content {
    padding: 20px;
}

.site-thumbnail {
    margin-bottom: 15px;
}

.site-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* Info sections */
.site-info, .takeoff-info, .landing-info, .additional-info {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.site-info h3, .takeoff-info h3, .landing-info h3, .additional-info h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
}

/* Google Maps buttons in detail panel */
.detail-google-maps-btn {
    display: inline-block;
    padding: 8px 15px;
    background-color: #34A853;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    margin-top: 5px;
}

.detail-google-maps-btn:hover {
    background-color: #2D8E47;
    text-decoration: none;
    color: white;
}

/* Header and Legend Styles */
.paragliding-map-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    font-family: 'Urbanist', sans-serif;
}

.paragliding-map-title-section {
    flex: 1;
    min-width: 300px;
    padding-right: 20px;
}

.paragliding-map-title {
    color: #BA1B1B;
    font-family: "Urbanist", sans-serif;
    font-size: 40px;
    font-weight: 500;
    font-style: normal;
    letter-spacing: 0;
    line-height: 100%;
    margin: 0 0 10px 0;
}

.paragliding-map-description {
    color: #757575; /* Grey color */
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

.paragliding-map-legend {
    display: flex;
    gap: 25px;
    margin-top: 10px;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
}

.legend-icon.takeoff-icon {
    background-color: #2ECC71; /* Green */
}

.legend-icon.landing-icon {
    background-color: #E74C3C; /* Red */
}

.legend-label {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .paragliding-map-container {
        padding: 0 20px;
    }
}

@media (max-width: 767px) {
    .paragliding-site-details {
        width: 85%;
    }
}

@media (max-width: 768px) {
    .paragliding-map-header {
        flex-direction: column;
    }
    
    .paragliding-map-legend {
        margin-top: 15px;
        width: 100%;
        justify-content: flex-start;
    }
}