/**
 * Field Trial Success Map Styles
 * Custom styles for the field trial map display
 */

.field-trial-map {
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    overflow: hidden;
}

.field-trial-map .leaflet-container {
    border-radius: 8px;
}

/* Trial marker styles */
.trial-marker-container {
    position: relative;
    width: 60px;
    height: 40px;
}

.trial-marker-flag {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 25px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.trial-percentage {
    color: white;
    font-weight: bold;
    font-size: 11px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.trial-marker-base {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.trial-marker-icon {
    background: transparent !important;
    border: none !important;
}

/* Popup styling */
.field-trial-map .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
}

.field-trial-map .leaflet-popup-content {
    margin: 12px 16px;
    line-height: 1.4;
    font-size: 13px;
}

.trial-popup h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 14px;
}

.trial-popup p {
    margin: 4px 0;
    font-size: 12px;
}

/* Environment legend styling */
.environment-legend {
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    font-size: 12px;
    line-height: 1.4;
}

.environment-legend h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 2px 0;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 6px;
    border: 1px solid #ccc;
}

/* Responsive design */
@media (max-width: 768px) {
    .field-trial-map {
        margin: 10px 0;
        border-radius: 4px;
    }
    
    .field-trial-map .leaflet-container {
        border-radius: 4px;
    }
    
    .trial-marker-container {
        width: 50px;
        height: 35px;
    }
    
    .trial-marker-flag {
        width: 40px;
        height: 20px;
    }
    
    .trial-percentage {
        font-size: 10px;
    }
    
    .environment-legend {
        font-size: 11px;
        padding: 8px;
    }
}

/* Loading state */
.field-trial-map.loading {
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.field-trial-map.loading::before {
    content: "Loading map...";
    color: #666;
    font-size: 14px;
}

/* Error state */
.field-trial-map.error {
    background: #f8f8f8;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #666;
}

.field-trial-map.error::before {
    content: "Map failed to load. Please refresh the page.";
    text-align: center;
    padding: 20px;
}
