/**
 * Cheb Travel Map — Стили фронтенда (страница карты)
 */

/* ===== Страница карты ===== */
/**
 * Cheb Travel Map — Стили фронтенда (страница карты)
 */

/* ===== Утилиты и сброс ===== */
#ctm-travel-map-page {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f0f2f5;
    height: calc(100vh - 32px);
    /* Компенсация админ-бара, если есть, или хедера */
    min-height: 600px;
    overflow: hidden;
    /* Скроллим только контент внутри */
}

/* При админ-баре */
body.admin-bar #ctm-travel-map-page {
    height: calc(100vh - 32px);
}

.ctm-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ===== Сайдбар ===== */
.ctm-sidebar {
    width: 380px;
    flex-shrink: 0;
    background: #1a1a2e;
    /* Dark theme as requested */
    color: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 20;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.ctm-sidebar-header {
    padding: 24px 24px 16px;
    background: #16213e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ctm-logo-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ctm-filters-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Скроллбар для сайдбара */
.ctm-filters-container::-webkit-scrollbar {
    width: 6px;
}

.ctm-filters-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.ctm-filters-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.ctm-sidebar-footer {
    padding: 16px 24px;
    background: #16213e;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.ctm-points-count {
    color: #e94560;
    font-weight: 600;
}

.ctm-back-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s;
}

.ctm-back-link:hover {
    color: #fff;
}

/* ===== Стили фильтров ===== */
.ctm-filter-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: ctm-fade-in 0.3s ease;
}

.ctm-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ctm-select-wrapper {
    position: relative;
}

.ctm-select-wrapper::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    opacity: 0.6;
}

select {
    width: 100%;
    padding: 12px 14px;
    padding-right: 36px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 15px;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

select:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

select:focus {
    border-color: #e94560;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.25);
    background: rgba(255, 255, 255, 0.12);
}

select option {
    background: #1a1a2e;
    color: #fff;
}

/* Анимация появления */
@keyframes ctm-fade-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Карта ===== */
.ctm-map-wrapper {
    flex: 1;
    position: relative;
    background: #e5e5e5;
}

.ctm-map-canvas {
    width: 100%;
    height: 100%;
}

/* ===== Лоадер ===== */
.ctm-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(5px);
    z-index: 50;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

.ctm-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #e94560;
    border-radius: 50%;
    animation: ctm-spin 0.8s linear infinite;
}

@keyframes ctm-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Балун ===== */
.ctm-balloon {
    font-family: 'Inter', sans-serif;
    color: #333;
}

.ctm-balloon-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.2;
}

.ctm-balloon-badge {
    display: inline-block;
    background: #e94560;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
}

.ctm-balloon-link {
    display: inline-block;
    margin-top: 8px;
    color: #e94560;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

/* ===== Адаптивность ===== */
@media (max-width: 900px) {
    .ctm-sidebar {
        width: 320px;
    }
}

@media (max-width: 768px) {
    .ctm-wrapper {
        flex-direction: column;
        overflow: auto;
        /* На мобилке скроллим всю страницу */
        height: auto;
    }

    #ctm-travel-map-page {
        height: auto;
        overflow: visible;
    }

    .ctm-sidebar {
        width: 100%;
        max-height: none;
        box-shadow: none;
    }

    .ctm-filters-container {
        padding: 16px;
        gap: 16px;
    }

    .ctm-map-wrapper {
        height: 500px;
        /* Фиксированная высота карты на мобилке */
        width: 100%;
    }
}