#association-location-map {
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: var(--box-shadow); /* Using CSS variable from themes.css */
    border: 1px solid #dee2e6;
    height: 300px; /* default for desktop */
}

@media (max-width: 767.98px) {
    #association-location-map {
        height: 220px;
    }
}

/* Card container for the map */
.association-map-card .card-body {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

/* Custom marker styles */
.leaflet-div-icon.custom-association-marker {
    background: white;
    border: 3px solid #0d6efd;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
    transition: all 0.3s ease;
}

.leaflet-div-icon.custom-association-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

.custom-association-marker i {
    color: #0d6efd !important;
    font-size: 14px;
}

/* Popup styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-popup-content {
    margin: 12px 16px !important;
    font-family: inherit;
}

.association-map-popup {
    font-size: 14px;
    line-height: 1.5;
}

.association-map-popup strong {
    color: #0d6efd;
    font-weight: 600;
}

.association-map-popup .coordinates {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* Map controls styling */
.leaflet-control-zoom a {
    color: #0d6efd !important;
}

.leaflet-control-zoom a:hover {
    background-color: #0d6efd !important;
    color: white !important;
}

/* Loading state */
.association-map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: #f8f9fa;
    border-radius: 0.375rem;
    color: #6c757d;
}

/* Error state */
.association-map-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: #f8f9fa;
    border-radius: 0.375rem;
    color: #dc3545;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #association-location-map {
        height: 250px !important;
    }
    
    .association-map-popup {
        font-size: 13px;
    }
    
    .custom-association-marker {
        width: 32px !important;
        height: 32px !important;
    }
    
    .custom-association-marker i {
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    #association-location-map {
        height: 200px !important;
    }
    
    .leaflet-popup-content {
        margin: 8px 12px !important;
    }
    
    /* Show a smaller map icon on mobile instead of hiding it */
    .map-link {
        display: inline-flex !important;
        width: 20px;
        height: 20px;
        padding: 2px;
        border-radius: 4px;
        align-items: center;
        justify-content: center;
        color: inherit;
    }

    .map-link i {
        font-size: 0.75rem;
    }

    /* Ensure address text reserves space for the small icon */
    .address-text {
        max-width: calc(100% - 28px);
    }
}

/* Hover effects for map container */
.association-map-card:hover {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

/* Coordinates display styling */
.map-coordinates-display {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', 'Courier New', monospace;
    font-size: 0.875rem;
    color: #6c757d;
    background: rgba(108, 117, 125, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Status dot used in detail views */
.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex: 0 0 12px;
    vertical-align: middle;
    margin-right: 0.35rem;
}
.status-dot--ok { background-color: #198754; }
.status-dot--danger { background-color: #dc3545; }

/* Inline map icon next to address (detail view) */
.address-text { 
    display: inline-block; 
    max-width: calc(100% - 28px); 
}

.map-link { 
    color: inherit; 
    text-decoration: none; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    width: 22px; 
    height: 22px; 
    border-radius: 4px; 
}

.map-link i { 
    font-size: 0.95rem; 
}

.map-link:focus { 
    outline: 3px solid rgba(13,110,253,.18); 
    outline-offset: 2px; 
}

/* Action fields badges styling for detail view */
.action-fields-badges .badge {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .action-fields-badges .badge {
        max-width: 140px;
    }
}

.action-fields-badges { 
    gap: 0.35rem; 
}

@media (max-width: 576px) {
    .action-fields-badges { 
        gap: 0.25rem; 
    }
    .action-fields-badges .badge { 
        font-size: 0.8rem; 
    }
}

/* ===================================
   DIAGNOSTICS CARDS
   =================================== */

.diagnostic-card {
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.diagnostic-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(15,23,42,0.06);
}

.diagnostic-card .card-body {
    padding: 1rem;
}

.diagnostic-card h5.card-title {
    font-weight: 600;
    color: #212529;
}

.diagnostic-card dl dt {
    color: #6c757d;
    font-size: 0.85rem;
}

.diagnostic-card dl dd {
    margin-left: 0;
    font-size: 0.9rem;
}

.diagnostic-card .badge {
    background: #f8f9fa;
    color: #212529;
    border: 1px solid rgba(0,0,0,0.03);
}
