/* ===== Működési terület – térkép ===== */
.mt-map-wrap {
    position: relative;
}

.mt-map {
    width: 100%;
    height: 620px;
    border-radius: 12px;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
}

/* --- Vezérlők --- */
.mt-map-controls {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mt-map-control-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: #fff;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .15s;
}

.mt-map-control-btn:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

/* --- Jelmagyarázat --- */
.mt-legend-toggle {
    position: absolute;
    bottom: 14px;
    left: 14px;
    z-index: 5;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: #fff;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .15s;
}

.mt-legend-toggle:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

.mt-legend-toggle.is-active {
    background: #2196f3;
    color: #fff;
}

.mt-legend {
    position: absolute;
    bottom: 14px;
    left: 14px;
    z-index: 10;
    background: rgba(255, 255, 255, .96);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .15);
    max-width: 320px;
    max-height: 70%;
    overflow-y: auto;
    font-size: 12.5px;
    line-height: 1.35;
}

.mt-legend-title {
    font-weight: 700;
    font-size: 13.5px;
    text-decoration: underline;
    margin-bottom: 6px;
}

.mt-legend-section {
    font-weight: 700;
    margin: 8px 0 4px;
}

.mt-legend-list {
    list-style: none;
    margin: 0 0 4px;
    padding: 0;
}

.mt-legend-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
}

.mt-legend-area {
    cursor: pointer;
    border-radius: 5px;
    padding: 2px 4px !important;
}

.mt-legend-area:hover {
    background: #eef2f7;
}

.mt-legend-swatch {
    flex: 0 0 auto;
    width: 18px;
    height: 14px;
    border: 1px solid #888;
    border-radius: 2px;
}

/* Marker formák (jelmagyarázat + térkép) */
.mt-legend-marker,
.mt-marker {
    --mt-c: #607d8b;
    flex: 0 0 auto;
    display: inline-block;
    width: 16px;
    height: 16px;
    background: var(--mt-c);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .45);
}

.mt-shape-circle { border-radius: 50%; }
.mt-shape-square { border-radius: 2px; }
.mt-shape-triangle {
    background: transparent;
    border: none;
    box-shadow: none;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 16px solid var(--mt-c);
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, .6));
}
.mt-shape-pentagon {
    border-radius: 2px;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.mt-marker-wrap { background: none; border: none; }
.mt-marker { width: 20px; height: 20px; }
.mt-marker.mt-shape-triangle { border-bottom-width: 20px; border-left-width: 11px; border-right-width: 11px; }

/* --- Modal --- */
.mt-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.mt-modal.is-open { display: flex; }

.mt-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
}

.mt-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 86vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    animation: mt-modal-in .18s ease-out;
}

@keyframes mt-modal-in {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.mt-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: none;
    background: none;
    font-size: 28px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
z-index:9;
}

.mt-modal-header {
    padding: 20px 22px 12px;
    border-bottom: 1px solid #eef2f7;
    position: relative;
}

.mt-modal-swatch {
    display: inline-block;
    width: 26px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid #888;
    vertical-align: middle;
    margin-right: 8px;
}

.mt-modal-title {
    display: inline;
    font-size: 19px;
    font-weight: 700;
}

.mt-modal-uzem {
    margin-top: 6px;
    color: #64748b;
    font-size: 13px;
}

.mt-modal-body { padding: 16px 22px 22px; }

.mt-modal-section { margin-bottom: 16px; }
.mt-modal-section h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #0f172a;
}

.mt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-chip {
    background: #eef2f7;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12.5px;
    color: #334155;
}

.mt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mt-table th, .mt-table td {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid #eef2f7;
}
.mt-table th { color: #64748b; font-weight: 600; }

.mt-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid rgba(0, 0, 0, .25);
}

.mt-popup .mt-popup-row { font-size: 12.5px; color: #475569; margin-top: 3px; }

@media (max-width: 575px) {
    .mt-map { height: 460px; }
    .mt-legend { max-width: 220px; font-size: 11.5px; }
}

/* ===== Teljes képernyő ===== */
.mt-terulet-app:fullscreen,
.mt-terulet-app:-webkit-full-screen,
.mt-terulet-app:-moz-full-screen,
.mt-terulet-app.mt-pseudo-fullscreen {
    background: #fff;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Ál-fullscreen tartalék (ha nincs Fullscreen API) */
.mt-terulet-app.mt-pseudo-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 99990;
    overflow: hidden;
}

.mt-terulet-app:fullscreen .mt-map-wrap,
.mt-terulet-app:-webkit-full-screen .mt-map-wrap,
.mt-terulet-app:-moz-full-screen .mt-map-wrap,
.mt-terulet-app.mt-pseudo-fullscreen .mt-map-wrap {
    flex: 1 1 auto;
    margin: 0;
    height: 100%;
}

.mt-terulet-app:fullscreen .mt-map,
.mt-terulet-app:-webkit-full-screen .mt-map,
.mt-terulet-app:-moz-full-screen .mt-map,
.mt-terulet-app.mt-pseudo-fullscreen .mt-map {
    height: 100% !important;
    border-radius: 0;
}
