
/**
 * Mapa Pomocy CSS
 * Complete styling for the map and markers
 */

/* Leaflet overrides */
.leaflet-container a {
    color: white;
}

.leaflet-touch .leaflet-bar a:first-child {
    color: black;	
}

.leaflet-touch .leaflet-bar a:last-child {
    color: black;	
}

/* Main container */
.mapa-pomocy-container {
    position: relative;
    width: 100%;
    margin: 20px 0;
}

/* Filters section */
.mapa-pomocy-filters {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.mapa-pomocy-filters h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

/* Filter grid layout - 4 columns on desktop */
.filter-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

/* Large tablet: 3 columns */
@media (min-width: 1025px) and (max-width: 1200px) {
    .filter-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet: 2 columns */
@media (min-width: 769px) and (max-width: 1024px) {
    .filter-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: 1 column */
@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.filter-group {
    display: flex;
    flex-direction: column;
}

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

.filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    color: #333;
    transition: border-color 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.filter-group select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.filter-group select.no-options {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

.filter-updating {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.filter-updating::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 10px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: filterSpin 1s linear infinite;
}

@keyframes filterSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.filter-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.apply-btn {
    background-color: #007cba;
    color: white;
}

.apply-btn:hover {
    background-color: #005a87;
}

.reset-btn {
    background-color: #6c757d;
    color: white;
}

.reset-btn:hover {
    background-color: #545b62;
}

/* Map element */
#mapa-pomocy-map {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
}

/* Loading message */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-size: 16px;
    color: #333;
    display: none;
}

/* Hide any map info messages */
.map-info {
    display: none !important;
}

/* Map messages */
.map-message {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 15px;
    text-align: center;
}

.map-message.no-markers {
    border-left: 4px solid #ffa500;
    background-color: #fff8e1;
}

.map-message.error {
    border-left: 4px solid #dc3545;
    background-color: #f8d7da;
    color: #721c24;
}

.map-message p {
    margin: 5px 0;
    font-size: 14px;
}

.leaflet-popup-content {
    margin: 15px !important;
    width: auto !important;
    max-width: none !important;
}
/* Marker popup content */
.marker-content {
    width: 400px; /* Desktop default */
}

/* Large tablet and smaller desktop screens */
@media screen and (max-width: 1200px) {
    .marker-content {
        width: 350px;
    }
}

/* Tablet */
@media screen and (max-width: 1024px) {
    .marker-content {
        width: 300px;
    }
}

/* Small tablet */
@media screen and (max-width: 768px) {
    .marker-content {
        width: 250px;
    }
}

/* Mobile */
@media screen and (max-width: 480px) {
    .marker-content {
        width: 220px;
    }
}

/* Very small mobile */
@media screen and (max-width: 360px) {
    .marker-content {
        width: 200px;
    }
}

.marker-image {
    height: 120px;
    overflow: hidden;
    margin-bottom: 10px;
    border-radius: 4px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.marker-info h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
    line-height: 1.3;
}

.marker-address {
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.marker-address strong {
    color: #333;
    font-size: 14px;
}

.marker-custom-fields {
    margin-bottom: 15px;
    font-size: 13px;
}

.marker-field {
    margin-bottom: 5px;
    color: #666;
    line-height: 1.4;
}

.marker-field strong {
    color: #333;
}

.marker-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: #007cba;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    margin: 5px 5px 0 0;
}

.marker-link:hover {
    background-color: #005a87;
    color: white;
    text-decoration: none;
}

/* Specific styling for details link */
.marker-link-details {
    background-color: #007cba;
}

.marker-link-details:hover {
    background-color: #005a87;
}

/* Specific styling for directions button - RED */
.marker-link-directions {
    background-color: red !important;
    color: white !important;
}

.marker-link-directions:hover {
    background-color: darkred !important;
}

/* Custom popup styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 15px;
}

.leaflet-popup-tip {
    background: white;
}

/* Leaflet marker cluster customization */
.marker-cluster-small {
    background-color: rgba(181, 226, 140, 0.6);
}
.marker-cluster-small div {
    background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster-medium {
    background-color: rgba(241, 211, 87, 0.6);
}
.marker-cluster-medium div {
    background-color: rgba(240, 194, 12, 0.6);
}

.marker-cluster-large {
    background-color: rgba(253, 156, 115, 0.6);
}
.marker-cluster-large div {
    background-color: rgba(241, 128, 23, 0.6);
}

/* Custom cluster styling */
.marker-cluster {
    background-clip: padding-box;
    border-radius: 20px;
}

.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 15px;
    font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
    color: white;
    font-weight: bold;
}

.marker-cluster span {
    line-height: 30px;
}

/* Cluster popup styling */
.cluster-popup {
    text-align: center;
    font-size: 14px;
    color: #333;
}

/* Spiderfied marker animation */
.spiderfied-marker {
    animation: markerBounce 0.5s ease-out;
}

@keyframes markerBounce {
    0% {
        transform: scale(0.8);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile responsive design */
@media screen and (max-width: 768px) {
    .mapa-pomocy-filters {
        padding: 15px;
    }
    
    .filter-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .filter-btn {
        width: 100%;
    }
 
    
    .marker-image {
        height: 100px;
    }
    
    .marker-info h4 {
        font-size: 14px;
    }
    
    .marker-address {
        font-size: 12px;
    }
    
    .marker-custom-fields {
        font-size: 12px;
    }
    
    .marker-link {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Mobile spacing for directions button */
    .marker-link-directions {
        margin-top: 15px;
        display: block;
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .mapa-pomocy-container {
        margin: 10px 0;
    }
    
    .mapa-pomocy-filters {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .mapa-pomocy-filters h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    #mapa-pomocy-map {
        border-radius: 4px;
    }
}
