/**
 * Placemania Map Styles
 */

/* Základné štýly mapy */
#placemania-simple-map {
    background: #f8f9fa;
    position: relative;
}

/* Loading indikátor */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: #333;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Supercluster markery */
.supercluster-marker {
    background: transparent !important;
    border: none !important;
}

.cluster-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.8);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cluster-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.cluster-icon {
    font-size: 16px !important;
    color: white;
    line-height: 1;
    margin-bottom: 1px;
}

.cluster-count {
    font-size: 10px;
    font-weight: bold;
    color: white;
    line-height: 1;
}

/* Cluster typy */
.marker-cluster-zapisky {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    border-color: rgba(76, 175, 80, 0.8);
}

.marker-cluster-svetova-zaujimavost {
    background: linear-gradient(135deg, #2196F3, #1565C0);
    border-color: rgba(33, 150, 243, 0.8);
}

.marker-cluster-mixed {
    background: linear-gradient(135deg, #9C27B0, #6A1B9A);
    border-color: rgba(156, 39, 176, 0.8);
}

.marker-cluster-default {
    background: linear-gradient(135deg, #607D8B, #37474F);
    border-color: rgba(96, 125, 139, 0.8);
}

/* Jednotlivé markery */
.custom-marker {
    width: 42px;
    height: 42px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.custom-marker:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.custom-marker.zapisky {
    background: rgba(76, 175, 80, 0.9);
    border-color: rgba(76, 175, 80, 0.8);
}

.custom-marker.svetova-zaujimavost {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(33, 150, 243, 0.6);
}

.marker-icon {
    font-size: 28px;
    color: #333;
    font-weight: 500;
}

.zapisky-icon {
    color: #1B5E20 !important;
}

.zaujimavost-icon {
    color: #1565C0 !important;
}

/* Leaflet overrides */
.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

/* Popup štýly */
.leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.4;
}

.leaflet-popup-content-wrapper, 
.leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-close-button {
    top: 8px !important;
    right: 8px !important;
    font-size: 18px !important;
    color: #666 !important;
    font-weight: bold;
}

.leaflet-popup-close-button:hover {
    color: #333 !important;
}

.popup-content {
    width: 280px;
    text-decoration: none;
    color: inherit;
    display: block;
    overflow: hidden;
    border-radius: 8px;
}

.popup-content:hover {
    text-decoration: none;
}

.popup-content img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    border-radius: 8px 8px 0 0;
}

.popup-body {
    padding: 16px;
    background: white;
    border-radius: 0 0 8px 8px;
}

.popup-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a1a;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popup-category {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.popup-excerpt {
    font-size: 14px;
    color: #444;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popup-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.popup-type-badge.zapisky {
    background: rgba(76, 175, 80, 0.9);
    color: white;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.popup-type-badge.svetova-zaujimavost {
    background: rgba(33, 150, 243, 0.9);
    color: white;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    .popup-content {
        width: 240px;
    }
    
    .popup-content img {
        height: 120px;
    }
    
    .popup-body {
        padding: 12px;
    }
    
    .popup-title {
        font-size: 15px;
    }
    
    .popup-excerpt {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    
    .custom-marker {
        width: 36px;
        height: 36px;
    }
    
    .marker-icon {
        font-size: 24px;
    }
    
    .cluster-marker {
        width: 36px;
        height: 36px;
    }
    
    .cluster-icon {
        font-size: 14px !important;
    }
    
    .cluster-count {
        font-size: 9px;
    }
    
    .map-loading {
        padding: 15px 20px;
        font-size: 13px;
    }
    
    .loading-spinner {
        width: 16px;
        height: 16px;
    }
}

/* High-DPI displeje */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .custom-marker,
    .cluster-marker {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .custom-marker:hover,
    .cluster-marker:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .custom-marker,
    .cluster-marker,
    .loading-spinner {
        transition: none;
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #placemania-simple-map {
        background: #1a1a1a;
    }
    
    .map-loading {
        background: rgba(30, 30, 30, 0.95);
        color: #e0e0e0;
    }
    
    .popup-body {
        background: #2a2a2a;
    }
    
    .popup-title {
        color: #e0e0e0;
    }
    
    .popup-category {
        color: #b0b0b0;
    }
    
    .popup-excerpt {
        color: #c0c0c0;
    }
    
    .leaflet-popup-content-wrapper,
    .leaflet-popup-tip {
        background: rgba(30, 30, 30, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Leaflet pane z-index fix */
.leaflet-pane {
    z-index: 15 !important;
}

.leaflet-control-zoom-out {
    background-color: white !important;
    color: #333 !important;
}

.leaflet-control-zoom-out:hover {
    background-color: #f4f4f4 !important;
}

.leaflet-disabled {
    background-color: #ccc !important;
    color: #999 !important;
    cursor: not-allowed !important;
}