/* Europe Map Styles */

.btn-orange {
    background-color: #f7941d;
    border-color: #f7941d;
    color: #fff;
}

.btn-orange:hover,
.btn-orange:focus {
    background-color: #d47a0a;
    border-color: #d47a0a;
    color: #fff;
}

/* Legend */
.map-legend {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    font-size: 13px;
    line-height: 1.5;
    min-width: 180px;
    overflow: hidden;
}

.map-legend-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    gap: 10px;
    letter-spacing: 0.01em;
}

.map-legend-toggle:hover {
    background: rgba(0,0,0,0.05);
    color: #f7941d;
}

.map-legend-toggle-icon {
    font-size: 13px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
    opacity: 0.6;
}

.map-legend-toggle:hover .map-legend-toggle-icon {
    opacity: 1;
}

.map-legend--collapsed .map-legend-toggle-icon {
    transform: rotate(-90deg);
}

.map-legend-body {
    padding: 0 14px 10px;
    display: block;
}

.map-legend--collapsed .map-legend-body {
    display: none;
}

.map-legend-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #444;
    margin-bottom: 3px;
}

.map-legend-item:last-child {
    margin-bottom: 0;
}

.map-legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Map container */
#europe-map {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1;
}

/* Smaller zoom controls */
#europe-map .leaflet-control-zoom a {
    width: 26px;
    height: 26px;
    line-height: 26px;
    font-size: 14px;
}

#europe-map .leaflet-control-zoom {
    border: none;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
}

/* Home button container - remove extra border */
#europe-map .leaflet-bar:has(.leaflet-control-home) {
    border: none;
    box-shadow: none;
    background: transparent;
}

/* Home button control - match zoom button exactly */
#europe-map .leaflet-control-home {
    width: 26px !important;
    height: 26px !important;
    line-height: 26px !important;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    display: block;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
}

#europe-map .leaflet-control-home:hover {
    background-color: #f4f4f4;
    color: #f7941d;
}

#europe-map .leaflet-control-home i {
    vertical-align: middle;
    line-height: 26px;
}

/* Fullscreen control */
#europe-map .leaflet-control-fullscreen a {
    width: 26px !important;
    height: 26px !important;
}

#europe-map .fullscreen-icon,
#europe-map.leaflet-touch .fullscreen-icon {
    background-size: 26px 52px !important;
    background-position: 0 0 !important;
}

#europe-map .fullscreen-icon.leaflet-fullscreen-on,
#europe-map.leaflet-touch .fullscreen-icon.leaflet-fullscreen-on {
    background-position: 0 -26px !important;
}

/* Responsive map height */
@media (max-width: 768px) {
    #europe-map {
        height: 350px;
    }
}

@media (max-width: 576px) {
    #europe-map {
        height: 300px;
    }
}

/* Custom coal heap marker */
.coal-heap-marker {
    color: #f7941d;
    font-size: 24px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.coal-heap-marker i {
    display: block;
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
    margin: 12px 16px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.leaflet-popup-content strong {
    color: #f7941d;
}

/* Heap label tooltip */
.heap-label {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #f7941d;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.heap-label::before {
    border-right-color: #f7941d;
}

/* Map section styling */
.map-section {
    position: relative;
}

.map-cta-strip {
    background: #f8f9fa;
    padding: 0.75rem 0;
    text-align: center;
}

.map-section h2 {
    margin-bottom: 1.5rem;
}

/* Map loading state */
.map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 500px;
    background: #f8f9fa;
    border-radius: 8px;
}

.map-loading::after {
    content: 'Loading map...';
    color: #6c757d;
}

/* Detail button in popup */
.btn-detail {
    display: inline-block;
    background-color: #f7941d;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-detail:hover {
    background-color: #d97a0a;
    color: #fff;
    text-decoration: none;
}

/* Map data loader overlay */
.map-loader {
    position: absolute;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(2px);
    border-radius: 8px;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.map-loader--hiding {
    opacity: 0;
}

.map-loader-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(247, 148, 29, 0.2);
    border-top-color: #f7941d;
    border-radius: 50%;
    animation: map-spin 0.75s linear infinite;
}

@keyframes map-spin {
    to { transform: rotate(360deg); }
}
