/* Yandex Map Custom Styles */

/* Map Section */
.map-section {
    height: 30rem;
    background: #0d0447;
    display: flex;
    flex-direction: column;
    margin-bottom: 3rem;
}
.ymaps-2-1-79-map {
    height: 100% !important;
}
.map-section .container-fluid {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.map-section .row {
    height: 100%;
    flex: 1;
}

.map-section .col-lg-9,
.map-section .col-md-8 {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Map Container */
#yandex-map-container {
    width: 100%;
    height: 100%;
    flex: 1;
    position: relative;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

@media (max-width: 991px) {
    /* Enhanced mobile touch handling */
    #yandex-map-container {
        /* Allow page scroll with single touch, map interaction with multi-touch */
        touch-action: pan-x pan-y pinch-zoom;
        /* Prevent text selection on touch */
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Enable map interaction only when multi-touching */
    #yandex-map-container.map-interacting {
        touch-action: none;
    }
    .map-section {
        margin-bottom: 0;
    }
}

/* Loading Indicator */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
    color: #fff;
}

.map-loading p {
    margin-top: 1rem;
    color: #c5a57d;
    font-size: 1rem;
}

/* Filter Panel */
.filter-panel-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

@media (max-width: 991px) {
    .filter-panel-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        min-height: 100vh;
        padding: 0;
        display: none;
    }
    
    .filter-panel-wrapper .filter-panel.show {
        display: block;
    }
}

.filter-panel {
    background: #272984;
    padding: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

@media (max-width: 991px) {
    .filter-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 100vh;
        border-radius: 0;
        padding: 2rem;
        margin: 0;
    }
}

.filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-panel-header h2 {
    font-family: 'Yeseva One', cursive;
    color: #c5a57d;
    font-size: 1.5rem;
    margin: 0;
}

.btn-close-filter {
    background: none;
    border: none;
    color: #c5a57d;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.btn-close-filter:hover {
    opacity: 0.7;
}


/* Search Input */
.filter-search input {
    background: rgba(13, 4, 71, 0.8);
    border: 1px solid rgba(197, 165, 125, 0.3);
    border-radius: 6px;
    color: #fff;
    padding: 0.75rem 1rem;
    width: 100%;
    transition: border-color 0.3s;
}

.filter-search input:focus {
    outline: none;
    border-color: #c5a57d;
    background: rgba(13, 4, 71, 0.95);
}

.filter-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Category Filters */

.filter-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-link-small {
    background: none;
    border: none;
    color: #c5a57d;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: opacity 0.3s;
}

.btn-link-small:hover {
    opacity: 0.7;
}

.filter-actions .divider {
    color: rgba(255, 255, 255, 0.3);
}

.category-filters {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}


.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    user-select: none;
}

.filter-checkbox:hover {
    transform: translateY(-2px);
}

.filter-checkbox input[type="checkbox"] {
    display: none;
    width: 0.6rem;
    height: 0.6rem;
    cursor: pointer;
    accent-color: #c5a57d;
}

.filter-icon {
    text-align: center;
}

.filter-label {
    flex: 1;
    color: #fff;
    font-size: 0.65rem;
}

.filter-count {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.65rem;
}

/* Filter Stats */
.filter-stats {
    padding-top: 1rem;
    border-top: 1px solid rgba(197, 165, 125, 0.2);
    margin-top: 1.5rem;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.stats-label {
    color: rgba(255, 255, 255, 0.7);
}

.stats-value {
    color: #c5a57d;
    font-weight: 600;
}

/* Toggle Filter Button (Mobile) */
.btn-toggle-filter {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    background: #c5a57d;
    color: #0d0447;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(197, 165, 125, 0.4);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-toggle-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(197, 165, 125, 0.5);
}

.btn-toggle-filter svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 991px) {
    .btn-toggle-filter {
        display: flex;
    }
}

/* Custom Markers */
.custom-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    /* Initial state for animation */
    opacity: 0;
    transform: scale(0);
}

.custom-marker.marker-appear {
    animation: markerAppear 0.5s ease-out forwards;
}

@keyframes markerAppear {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.custom-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.marker-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.marker-icon svg {
    width: 100%;
    height: 100%;
    stroke: #ffffff !important;
    fill: #ffffff !important;
    color: #ffffff !important;
}

.marker-icon svg path {
    fill: #ffffff !important;
    stroke: #ffffff !important;
}

/* Main Marker (Logo) */
.main-marker {
    position: relative;
    width: 60px;
    height: 60px;
    cursor: pointer;
}

.main-marker-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(39, 41, 132, 0.3);
    animation: pulse 2s infinite;
    border: 2px solid rgba(39, 41, 132, 0.5);
}

.main-marker-icon {
    position: relative;
    z-index: 2;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #272984;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

.main-marker-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(39, 41, 132, 0.5);
}

.main-marker-icon img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    padding: 5px;
}

/* Mobile: Smaller markers */
@media (max-width: 991px) {
    /* Custom markers - smaller on mobile */
    .custom-marker {
        width: 32px;
        height: 32px;
        border-width: 2px;
    }
    
    .marker-icon {
        width: 16px;
        height: 16px;
    }
    
    /* Main marker - smaller on mobile */
    .main-marker {
        width: 48px;
        height: 48px;
    }
    
    .main-marker-pulse {
        width: 48px;
        height: 48px;
    }
    
    .main-marker-icon {
        width: 48px;
        height: 48px;
        border-width: 2px;
    }
    
    .main-marker-icon img {
        width: 36px;
        height: 36px;
        padding: 4px;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Main Balloon (White Tooltip) */
.main-balloon {
    background: #fff;
    border-radius: 12px;
    padding: 0;
    max-width: 350px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.main-balloon-logo {
    background: linear-gradient(135deg, #0d0447 0%, #1f2251 100%);
    padding: 1.5rem;
    text-align: center;
    border-bottom: 3px solid #c5a57d;
}

.main-balloon-logo img {
    max-width: 180px;
    height: auto;
    filter: brightness(0) invert(1);
}

.main-balloon-content {
    padding: 1.5rem;
}

.main-balloon-content h3 {
    font-family: 'Yeseva One', cursive;
    color: #0d0447;
    font-size: 1.25rem;
    margin: 0 0 0.75rem 0;
    text-align: center;
}

.main-balloon-content p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1rem 0;
    text-align: center;
}

.main-balloon-contact {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.main-balloon-contact a {
    color: #c5a57d;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.3s;
}

.main-balloon-contact a:hover {
    opacity: 0.7;
}

/* Yandex Balloon Override for Main Marker */
.ymaps-2-1-79-balloon__content {
    padding: 0 !important;
    margin: 0 !important;
}

.ymaps-2-1-79-balloon__close-button {
    background-color: rgba(0, 0, 0, 0.1) !important;
    border-radius: 50% !important;
}

.ymaps-2-1-79-balloon__close-button:hover {
    background-color: rgba(0, 0, 0, 0.2) !important;
}

/* Yandex Maps Balloon Customization */
.ymaps-2-1-79-balloon {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

.ymaps-2-1-79-balloon__content {
    padding: 0 !important;
    margin: 0 !important;
}

.ymaps-2-1-79-balloon__tail {
    display: none !important;
}

/* Info Window Content */
.info-window-content {
    max-width: 350px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.info-window-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.info-window-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-window-body {
    padding: 1.5rem;
}

.info-window-title {
    font-family: 'Yeseva One', cursive;
    color: #0d0447;
    font-size: 1.25rem;
    margin: 0 0 0.75rem 0;
}

.info-window-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.info-window-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #333;
}

.info-detail-item svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #c5a57d;
}

.info-detail-item a {
    color: #c5a57d;
    text-decoration: none;
    transition: opacity 0.3s;
}

.info-detail-item a:hover {
    opacity: 0.7;
}

/* Balloon Content (Yandex default) */
.balloon-content {
    padding: 1rem;
    max-width: 300px;
}

.balloon-content h4 {
    font-family: 'Yeseva One', cursive;
    color: #0d0447;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.balloon-content p {
    margin: 0.5rem 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.balloon-content a {
    color: #c5a57d;
    text-decoration: none;
}

.balloon-content a:hover {
    text-decoration: underline;
}

/* Scrollbar Styling for Filter Panel */
.filter-panel::-webkit-scrollbar {
    width: 6px;
}

.filter-panel::-webkit-scrollbar-track {
    background: rgba(13, 4, 71, 0.5);
    border-radius: 3px;
}

.filter-panel::-webkit-scrollbar-thumb {
    background: #c5a57d;
    border-radius: 3px;
}

.filter-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(197, 165, 125, 0.8);
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    .map-section {
        height: 50vh;
        min-height: 50vh;
        margin-top: 3rem;
    }
    
    .filter-panel {
        padding: 1.5rem;
    }
    
    .filter-panel-header h2 {
        font-size: 1.25rem;
    }
    
    .info-window-content {
        max-width: 280px;
    }
    
    .info-window-image {
        height: 150px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-item {
    animation: fadeIn 0.3s ease-out;
}

/* Yandex Maps Controls Customization */
/* .ymaps-2-1-79-controls__control_toolbar {
    background: rgba(13, 4, 71, 0.9) !important;
}

.ymaps-2-1-79-controls__control {
    background: rgba(13, 4, 71, 0.9) !important;
}

.ymaps-2-1-79-controls__control_toolbar .ymaps-2-1-79-controls__control_toolbar-button {
    background: rgba(197, 165, 125, 0.2) !important;
}

.ymaps-2-1-79-controls__control_toolbar .ymaps-2-1-79-controls__control_toolbar-button:hover {
    background: rgba(197, 165, 125, 0.4) !important;
} */

