﻿/* ============================================================================
   MAP PAGE STYLES
   ============================================================================ */

/* Hero Section Wrapper с адаптивными отступами */
.map-hero-wrapper {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Hero Section */
.map-hero-section {
    position: relative;
    min-height: 275px; /* Изменено с height на min-height */
    overflow: hidden;
    background: url('/images/hero-city.jpg') center/cover no-repeat;
    border-radius: 8px;
}

    .map-hero-section h1 {
        line-height: 1.2;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .map-hero-section .lead {
        font-size: 1.15rem;
        max-width: 600px;
    }

/* Отступы для Hero wrapper на разных экранах */
@media (min-width: 576px) {
    .map-hero-wrapper {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
}

@media (min-width: 768px) {
    .map-hero-wrapper {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

@media (min-width: 992px) {
    .map-hero-wrapper {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

@media (min-width: 1200px) {
    .map-hero-wrapper {
        max-width: 1320px;
        padding-left: 5rem;
        padding-right: 5rem;
    }
}

@media (min-width: 1400px) {
    .map-hero-wrapper {
        max-width: 1400px;
        padding-left: 6rem;
        padding-right: 6rem;
    }
}

@media (min-width: 1600px) {
    .map-hero-wrapper {
        max-width: 1500px;
        padding-left: 7rem;
        padding-right: 7rem;
    }
}

/* Legend Card */
.map-legend-card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    background-color: #ffffff;
}

    .map-legend-card h3 {
        color: #212529;
        font-size: 1.25rem;
    }

    .map-legend-card h6 {
        color: #6c757d;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

/* Legend Markers */
.legend-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.legend-marker-medical {
    background-color: #ef4444;
}

.legend-marker-education {
    background-color: #3b82f6;
}

.legend-marker-culture {
    background-color: #a855f7;
}

.legend-marker-transport {
    background-color: #10b981;
}

/* Route Badge */
.route-badge {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Tabs */
.map-tabs {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

    .map-tabs .nav-link {
        border: none;
        border-bottom: 3px solid transparent;
        color: #6c757d;
        font-weight: 500;
        padding: 0.75rem 1rem;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        .map-tabs .nav-link:hover {
            color: #0d6efd;
            border-bottom-color: #0d6efd;
        }

        .map-tabs .nav-link.active {
            color: #0d6efd;
            border-bottom-color: #0d6efd;
            background-color: transparent;
        }

    .map-tabs i {
        font-size: 1.1rem;
    }

/* Map Container */
.map-container {
    margin-bottom: 3rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #f8f9fa;
}

/* Map Placeholder */
.map-placeholder {
    width: 100%;
    min-height: 500px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.map-placeholder-content {
    text-align: center;
    color: #6c757d;
    padding: 2rem;
}

    .map-placeholder-content i {
        font-size: 3rem;
        color: #0d6efd;
        margin-bottom: 1rem;
        opacity: 0.3;
    }

    .map-placeholder-content p {
        font-size: 1.25rem;
        font-weight: 600;
        margin: 0;
        color: #495057;
    }

    .map-placeholder-content small {
        display: block;
        margin-top: 0.5rem;
        font-size: 0.875rem;
    }

/* Content Container */
.content-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Institutions List */
.institutions-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .institutions-list {
        grid-template-columns: 1fr;
    }
}

.institution-card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

    .institution-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
        border-color: #0d6efd;
    }

    .institution-card h6 {
        color: #212529;
        font-size: 1rem;
    }

    .institution-card .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
        font-weight: 600;
    }

    .institution-card .text-muted {
        font-size: 0.875rem;
        color: #6c757d;
    }

    .institution-card i {
        color: #0d6efd;
    }

.transition-all {
    transition: all 0.3s ease;
}

/* Transport Routes List */
.transport-routes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .transport-routes-list {
        grid-template-columns: 1fr;
    }
}

.route-card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

    .route-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }

.route-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.route-card h6 {
    color: #212529;
    font-size: 1rem;
}

.route-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.route-stops {
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    padding: 0.75rem;
}

.stops-list {
    display: grid;
    gap: 0.5rem;
}

.stop-item {
    padding: 0.25rem 0;
}

/* Help Card */
.map-help-card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
    margin-top: 2rem;
}

    .map-help-card h5 {
        color: #212529;
        font-size: 1.1rem;
    }

.help-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e7f1ff;
    border-radius: 0.5rem;
    color: #0d6efd;
    font-size: 1.2rem;
}

.map-help-card h6 {
    color: #212529;
    font-size: 0.95rem;
    font-weight: 600;
}

.map-help-card p {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 992px) {
    .map-hero-section {
        min-height: 250px;
        border-radius: 6px;
    }
}

@media (max-width: 768px) {
    .map-hero-section {
        min-height: 200px;
        border-radius: 6px;
    }

        .map-hero-section h1 {
            font-size: 1.75rem;
        }

        .map-hero-section .lead {
            font-size: 0.95rem;
        }

    .map-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

        .map-tabs .nav-link {
            padding: 0.5rem 0.75rem;
            font-size: 0.875rem;
        }

        .map-tabs i {
            font-size: 1rem;
        }

    .map-placeholder {
        min-height: 350px;
    }

    .institutions-list,
    .transport-routes-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .map-legend-card .row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .map-hero-section {
        min-height: 150px;
        border-radius: 4px;
    }

        .map-hero-section h1 {
            font-size: 1.5rem;
        }

        .map-hero-section .lead {
            font-size: 0.875rem;
            display: none; /* Скрываем описание на очень маленьких экранах */
        }

    .map-tabs {
        gap: 0;
        border-bottom: 1px solid #e9ecef;
    }

        .map-tabs .nav-link {
            border: none;
            border-bottom: 2px solid transparent;
            padding: 0.5rem;
            flex: 1;
            text-align: center;
            justify-content: center;
            font-size: 0.75rem;
        }

        .map-tabs i {
            margin-right: 0 !important;
        }

        .map-tabs span {
            display: none;
        }

    .map-placeholder {
        min-height: 300px;
    }

    .map-help-card .row {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-pane.active {
    animation: fadeIn 0.3s ease;
}

/* Utility Classes */
.transition-all {
    transition: all 0.3s ease;
}

/* Transport Card Styles */
.transport-card {
    transition: all 0.3s ease;
}

.transport-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* Timeline Styles */
.stops-timeline {
    position: relative;
}

.stop-item {
    min-height: 40px;
}

.timeline-line {
    content: '';
}

.stop-marker {
    transition: all 0.3s ease;
}

.stop-item:hover .stop-marker {
    transform: scale(1.3);
}

/* Route Badge Styles */
.route-color-badge {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Alert Small Styles */
.alert-sm {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0;
    font-size: 0.875rem;
}

/* Print Styles */
@media print {
    .map-tabs,
    .map-help-card {
        display: none;
    }

    .institution-card,
    .route-card {
        page-break-inside: avoid;
    }
}

/* ============================================================================
   MAPLIBRE CUSTOM MARKER STYLES
   ============================================================================ */

/* Custom Marker Container */
.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: white;
    /* Border color is set dynamically by JavaScript */
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.custom-marker:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Marker Popup Styles */
.maplibregl-popup-content {
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 300px;
}

.marker-popup h6 {
    font-weight: 600;
    color: #0d6efd;
    margin-bottom: 10px;
}

.marker-popup p {
    margin-bottom: 8px;
    line-height: 1.4;
}

.marker-popup a {
    color: #0d6efd;
    text-decoration: none;
}

.marker-popup a:hover {
    text-decoration: underline;
}

/* MapLibre Navigation Controls */
.maplibregl-ctrl-group {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.maplibregl-ctrl-group button {
    width: 32px;
    height: 32px;
}

/* MapLibre Attribution */
.maplibregl-ctrl-attrib {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Map Loading Overlay */
.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(248, 249, 250, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 0.5rem;
}

.map-loading-content {
    text-align: center;
    color: #6c757d;
    padding: 2rem;
}

.map-loading-content .spinner-border {
    width: 3rem;
    height: 3rem;
}

.map-loading-overlay.d-none {
    display: none !important;
}

/* Убедитесь что есть position: relative */
.map-container {
    position: relative;
}