/* ═══════════════════════════════════════════════════════════════
   HARGITA – Interaktív Térkép (terkep.css)
   Sötét téma: emerald zöld (#2ecc71) + arany (#d4a843)
   ═══════════════════════════════════════════════════════════════ */

/* Reset a térkép oldalon */
body.hm-map-page {
    margin: 0;
    padding: 0;
    background: #0d1117;
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    overflow: hidden;
    height: 100dvh;
    width: 100%;
}

/* Fő konténer */
#hm-wrap {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 100%;
    position: relative;
}

/* ── Szűrősáv ──────────────────────────────────────────────── */
#hm-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: #161b22;
    border-bottom: 1px solid #21262d;
    z-index: 1000;
    flex-shrink: 0;
    min-height: 52px;
}

#hm-bar-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#hm-bar-inner::-webkit-scrollbar {
    display: none;
}

/* Szűrő gombok */
.hm-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid #30363d;
    border-radius: 20px;
    background: #21262d;
    color: #c9d1d9;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.1s;
    flex-shrink: 0;
}

.hm-btn:hover {
    background: #2d333b;
    border-color: #58a6ff;
    color: #e6edf3;
    transform: translateY(-1px);
}

.hm-btn.active {
    background: var(--cat-color, #2ecc71);
    border-color: var(--cat-color, #2ecc71);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 10px color-mix(in srgb, var(--cat-color, #2ecc71) 50%, transparent);
}

.hm-btn[data-cat="all"] {
    --cat-color: #2ecc71;
}

/* Főoldal visszagomb */
.hm-btn-home {
    text-decoration: none;
    --cat-color: #444c56;
    background: #21262d;
    border-color: #444c56;
    flex-shrink: 0;
}

.hm-btn-home:hover {
    background: #2d333b;
    border-color: #8b949e;
    color: #e6edf3;
    transform: translateY(-1px);
}

/* Elválasztó a visszagomb és a szűrők között */
.hm-bar-divider {
    width: 1px;
    height: 24px;
    background: #30363d;
    flex-shrink: 0;
    margin: 0 2px;
}

.hm-btn-icon {
    font-size: 15px;
    line-height: 1;
}

/* Darabszám badge a gombokon */
.hm-btn-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    transition: background 0.18s;
}

.hm-btn:not(.active) .hm-btn-count {
    background: rgba(255,255,255,0.10);
    color: #8b949e;
}

.hm-btn.active .hm-btn-count {
    background: rgba(0,0,0,0.22);
    color: #fff;
}

/* Találat számláló */
#hm-count-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    color: #8b949e;
    font-size: 13px;
}

#hm-count {
    font-size: 16px;
    font-weight: 700;
    color: #2ecc71;
    min-width: 24px;
    text-align: right;
}

/* ── Térkép ────────────────────────────────────────────────── */
#hm-map {
    flex: 1;
    width: 100%;
    min-height: 0;
    z-index: 1;
}

/* Leaflet zoom gombok */
.leaflet-control-zoom a {
    background: #21262d !important;
    color: #c9d1d9 !important;
    border-color: #30363d !important;
}

.leaflet-control-zoom a:hover {
    background: #2d333b !important;
    color: #2ecc71 !important;
}

/* ── Visszaállítás gomb ──────────────────────────────────────── */
.hm-reset-btn {
    display: block;
    width: 30px;
    height: 30px;
    background: #21262d !important;
    color: #c9d1d9 !important;
    border: 2px solid #30363d !important;
    border-radius: 4px !important;
    font-size: 18px;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    margin-top: 5px !important;
    transition: background .15s, color .15s;
}
.hm-reset-btn:hover {
    background: #2d333b !important;
    color: #2ecc71 !important;
}

/* ── Marker ────────────────────────────────────────────────── */
.hm-marker {
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.hm-marker:hover {
    box-shadow: 0 5px 16px rgba(0,0,0,0.7);
}

.hm-marker-icon {
    transform: rotate(45deg);
    font-size: 16px;
    line-height: 1;
    display: block;
}

/* ── Popup ─────────────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
    background: #161b22 !important;
    border: 1px solid #30363d !important;
    border-radius: 10px !important;
    color: #c9d1d9 !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6) !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup-tip {
    background: #161b22 !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    min-width: 220px;
    max-width: 300px;
}

.hm-popup {
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
}

.hm-popup-header {
    padding: 12px 14px 10px;
    border-left: 4px solid #2ecc71;
    background: #0d1117;
}

.hm-popup-name {
    font-size: 15px;
    font-weight: 700;
    color: #e6edf3;
    margin: 0 0 4px;
    line-height: 1.3;
}

.hm-popup-cat {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #2ecc71;
}

.hm-popup-body {
    padding: 10px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hm-popup-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: #8b949e;
    font-size: 13px;
}

.hm-popup-row .hm-icon {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    margin-top: 1px;
}

.hm-popup-row a {
    color: #58a6ff;
    text-decoration: none;
    word-break: break-all;
}

.hm-popup-row a:hover {
    color: #2ecc71;
    text-decoration: underline;
}

.hm-popup-desc {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #21262d;
    color: #8b949e;
    font-size: 12.5px;
    line-height: 1.5;
}

.hm-popup-stars {
    color: #d4a843;
    font-size: 13px;
}

.hm-popup-rating-num {
    color: #8b949e;
    font-size: 11px;
    margin-left: 3px;
}

.hm-popup-website {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    padding: 5px 12px;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #58a6ff !important;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.15s, border-color 0.15s;
}

.hm-popup-website:hover {
    background: #2d333b !important;
    border-color: #58a6ff !important;
}

/* ── Betöltés overlay ──────────────────────────────────────── */
#hm-loading {
    position: absolute;
    inset: 0;
    background: rgba(13, 17, 23, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 2000;
    color: #c9d1d9;
    font-size: 15px;
    backdrop-filter: blur(4px);
}

.hm-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid #21262d;
    border-top-color: #2ecc71;
    border-radius: 50%;
    animation: hm-spin 0.8s linear infinite;
}

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

/* ── Hibaüzenet ────────────────────────────────────────────── */
#hm-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #161b22;
    border: 1px solid #f85149;
    border-radius: 10px;
    padding: 24px 28px;
    text-align: center;
    z-index: 2000;
    max-width: 320px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

#hm-error-msg {
    color: #c9d1d9;
    font-size: 14px;
    margin: 0 0 14px;
}

#hm-retry {
    padding: 8px 20px;
    background: #2ecc71;
    color: #0d1117;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

#hm-retry:hover {
    background: #27ae60;
}

/* ── Reszponzív ────────────────────────────────────────────── */
@media (max-width: 600px) {
    #hm-bar {
        padding: 6px 8px;
        min-height: 46px;
    }

    .hm-btn {
        padding: 5px 9px;
        font-size: 12px;
    }

    .hm-btn-label {
        display: none;
    }

    .hm-btn-icon {
        font-size: 17px;
    }

    #hm-count-wrap {
        font-size: 12px;
    }

    #hm-count {
        font-size: 15px;
    }

    .leaflet-popup-content {
        min-width: 180px;
        max-width: 250px;
    }
}

@media (max-width: 360px) {
    .hm-btn {
        padding: 4px 7px;
    }
}
