/**
 * Travelhacker Mapa – frontend štýly
 * Verzia: 1.5.52
 * Všetky selektory sú špecifické aby prebili globálne CSS šablóny.
 */

/* ── Kontajner mapy ──────────────────────────────────────── */
.thm-mapa-container {
    width: 100%;
    min-height: 300px;
    position: relative;
    z-index: 0;
}

.thm-mapa-container .leaflet-control-attribution {
    font-size: 10px !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border-radius: 5px 5px 0 0 !important;
}

/* ── Leaflet z-indexy ────────────────────────────────────── */
.thm-mapa-container .leaflet-map-pane          { z-index: 1; }
.thm-mapa-container .leaflet-tile-pane         { z-index: 1; }
.thm-mapa-container .leaflet-overlay-pane      { z-index: 2; }
.thm-mapa-container .leaflet-shadow-pane       { z-index: 3; }
.thm-mapa-container .leaflet-marker-pane       { z-index: 4; }
.thm-mapa-container .leaflet-tooltip-pane      { z-index: 5; }
.thm-mapa-container .leaflet-popup-pane        { z-index: 6; }
.thm-mapa-container .leaflet-control-container { z-index: 7; }

/* ── SVG marker ──────────────────────────────────────────── */
.thm-mapa-container .thm-marker {
    background: none !important;
    border: none !important;
}

.thm-mapa-container .thm-cluster {
    background: none !important;
    border: none !important;
}

/* ── Popup ───────────────────────────────────────────────── */
.thm-leaflet-popup .leaflet-popup-content-wrapper {
    border-radius: 8px !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18) !important;
}

.thm-leaflet-popup .leaflet-popup-content {
    margin: 0 !important;
    width: 260px !important;
}

.thm-leaflet-popup .leaflet-popup-tip-container {
    margin-top: -1px !important;
}

.thm-mapa-container .thm-popup {
    font-family: inherit;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.thm-mapa-container .thm-popup__stripe {
    height: 5px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.thm-mapa-container .thm-popup__image {
    width: 100% !important;
    height: 150px !important;
    overflow: hidden !important;
    background: #f0f0f0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.thm-mapa-container .thm-popup__image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.thm-mapa-container .thm-popup__body {
    padding: 12px 14px 14px !important;
}

.thm-mapa-container .thm-popup__badge {
    display: inline-block !important;
    padding: 2px 8px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #fff !important;
    margin-bottom: 6px !important;
    letter-spacing: 0.3px !important;
    line-height: 1.4 !important;
}

.thm-mapa-container .thm-popup__title {
    margin: 0 0 6px !important;
    padding: 0 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #1a1a1a !important;
}

.thm-mapa-container .thm-popup__description {
    margin: 0 0 10px !important;
    padding: 0 !important;
    font-size: 13px !important;
    color: #444 !important;
    max-height: 80px !important;
    overflow-y: auto !important;
    line-height: 1.5 !important;
}

.thm-mapa-container .thm-popup__description p {
    margin: 0 0 6px !important;
}

.thm-mapa-container .thm-popup__description p:last-child {
    margin-bottom: 0 !important;
}

.thm-mapa-container .thm-popup__link {
    display: inline-block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border-bottom: 1px solid transparent !important;
    transition: border-color 0.15s ease !important;
    margin: 0 !important;
    padding: 0 !important;
}

.thm-mapa-container .thm-popup__link:hover {
    border-bottom-color: currentColor !important;
}

/* ── Zoom tlačidlá ───────────────────────────────────────── */
.thm-mapa-container .leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    border-radius: 6px !important;
}

.thm-mapa-container .leaflet-control-zoom-in,
.thm-mapa-container .leaflet-control-zoom-out {
    border: none !important;
    border-bottom: 1px solid #f0f0f0 !important;
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
    font-size: 16px !important;
    border-radius: 0 !important;
    display: block !important;
    text-align: center !important;
    color: #333 !important;
    background: #fff !important;
    text-decoration: none !important;
}

.thm-mapa-container .leaflet-control-zoom-in {
    border-radius: 6px 6px 0 0 !important;
}

.thm-mapa-container .leaflet-control-zoom-out {
    border-bottom: none !important;
    border-radius: 0 0 6px 6px !important;
}

/* ── Layer control ───────────────────────────────────────── */
.thm-mapa-container .leaflet-control-layers {
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    border: none !important;
    margin-left: 10px !important;
    font-size: 13px !important;
    font-family: inherit !important;
}

.thm-mapa-container .leaflet-control-layers-toggle {
    width: 30px !important;
    height: 30px !important;
    background-size: 18px 18px !important;
    border-radius: 6px !important;
}

.thm-mapa-container .leaflet-control-layers-expanded {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Toggle ikona zostane viditeľná aj keď je panel otvorený */
.thm-mapa-container .leaflet-control-layers-expanded .leaflet-control-layers-toggle {
    display: block !important;
    width: 30px !important;
    height: 30px !important;
    background-size: 18px 18px !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

/* Zoznam štýlov sa zobrazí napravo od toggle ikony */
.thm-mapa-container .leaflet-control-layers-list {
    position: absolute !important;
    left: calc(100% + 10px) !important;
    top: 0 !important;
    background: #fff !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    min-width: 140px !important;
    white-space: nowrap !important;
    z-index: 9999 !important;
}

.thm-mapa-container .leaflet-control-layers label {
    margin: 0 0 4px !important;
    padding: 0 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
}

/* ── Ovládacie prvky – stred ľavého okraja ───────────────── */
.thm-mapa-container .leaflet-top.leaflet-left {
    top: 50% !important;
    left: 0 !important;
    right: auto !important;
    transform: translateY(-50%) !important;
}

/* ── Geolokácia ──────────────────────────────────────────── */
.thm-mapa-container .thm-locate-btn {
    display: block !important;
    width: 30px !important;
    height: 30px !important;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23555'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3' stroke='%23555' stroke-width='2'/%3E%3Ccircle cx='12' cy='12' r='7' fill='none' stroke='%23555' stroke-width='2'/%3E%3C/svg%3E") center/18px no-repeat !important;
    border: none !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    cursor: pointer !important;
    margin-left: 10px !important;
    padding: 0 !important;
    font-size: 0 !important;
    transition: background-color 0.15s ease;
}

.thm-mapa-container .thm-locate-btn:hover {
    background-color: #f0f7ff !important;
}

.thm-mapa-container .thm-locate-btn.active {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232980b9'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3' stroke='%232980b9' stroke-width='2'/%3E%3Ccircle cx='12' cy='12' r='7' fill='none' stroke='%232980b9' stroke-width='2'/%3E%3C/svg%3E") !important;
}

.thm-mapa-container .thm-locate-btn.loading {
    opacity: 0.6 !important;
    cursor: wait !important;
    animation: thm-spin 1s linear infinite;
}

@keyframes thm-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Fullscreen ──────────────────────────────────────────── */
.thm-mapa-container .thm-fullscreen-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    background: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    cursor: pointer !important;
    color: #555 !important;
    margin-left: 10px !important;
    padding: 0 !important;
    transition: color 0.15s ease;
}

.thm-mapa-container .thm-fullscreen-btn:hover {
    color: #2980b9 !important;
}

.thm-mapa-container:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
}

.thm-mapa-container:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
}

/* ── Filter kategórií ────────────────────────────────────── */
.thm-mapa-container .thm-filter {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    justify-content: center !important;
    position: absolute !important;
    bottom: 20px !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    padding: 0 10px !important;
    margin: 0 !important;
    list-style: none !important;
}

.thm-mapa-container .thm-filter__btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 14px !important;
    border: 1px solid #ddd !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.8) !important;
    color: #000 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    line-height: 1 !important;
    margin: 0 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
    font-family: inherit !important;
}

.thm-mapa-container .thm-filter__btn svg {
    flex-shrink: 0 !important;
    opacity: 1 !important;
    fill: #000 !important;
}

.thm-mapa-container .thm-filter__btn:hover {
    border-color: var(--kat-color, #888) !important;
    color: var(--kat-color, #333) !important;
}

.thm-mapa-container .thm-filter__btn.active {
    background: var(--kat-color, #555) !important;
    border-color: var(--kat-color, #555) !important;
    color: #fff !important;
}

.thm-mapa-container .thm-filter__btn.active svg {
    fill: #fff !important;
}

.thm-mapa-container .thm-filter__btn--all {
    --kat-color: #555;
}

.thm-mapa-container .thm-filter__btn--all.active {
    background: #555 !important;
    border-color: #555 !important;
    color: #fff !important;
}

/* Mobil */
@media (max-width: 767px) {
    .thm-mapa-container .thm-filter {
        justify-content: flex-start !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding: 0 10px !important;
    }

    .thm-mapa-container .thm-filter::-webkit-scrollbar {
        display: none !important;
    }

    .thm-mapa-container .thm-filter__btn {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
}

/* ── Vyhľadávanie ────────────────────────────────────────── */
.thm-mapa-container .thm-search {
    position: absolute !important;
    bottom: 54px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 20px) !important;
    max-width: 600px !important;
    z-index: 1000 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.thm-mapa-container .thm-search__inner {
    display: flex !important;
    gap: 10px !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
}

.thm-mapa-container .thm-search__input {
    flex: 1 !important;
    padding: 10px 14px !important;
    border: 1px solid #ddd !important;
    border-radius: 10px !important;
    outline: none !important;
    font-size: 14px !important;
    font-family: inherit !important;
    background: rgba(255, 255, 255, 0.8) !important;
    color: #333 !important;
    transition: border-color 0.15s ease !important;
    box-shadow: none !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    line-height: normal !important;
}

.thm-mapa-container .thm-search__input:focus {
    border-color: #2980b9 !important;
    box-shadow: none !important;
}

.thm-mapa-container .thm-search__input::placeholder {
    color: #555 !important;
}

.thm-mapa-container .thm-search__btn {
    padding: 0 14px !important;
    border: none !important;
    border-radius: 10px !important;
    background: #039993 !important;
    color: #fff !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.15s ease !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    height: auto !important;
    font-size: 14px !important;
}

.thm-mapa-container .thm-search__btn:hover {
    background: #027a75 !important;
}

.thm-mapa-container .thm-search__btn:disabled {
    opacity: 0.6 !important;
    cursor: wait !important;
}

.thm-mapa-container .thm-search__results {
    display: none;
    position: absolute !important;
    bottom: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-bottom: none !important;
    border-radius: 6px !important;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1) !important;
    z-index: 99999 !important;
    max-height: 220px !important;
    overflow-y: auto !important;
    margin-bottom: 4px !important;
    padding: 0 !important;
}

.thm-mapa-container .thm-search__item {
    padding: 10px 14px !important;
    font-size: 13px !important;
    color: #333 !important;
    cursor: pointer !important;
    border-bottom: 1px solid #f0f0f0 !important;
    transition: background 0.1s ease !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    display: block !important;
}

.thm-mapa-container .thm-search__item:last-child {
    border-bottom: none !important;
}

.thm-mapa-container .thm-search__item:hover {
    background: #f5f9ff !important;
    color: #2980b9 !important;
}

.thm-mapa-container .thm-search__loading,
.thm-mapa-container .thm-search__noresult {
    padding: 12px 14px !important;
    font-size: 13px !important;
    color: #888 !important;
    font-style: italic !important;
    display: block !important;
}

/* ── Zoom shortcode tlačidlo ─────────────────────────────── */
.thm-zoom-btn {
    display: inline-block !important;
    padding: 8px 16px !important;
    background: #2980b9 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
}

.thm-zoom-btn:hover {
    background: #1f6391 !important;
}

/* ── Atribúcia – pod filtrom, vycentrovaná ───────────────── */
.thm-mapa-container .leaflet-bottom.leaflet-right {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    justify-content: center !important;
}

.thm-mapa-container .leaflet-control-attribution {
    float: none !important;
}

/* ── Layer control – klik správanie ─────────────────────── */

/* Zakázať Leaflet hover expand – skryjeme list pri hover, len náš .thm-layers-open ho zobrazí */
.thm-mapa-container .leaflet-control-layers .leaflet-control-layers-list {
    display: none !important;
}

/* Otvoriť len cez našu triedu */
.thm-mapa-container .leaflet-control-layers.thm-layers-open .leaflet-control-layers-list {
    display: block !important;
}

/* Zakázať Leaflet expanded štýl pri hover */
.thm-mapa-container .leaflet-control-layers-expanded {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Toggle ikona – aktívny stav zelená */
.thm-mapa-container .leaflet-control-layers-toggle.thm-layers-active {
    background-color: #039993 !important;
}

/* ── Hover stav všetkých control tlačidiel ───────────────── */
.thm-mapa-container .leaflet-control-zoom-in:hover,
.thm-mapa-container .leaflet-control-zoom-out:hover {
    background-color: #039993 !important;
    color: #fff !important;
}

.thm-mapa-container .leaflet-control-layers-toggle:hover {
    background-color: #039993 !important;
}

.thm-mapa-container .thm-locate-btn:hover {
    background-color: #039993 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3' stroke='%23fff' stroke-width='2'/%3E%3Ccircle cx='12' cy='12' r='7' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") !important;
}

.thm-mapa-container .thm-fullscreen-btn:hover {
    background-color: #039993 !important;
    color: #fff !important;
}
