/* ==========================================================================
   1. ХОЛСТ И ЛИНИИ МАРШРУТА
   ========================================================================== */
.map-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.floor-layer {
    display: none;
    width: 100%;
    height: 100%;
}

.floor-layer.active-floor {
    display: block;
}

.floor-layer svg {
    width: 100%;
    height: 100%;
}

/* Фоновый светящийся трек маршрута */
.route-line-bg {
    stroke: rgba(37, 99, 235, 0.22);
    stroke-width: 8px;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* Бегущий сегмент-змейка (Snake Animation) */
.route-line-snake {
    stroke: #2563eb;
    stroke-width: 8px;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    filter: drop-shadow(0 2px 10px rgba(37, 99, 235, 0.75));
}

@keyframes snakeRun {
    0% {
        stroke-dashoffset: 90;
    }
    100% {
        stroke-dashoffset: calc(-1 * var(--snake-len, 1000px));
    }
}

/* Пульсирующие маркеры Старта (📍) и Финиша (🏁) */
.start-pin-group, .finish-pin-group {
    pointer-events: none;
    user-select: none;
}

.pulse-ring {
    animation: pulseRing 1.8s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes pulseRing {
    0% { transform: scale(0.7); opacity: 0.9; }
    50% { transform: scale(1.6); opacity: 0.15; }
    100% { transform: scale(0.7); opacity: 0.9; }
}

/* ==========================================================================
   2. ПЛАВАЮЩИЕ ЭЛЕМЕНТЫ ИНТЕРФЕЙСА (ПОВЕРХ КАРТЫ)
   ========================================================================== */
.map-floating-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none; /* Пропускаем клики сквозь контейнер к самой карте */
}

/* Центральный заголовок шапки карты (Скриншот 5) */
.map-top-header {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 6;
    text-align: center;
}

.header-building {
    font-size: 26px;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.header-floor {
    font-size: 20px;
    font-weight: 600;
    color: #475569;
    margin: 4px 0 0 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Синие таблетки выбора корпусов и этажей */
.floating-selectors {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 12px;
    pointer-events: auto; /* Включаем клики обратно только для самих кнопок */
}

.building-switcher, .floor-switcher {
    display: flex;
    gap: 8px;
}

.building-btn, .floor-btn {
    padding: 10px 24px;
    border: none;
    background: #FFFFFF;
    color: #4B5563;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
}

.building-btn.active, .floor-btn.active {
    background: var(--primary-blue);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

/* Логотип */
.floating-logo {
    position: absolute;
    top: 16px;
    left: 16px;
    pointer-events: auto;
    z-index: 8;
}

.floating-logo img {
    width: 56px;
    height: auto;
}

@media (min-width: 768px) {
    .floating-logo {
        top: 20px;
        left: auto;
        right: 20px;
    }

    .floating-logo img {
        width: 70px;
    }
}

/* Кнопки управления (Зум) — на мобилке скрыты */
.floating-controls {
    display: none; /* Скрыто на мобильных */
}

/* На ПК показываем только + и - справа */
@media (min-width: 768px) {
    .floating-controls {
        position: absolute;
        right: 20px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        pointer-events: auto;
    }
}

/* Скрываем закладку и навигацию всегда (оставляем только + и -) */
#btn-bookmark, #btn-location {
    display: none;
}

/* Полупрозрачная подпись внизу по центру активного окна */
.watermark-signature {
    position: fixed;
    bottom: 12px;
    left: calc(380px + (100vw - 380px) / 2);
    transform: translateX(-50%);
    z-index: 5;
    font-style: italic;
    font-size: 11px;
    line-height: 1.35;
    color: #4A5568;
    opacity: 0.28;
    text-align: center;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    transition: opacity 0.3s ease, bottom 0.3s ease;
}

@media (max-width: 768px) {
    .watermark-signature {
        left: 50%;
        bottom: 38px;
        opacity: 0.32;
        font-size: 10.5px;
    }
}

.control-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #9CA3AF; /* Серый цвет как на макете */
    color: #FFFFFF;
    border-radius: 12px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: background 0.2s ease;
}

.control-btn:active { background: #6B7280; }
.control-btn img { width: 20px; height: 20px; }

/* Адаптация под ПК: сдвигаем элементы из-за левого сайдбара */
@media (min-width: 768px) {
    .floating-controls {
        bottom: 50%;
        transform: translateY(50%); /* Центрируем по вертикали на ПК */
    }
}

/* 1. Десктопные синие плашки-выпадашки (Слева вверху на ПК: "Корпус Г ▾", "1 этаж ▾") */
.floating-selectors-pc {
    display: none; /* По умолчанию скрыты на мобилках */
}

@media (min-width: 768px) {
    .floating-selectors-pc {
        display: flex;
        position: absolute;
        top: 20px;
        left: 380px; /* Отступ вправо от левой боковой панели */
        gap: 12px;
        z-index: 10;
        pointer-events: auto;
    }
}

.blue-pill-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--primary-blue);
    color: #FFFFFF;
    border: none;
    border-radius: 30px;
    padding: 10px 36px 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    outline: none;
    transition: transform 0.15s ease;
}

.blue-pill-select:active {
    transform: scale(0.96);
}

.blue-pill-select option {
    background-color: #FFFFFF;
    color: #1F2937;
    font-weight: 500;
}

/* 2. Мобильные круглые селекторы справа вверху */
.floating-selectors-mobile {
    position: fixed;
    right: 16px;
    top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 20;
    pointer-events: auto;
}

@media (min-width: 768px) {
    .floating-selectors-mobile {
        display: none; /* Скрываем на ПК полностью */
    }
}

.circular-selector {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.selector-trigger {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary-blue);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.selector-trigger:active {
    transform: scale(0.95);
    background: #2563EB;
}

/* На мобилках: выплывает влево горизонтально */
.selector-options {
    position: absolute;
    right: 56px;
    top: 0;
    display: flex;
    flex-direction: row;
    gap: 8px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 10px;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transform: translateX(20px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.selector-options.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

/* На ПК / Десктопе: выпадает СВЕРХУ ВНИЗ вертикально под триггером */
@media (min-width: 768px) {
    .selector-options {
        right: 0;
        top: 54px;
        left: auto;
        flex-direction: column;
        transform: translateY(-10px);
    }
    .selector-options.show {
        transform: translateY(0);
    }
}

.option-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.option-btn.active {
    background: var(--primary-blue);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5);
}