/* ==========================================================================
   БОКОВАЯ ПАНЕЛЬ И 4 СОСТОЯНИЯ UX (Скриншоты 2, 3, 4, 5)
   ========================================================================== */
.ui-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: var(--panel-bg);
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    padding: 0 20px 24px 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

.ui-panel.is-collapsed {
    padding-bottom: 0 !important;
    overflow: hidden !important;
}

.ui-panel.is-collapsed .panel-mode {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.ui-panel:not(.is-collapsed) .panel-mode {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease;
}

.drag-indicator-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    padding: 12px 0 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background-color: var(--panel-bg);
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    flex-shrink: 0;
}

.drag-indicator {
    width: 44px;
    height: 5px;
    background-color: #FFFFFF;
    border-radius: 3px;
    opacity: 1;
    transition: opacity 0.2s;
}

.drag-indicator-bar:hover .drag-indicator,
.drag-indicator-bar:active .drag-indicator {
    opacity: 1;
}

/* Кнопка возврата Назад в главное меню */
.back-link-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 18px;
    align-self: flex-start;
    padding: 4px 0;
    transition: color 0.15s;
}

.back-link-btn:hover { color: #FFFFFF; }

/* Подписи полей */
.input-field-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px;
    display: block;
}

/* Поиск по аудиториям */
.search-container {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 14px 44px 14px 20px;
    border: none;
    border-radius: 30px;
    background-color: #FFFFFF;
    color: #1F2937;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.search-input::placeholder { color: #9CA3AF; }

.search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    pointer-events: none;
    opacity: 0.6;
}

/* Выпадающее меню автокомплита (Скриншот 2) */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background-color: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 50;
    overflow: hidden;
    padding: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 12px;
    color: #1e293b;
    font-size: 14px;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
}

.dropdown-item .item-icon {
    font-size: 16px;
    opacity: 0.7;
}

.dropdown-item .item-title {
    flex: 1;
}

.dropdown-item .item-arrow {
    font-size: 16px;
    color: #94a3b8;
}

.dropdown-item.location-item {
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
    color: #2563eb;
}

/* Кнопки переключения транспорта (Пешком / На лифте) (Скриншот 4) */
.transport-toggle {
    display: flex;
    gap: 12px;
    margin: 20px 0 24px 0;
}

.toggle-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 30px;
    background-color: transparent;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background-color: #FFFFFF;
    color: var(--panel-bg);
}

/* Кнопки основного действия */
.primary-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 30px;
    background-color: var(--primary-blue);
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
    margin-bottom: 24px;
    transition: transform 0.1s;
}

.primary-btn:active { transform: scale(0.98); }
.primary-btn.btn-finish { background-color: #ef4444; box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3); }

.secondary-btn {
    width: 100%;
    padding: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 30px;
    background-color: transparent;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #FFFFFF;
}

.secondary-btn:active { transform: scale(0.98); }

/* Сетка категорий POI */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 8px;
    margin-bottom: 26px;
}

.category-item {
    background: none;
    border: none;
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.icon-circle {
    width: 52px;
    height: 52px;
    background-color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease;
}

.icon-circle img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(0.2);
}

.category-item:active .icon-circle { transform: scale(0.94); }

.category-item span {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    color: #FFFFFF;
}

/* ВЕРТИКАЛЬНЫЙ ТАЙМЛАЙН ПОЯСНЕНИЙ МАРШРУТА (Скриншот 3) */
.route-destination-header {
    margin-bottom: 20px;
}

.route-destination-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
}

.steps-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin-bottom: 28px;
    padding-left: 28px;
}

/* Вертикальная белая линия таймлайна */
.steps-timeline::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 8px;
    width: 2px;
    background-color: rgba(255, 255, 255, 0.4);
}

.step-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    transition: opacity 0.15s;
}

.step-item:hover { opacity: 0.9; }

/* Белый маркер-точка */
.step-marker {
    position: absolute;
    left: -28px;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #FFFFFF;
    border: 3px solid var(--panel-bg);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.step-text {
    font-size: 13px;
    line-height: 1.45;
    font-weight: 500;
    color: #FFFFFF;
}

/* Лента новостей */
.news-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.news-item {
    display: block;
    width: 100%;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
}

.news-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* АДАПТАЦИЯ ДЛЯ ПК */
@media (min-width: 768px) {
    .ui-panel {
        top: 0 !important;
        left: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        width: 340px !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        padding: 40px 24px !important;
        overflow-y: auto !important;
        transform: none !important;
        transition: none !important;
    }

    .ui-panel::-webkit-scrollbar { display: none; }
    .drag-indicator { display: none; }
    .news-list { grid-template-columns: 1fr; }
}

/* КАРТОЧКА ИНФОРМАЦИИ ОБ АУДИТОРИИ (РЕЖИМ 3) */
.room-card-header {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.room-card-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.building-floor-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 12px;
}

.room-type-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    background-color: var(--primary-blue);
    color: #ffffff;
    border-radius: 12px;
    text-transform: capitalize;
}

.room-card-name {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 4px 0;
    letter-spacing: -0.5px;
}

.room-card-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.room-card-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-card-group {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.info-card-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-card-value {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.35;
}

.room-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.metric-box {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 10px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.metric-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

.metric-value {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.metric-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    margin-top: 2px;
}

/* ПОДСВЕТКА ВЫБРАННОЙ АУДИТОРИИ НА SVG КАРТЕ */
.room-highlighted {
    fill: #3b82f6 !important;
    fill-opacity: 0.65 !important;
    stroke: #ffffff !important;
    stroke-width: 3px !important;
    transition: all 0.3s ease;
    cursor: pointer;
}

svg rect[id], svg path[id] {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

svg rect[id]:hover, svg path[id]:hover {
    opacity: 0.85;
}