/*
	Name: WSE Geoteg Map Plugin
	Version: 2.1
*/

.wse-geotag {
margin: 36px 0;
    gap: 16px;
    display: flex;
    flex-direction: column;
}

.geotag-map {
    height: 450px;
    width: 100%;
    border-radius: 6px;
}

.hide-navigator .geotag-meta-mention {
    display: none;
}

/* Navigator */
.geotag-navigator {
    text-align: left;
    font-family: inherit;
    color: black;
    font-size: 28px;
    justify-content: space-between;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.geotag-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Buttons */
.geotag-nav-buttons {
    display: flex;
    gap: 12px;
}

.geotag-rounded-button {
    display: inline-flex;
    align-items: center;
    background: #f2f2f2;
    padding: 6px 12px;
    border-radius: 100px;
    border: none;
    gap: 6px;
    font-size: 14px;
    font-family: inherit;
    color: #000;
    text-decoration: none;
    box-sizing: border-box;
    cursor: pointer;
}

.geotag-rounded-button:hover {
    background: #e4e4e4;
}

.geotag-rounded-button.inactive {
    opacity: 0.4;
    pointer-events: none;
}

.geotag-rounded-button svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.geotag-circle-button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-sizing: border-box;
}

.geotag-circle-button svg {
    fill: #fff;
}

.geotag-circle-button:hover {
    background: #333;
}

/* View all button */
.geotag-viewall-button button {
    display: flex;
    align-items: center;
    background: #f2f2f2;
    border: none;
    border-radius: 100px;
    padding: 14px;
    font-size: 14px;
    gap: 12px;
    cursor: pointer;
    box-sizing: border-box;
}

.geotag-viewall-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Headlines */
.geotag-headlines-outer-wrapper {
    width: 100%;
    overflow-x: scroll;
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab; /* Для визуального эффекта */
}

.geotag-headlines-outer-wrapper::-webkit-scrollbar {
    display: none;
}
.geotag-headlines-outer-wrapper.dragging {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    cursor: grabbing;
}

.geotag-headlines-wrapper {
    overflow-x: auto;
    scrollbar-width: auto;
    -ms-overflow-style: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.geotag-headlines {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5em;
    padding: 16px 0;
    font-size: 24px;
    white-space: nowrap;
    width: max-content;
    letter-spacing: -1.2px;
}
.geotag-headlines .headline-item.hovered {
    color: #006c75;
    opacity: 1 !important;
    transition: color 0.35s cubic-bezier(.55,.1,.62,1.25), opacity 0.4s;
}
.geotag-headlines::-webkit-scrollbar {
    height: 2px;
}

.geotag-headlines::-webkit-scrollbar-track {
    background: transparent;
}

.geotag-headlines::-webkit-scrollbar-thumb {
    background-color: #aaa;
    border-radius: 2px;
}

.geotag-headlines .headline-item {
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.3s;
    opacity: 0.2;
    max-width: clamp(100px, 600px, 84vw);
    transition: 0.4s ease-in;
            font-weight: 500;
}
.geotag-headlines .headline-item:hover {
    opacity: .9;
}
.headline-item {
    white-space: normal !important;
    line-height: 1.2;
    word-break: break-word;
}

.geotag-headlines .headline-item.active {
    opacity: 1;
}


/* Scrollbar thumb */
.geotag-headlines-scrollbar {
    height: 1.5px;
    background-color: #0000000f;
    position: relative;
    left: 0;
    bottom: 0;
    width: 100%;
    /* overflow: hidden; */
    z-index: 2;
}

.geotag-headlines-scrollbar-thumb {
    height: 100%;
    background-color: #aaa;
    width: 0%;
    transition: width 0.2s ease, transform 0.2s ease;
    transform: translateX(0%);
}

.geotag-headlines-scrollbar-thumb.idle {
  background-color: #aaa;
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.geotag-headlines-scrollbar-thumb.scrolling {
    background-color: #00b2c1;
    transition: background-color 0.4s ease;
    box-shadow: 0px 0px 4px #00eeff82;
}

/* Headers */
.wse-geotag h3 {
    font-family: Inter, sans-serif;
    box-sizing: border-box;
}

.geotag-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
}

.geotag-header h4 {
    margin-bottom: 0;
}

/* Current name */
#geotag-current-name {
    transition: all 0.3s;
}

#geotag-current-name::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background-color: black;
    animation: blink 1s infinite alternate;
    vertical-align: middle;
}

/* Meta info */
.geotag-meta {
    display: flex;
    gap: 24px;
    flex-direction: row;
    font-size: 14px;
    align-items: center;
    width: fit-content;
    min-height: 32px;
}

.geotag-meta a,
.geotag-meta,
.geotag-disclaimer {
    display: flex;
    font-size: 14px;
    align-items: center;
    width: fit-content;
    min-height: 32px;
}

.geotag-meta svg {
    margin-right: 4px;
}

.geotag-meta a:hover span {
    color: #006c75;
}

.geotag-disclaimer {
color: #bababa;
    line-height: 1.2;
    padding: 16px 0;
    letter-spacing: -0.04rem;
}

/* Labels */
.geotag-label {
    position: relative;
    background-color: #ffffffc1;
    backdrop-filter: blur(4px);
    border-radius: 2px;
    font-size: 12px;
    width: 180px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    z-index: 1;
    color: #000;
    display: block;
    overflow: visible;
    border: 1px solid white;
    padding: 6px 8px;
    cursor: pointer;
}

.geotag-label.geotag-label-active {
    border: 1px solid #00000066;
    z-index: 1000;
}

.zoom-small .geotag-label {
    font-size: 9px;
    padding: 3px 4px;
    display: none;
}

.zoom-medium .geotag-label {
    font-size: 13px;
}

.zoom-large .geotag-label {
    font-size: 18px;
}

/* Animated label */
.geotag-label-animated {
    animation: labelFadeIn 0.3s ease-out forwards;
}

/* Lists inside labels */
.geotag-label ul {
    padding-left: 14px;
    margin: 0;
}

.geotag-label li {
    list-style-type: disc;
    text-align: left;
    font-size: 11px;
    margin: 2px 0;
}

/* Cluster marker */
.cluster-marker {
    background: black;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    text-align: center;
    line-height: 40px;
    width: 40px;
    height: 40px;
    font-size: 14px;
    border: 2px solid white;
}

/* Cluster label container */
.cluster-label {
    max-width: 140px;
    background: white;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    white-space: normal;
    word-break: break-word;
    text-align: center;
    pointer-events: auto;
    margin-bottom: 8px;
}

/* Animations */
@keyframes labelFadeIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes blink {
    from {
        opacity: 1;
    }
    to {
        opacity: 0.2;
    }
}

/* Mapbox controls hidden */
.mapboxgl-ctrl-bottom-right, 
.mapboxgl-ctrl-bottom-left {
    display: none;
}

/* HTML label arrow */
.html-label::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    margin-left: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid white;
}

/* Responsive */
@media (max-width: 768px) {
    .geotag-map {
        height: 300px;
    }
    .geotag-navigator {
        display: flex;
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    .geotag-buttons {
        order: -1;
    }
    .geotag-label {
        max-width: 120px;
    }
    .zoom-large .geotag-label {
        display: none;
    }
    .geotag-headlines {
        gap: 1em;
    }
}
