/* GEONEX 좌우 비교 — 내장 비교 막대(Leaflet.SideBySide)의 모양을 다듬고 빠른 시작 단추·이름표를 그린다.
   색은 --gx-* 변수로 받는다. 테마가 값을 주지 않으면 밝은 화면 기본값을 쓴다. */

/* ---------- 비교 막대와 손잡이 ---------- */

.leaflet-container .leaflet-sbs-divider {
    width: 2px;
    margin-left: -1px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18), 0 0 12px rgba(15, 23, 42, 0.45);
}

.leaflet-container .leaflet-sbs-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #fff;
    background-color: var(--gx-point1, #0d9488);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a1621' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l-6 6 6 6M15 6l6 6-6 6'/%3E%3C/svg%3E");
    background-position: 50% 50%;
    background-repeat: no-repeat;
    background-size: 20px 20px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.45);
    cursor: ew-resize;
    transition: transform 0.12s ease;
}

.leaflet-container .leaflet-sbs-range::-moz-range-thumb {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #fff;
    background-color: var(--gx-point1, #0d9488);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a1621' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l-6 6 6 6M15 6l6 6-6 6'/%3E%3C/svg%3E");
    background-position: 50% 50%;
    background-repeat: no-repeat;
    background-size: 20px 20px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.45);
    cursor: ew-resize;
}

.leaflet-container .leaflet-sbs-range:hover::-webkit-slider-thumb,
.leaflet-container .leaflet-sbs-range:active::-webkit-slider-thumb {
    transform: scale(1.08);
}

/* ---------- 좌우 이름표 ---------- */

.gx-cmp-tags {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    z-index: 1000;
    pointer-events: none;
}

.gx-cmp-tag {
    position: absolute;
    top: 14px;
    max-width: 38%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 6px;
    border-radius: 999px;
    background: rgba(10, 22, 33, 0.82);
    color: #e2e8f0;
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(2, 6, 24, 0.35);
}

.gx-cmp-side {
    flex: none;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--gx-point1, #2ec0b6);
    color: #0a1621;
    font-size: 12px;
    font-weight: 700;
}

.gx-cmp-tag-right .gx-cmp-side {
    background: var(--gx-point2, #38bdf8);
}

.gx-cmp-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- 빠른 시작 단추 ---------- */

.leaflet-control.gx-cmp {
    position: relative;
}

.leaflet-bar a.gx-cmp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

/* 아이콘은 글자색을 따른다 — 테마가 지도 단추 글자색을 정하면 그대로 맞춰진다. */
.leaflet-bar a.gx-cmp-btn::before {
    content: "";
    width: 18px;
    height: 18px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M12 3v18'/%3E%3Cpath d='M7 12h2M15 12h2'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M12 3v18'/%3E%3Cpath d='M7 12h2M15 12h2'/%3E%3C/svg%3E") center / contain no-repeat;
}

.leaflet-bar a.gx-cmp-btn.gx-cmp-on,
.leaflet-bar a.gx-cmp-btn.gx-cmp-on:hover {
    background-color: var(--gx-point1, #0d9488) !important;
    border-color: var(--gx-point1, #0d9488) !important;
    color: #0a1621 !important;
}

/* ---------- 선택 창 ---------- */

.gx-cmp-panel {
    display: none;
    position: absolute;
    top: 0;
    right: 38px;
    width: 300px;
    padding: 12px 14px 14px;
    border: 1px solid var(--gx-line, #e2e8f0);
    border-radius: 10px;
    background: var(--gx-surface, #fff);
    color: var(--gx-text, #0f172a);
    box-shadow: 0 8px 28px rgba(2, 6, 24, 0.35);
    font-size: 13px;
    cursor: default;
}

.gx-cmp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.gx-cmp-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--gx-title, var(--gx-text, #0f172a));
}

.gx-cmp-close {
    border: 0;
    background: none;
    color: var(--gx-muted, #64748b);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.gx-cmp-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    font-weight: normal;
}

.gx-cmp-row-label {
    flex: none;
    width: 40px;
    color: var(--gx-muted, #475569);
    font-weight: 600;
}

.gx-cmp-panel .gx-cmp-select {
    flex: 1;
    min-width: 0;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--gx-line, #cbd5e1);
    border-radius: 6px;
    background: var(--gx-field, #fff);
    color: var(--gx-text, #0f172a);
    font-size: 13px;
}

.gx-cmp-panel .gx-cmp-select:focus {
    outline: 2px solid var(--gx-focus, rgba(13, 148, 136, 0.35));
    border-color: var(--gx-point2, #0d9488);
}

.gx-cmp-note {
    margin: 0;
    color: var(--gx-muted, #475569);
    line-height: 1.5;
}

.gx-cmp-warn {
    margin: 0 0 6px;
    color: var(--gx-danger, #b91c1c);
    font-size: 12px;
}

.gx-cmp-warn:empty {
    display: none;
}

.gx-cmp-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
}

.gx-cmp-actions button {
    height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.gx-cmp-ghost {
    border: 1px solid var(--gx-line, #cbd5e1);
    background: transparent;
    color: var(--gx-text, #334155);
}

.gx-cmp-ghost:hover {
    background: var(--gx-hover, #f1f5f9);
}

.gx-cmp-primary {
    border: 1px solid var(--gx-primary, #0d9488);
    background: var(--gx-primary, #0d9488);
    color: var(--gx-primary-ink, #fff);
    font-weight: 600;
}

.gx-cmp-primary:hover {
    filter: brightness(1.08);
}
