/* FastBot Map Styles */

/* Основная карта */
#map {
    height: 60vh;
    min-height: 400px;
    width: 100%;
    border-radius: 12px;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

/* Заголовок карты - исправляем контраст */
.fastbot-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 24px 0;
    margin-bottom: 24px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.fastbot-header h1 {
    color: white;
    font-size: 24px;
    margin-bottom: 8px;
}

.fastbot-header p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
}

/* Кнопки в заголовке карты - цветные */
.fastbot-header .btn-light {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border: 2px solid white;
    color: white;
    font-weight: 700;
}

.fastbot-header .btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: 2px solid white;
    color: white;
    font-weight: 700;
}

/* На мобильных карта занимает больше места */
@media (max-width: 767px) {
    #map {
        height: 70vh;
        border-radius: 8px;
        margin: 0 -5px;
    }
}

/* Контейнер для карты */
.map-container {
    position: relative;
    margin-bottom: 24px;
}

/* Панель управления картой */
.map-controls {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.map-controls h4 {
    color: #333;
    margin-bottom: 16px;
    font-size: 16px;
}

.map-controls .row {
    align-items: end;
}

/* Фильтры на карте */
.map-filter {
    margin-bottom: 16px;
}

.map-filter label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Попапы на карте */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.leaflet-popup-content {
    margin: 0;
    line-height: 1.4;
}

/* Стили для попапа партнера */
.partner-popup {
    max-width: 280px;
    font-family: inherit;
}

.partner-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.partner-popup .popup-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
}

.partner-popup .popup-id {
    background: #f8f9fa;
    color: #6c757d;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.partner-popup .popup-category {
    display: inline-block;
    background: #6c757d;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 10px;
}

.partner-popup .popup-promo {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 12px;
    text-align: center;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.partner-popup .popup-description {
    color: #6c757d;
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.partner-popup .popup-info {
    margin-bottom: 8px;
}

.partner-popup .popup-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 6px;
    font-size: 13px;
}

.partner-popup .popup-icon {
    width: 16px;
    margin-right: 6px;
    color: #007bff;
}

.partner-popup .popup-text {
    flex: 1;
    color: #495057;
}

.partner-popup .popup-phone {
    font-weight: 600;
    color: #333;
}

.partner-popup .popup-hours {
    font-weight: 500;
    color: #28a745;
}

.partner-popup .popup-divider {
    border: 0;
    height: 1px;
    background: #dee2e6;
    margin: 12px 0;
}

.partner-popup .popup-actions {
    margin-top: 12px;
}

.partner-popup .popup-call-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.partner-popup .popup-call-btn:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* Кастомные маркеры */
.custom-marker {
    background: #007bff;
    width: 25px;
    height: 25px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.custom-marker::after {
    content: '🏪';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    font-size: 12px;
}

.user-marker {
    background: #dc3545;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    position: relative;
}

.user-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Мобильные улучшения для карты */
@media (max-width: 767px) {
    .map-controls {
        padding: 16px;
        margin-bottom: 16px;
    }

    .map-controls .row {
        flex-direction: column;
    }

    .map-filter {
        margin-bottom: 12px;
    }

    .map-btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .compass-control {
        top: 60px;
        right: 5px;
        width: 35px;
        height: 35px;
        font-size: 12px;
    }

    .rotation-indicator {
        top: 100px;
        right: 5px;
        padding: 4px 8px;
        font-size: 11px;
    }

    .partner-popup {
        max-width: 250px;
    }

    .partner-popup .popup-title {
        font-size: 15px;
    }

    .leaflet-popup-content {
        font-size: 13px;
    }
}

/* Загрузка данных карты */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1001;
    text-align: center;
}

.map-loading .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

/* Кластеры маркеров */
.marker-cluster {
    background: rgba(0, 123, 255, 0.8);
    color: white;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

.marker-cluster-small {
    width: 30px;
    height: 30px;
}

.marker-cluster-medium {
    width: 35px;
    height: 35px;
    font-size: 13px;
}

.marker-cluster-large {
    width: 40px;
    height: 40px;
    font-size: 14px;
}

/* Анимации */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.user-marker {
    animation: pulse 2s infinite;
}

/* Темная тема для ночного режима */
@media (prefers-color-scheme: dark) {
    .map-controls {
        background: #2d3748;
        color: white;
        border-color: #4a5568;
    }

    .map-legend {
        background: rgba(45, 55, 72, 0.95);
        color: white;
        border-color: #4a5568;
    }

    .compass-control {
        background: rgba(45, 55, 72, 0.95);
        color: white;
        border-color: #4a5568;
    }
}
    color: #495057;
    font-size: 14px;
}

.map-filter select,
.map-filter input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

/* Кнопки на карте */
.map-btn {
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 6px;
    border: 2px solid #007bff;
    background: white;
    color: #007bff;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 42px;
}

.map-btn:hover {
    background: #007bff;
    color: white;
}

.map-btn-primary {
    background: #007bff;
    color: white;
}

.map-btn-primary:hover {
    background: #0056b3;
}

/* Статус геолокации */
.location-status {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.location-found {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.location-denied {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.location-searching {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Легенда карты */
.map-legend {
    background: rgba(255, 255, 255, 0.95);
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 1px solid #e9ecef;
}

.map-legend h6 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.legend-icon {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    font-size: 16px;
}

/* Промо в легенде */
.legend-promo {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    padding: 8px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    margin-top: 12px;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

/* Счетчик партнеров */
.partner-counter {
    background: #e7f3ff;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    margin-top: 16px;
    border-left: 4px solid #007bff;
}

.partner-counter strong {
    color: #007bff;
    font-size: 18px;
}

/* Индикаторы поворота карты */
.compass-control {
    position: absolute;
    top: 80px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 2px solid #dee2e6;
    z-index: 1000;
    cursor: help;
}

.rotation-indicator {
    position: absolute;
    top: 130px;
    right: 10px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;