/**
 * Map styles for AgriLocator Pro
 */

/* Main map container */
.agrilocator-map-container {
    position: relative;
    margin-bottom: 30px;
}

/* Map canvas */
#agrilocator-map {
    width: 100%;
    height: 550px;
    border-radius: 4px;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Loading indicator */
#agrilocator-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.agrilocator-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #2271b1;
    animation: agrilocator-spin 1s ease-in-out infinite;
}

@keyframes agrilocator-spin {
    to { transform: rotate(360deg); }
}

/* Legend */
.agrilocator-map-legend {
    background-color: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    max-width: 200px;
    min-width: 150px;
}

.agrilocator-map-legend h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: bold;
}

.agrilocator-legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.agrilocator-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 8px;
    flex-shrink: 0;
}

.agrilocator-legend-label {
    font-size: 12px;
}

/* Custom tooltip styling */
.agrilocator-tooltip {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0;
    width: 220px;
    max-width: 100%;
}

.agrilocator-tooltip.leaflet-tooltip-top:before {
    border-top-color: rgba(255, 255, 255, 0.95);
}

.agrilocator-farm-tooltip {
    padding: 10px;
}

.agrilocator-farm-tooltip h5 {
    margin: 0 0 8px 0;
    padding: 0 0 5px 0;
    font-size: 15px;
    border-bottom: 1px solid #eee;
    color: #2271b1;
}

.tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tooltip-insight {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.tooltip-insight i {
    width: 14px;
    text-align: center;
    color: #666;
}

.tooltip-hint {
    margin-top: 8px;
    font-size: 11px;
    color: #999;
    font-style: italic;
    text-align: center;
    padding-top: 5px;
    border-top: 1px dotted #eee;
}

/* Popup styles */
.farm-popup {
    max-width: 300px;
}

.farm-popup h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2271b1;
    font-size: 16px;
}

.farm-popup p {
    margin: 5px 0;
    font-size: 13px;
}

.farm-popup-details {
    margin-top: 10px;
    text-align: right;
}

.farm-popup-details a {
    color: #2271b1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.farm-popup-details a:hover {
    text-decoration: underline;
}

/* Farm details */
#agrilocator-selected-farm {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-top: 20px;
}

#agrilocator-selected-farm h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2271b1;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.agrilocator-farm-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.agrilocator-farm-details-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agrilocator-farm-detail-item {
    margin-bottom: 10px;
}

.agrilocator-farm-detail-label {
    font-weight: bold;
    color: #555;
    margin-bottom: 2px;
    font-size: 13px;
}

.agrilocator-farm-detail-value {
    color: #333;
    font-size: 14px;
}

/* Filter styles */
.agrilocator-filters {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.agrilocator-filters h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

.agrilocator-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.agrilocator-filter-group {
    flex: 1;
    min-width: 200px;
}

.agrilocator-filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 13px;
    color: #555;
}

.agrilocator-filter-group select,
.agrilocator-filter-group input[type="number"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.agrilocator-filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: flex-end;
}

.agrilocator-filter-actions button {
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
}

.agrilocator-filter-actions button:hover {
    background-color: #f5f5f5;
}

#apply-filters {
    background-color: #2271b1;
    color: white;
    border-color: #2271b1;
}

#apply-filters:hover {
    background-color: #135e96;
}

/* Intervention type checkboxes */
.agrilocator-intervention-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.agrilocator-intervention-checkbox {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.agrilocator-intervention-checkbox label {
    margin-left: 5px;
    cursor: pointer;
    font-size: 13px;
}

/* Section headers */
.agrilocator-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.agrilocator-section-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2271b1;
}

.agrilocator-toggle-button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 14px;
}

.agrilocator-toggle-button:hover {
    color: #2271b1;
}

/* Export buttons */
.agrilocator-export-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.agrilocator-export-button {
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    display: flex;
    align-items: center;
}

.agrilocator-export-button i {
    margin-right: 5px;
}

.agrilocator-export-button:hover {
    background-color: #f5f5f5;
}

/* Statistics */
.agrilocator-statistics {
    margin-bottom: 30px;
}

.agrilocator-stats-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.agrilocator-stat-card {
    flex: 1;
    min-width: 150px;
    padding: 15px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
    border-top: 3px solid #2271b1;
}

.agrilocator-stat-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #2271b1;
}

.agrilocator-stat-label {
    font-size: 14px;
    color: #555;
}

.agrilocator-chart-row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.agrilocator-chart-container {
    flex: 1;
    min-width: 300px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.agrilocator-chart-container h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .agrilocator-farm-details {
        grid-template-columns: 1fr;
    }
    
    .agrilocator-chart-row {
        flex-direction: column;
    }
    
    .agrilocator-filter-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .agrilocator-filter-group {
        width: 100%;
    }
    
    #agrilocator-map {
        height: 400px;
    }
}