/* Armenia Map Container */
.armenia-map-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.armenia-map-wrapper {
    position: relative;
    width: 100%;
    overflow: visible; /* Важно для правильного отображения */
}

/* SVG Map - RESPONSIVE */
.armenia-svg-map {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
    max-width: 100%; /* Не выходит за границы */
}

/* City Dots - Увеличенные размеры */
.armenia-city-dot {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 3px solid rgba(255,255,255,0.9);
    z-index: 10;
    padding: 8px;
}

.armenia-city-dot span {
    padding: 2px 4px;
    line-height: 1.2;
    word-wrap: break-word;
    max-width: 100%;
    display: block;
}

.armenia-city-dot:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    z-index: 20;
}

.armenia-city-dot:active {
    transform: translate(-50%, -50%) scale(1.05);
}

/* Yerevan Dot - больше остальных */
.armenia-city-dot.yerevan-dot {
    z-index: 15;
}

/* ==================== MOBILE LEGEND (скрыта по умолчанию) ==================== */
.armenia-map-legend {
    display: none; /* Показывается только на мобильном */
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.legend-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    text-align: center;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.legend-item:hover {
    background: #f5f5f5;
}

.legend-item:active {
    background: #e0e0e0;
}

.legend-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.legend-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
}

/* ==================== YEREVAN IMAGE BOXES MODAL ==================== */
.armenia-boxes-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.armenia-boxes-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.armenia-boxes-content {
    background: #fff;
    border-radius: 12px;
    padding: 40px 30px 30px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.armenia-boxes-title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    margin: 0 0 30px 0;
    color: #333;
}

.armenia-boxes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.armenia-image-box {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.armenia-image-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.armenia-image-box img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.armenia-image-box h4 {
    margin: 0;
    padding: 12px 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: #333;
    background: #fff;
}

/* Gallery Modal */
.armenia-gallery-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.armenia-gallery-modal.active {
    display: block;
    opacity: 1;
}

/* Modal Close Button */
.armenia-modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #ffffff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100001;
    transition: color 0.3s;
}

.armenia-modal-close:hover,
.armenia-modal-close:focus {
    color: #ff6b6b;
}

/* Modal Content */
.armenia-modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.armenia-gallery-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

/* Navigation Buttons */
.armenia-gallery-prev,
.armenia-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 16px 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
    z-index: 100000;
}

.armenia-gallery-prev:hover,
.armenia-gallery-next:hover {
    background-color: rgba(255,255,255,0.4);
}

.armenia-gallery-prev {
    left: 20px;
}

.armenia-gallery-next {
    right: 20px;
}

/* Gallery Counter */
.armenia-gallery-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    background-color: rgba(0,0,0,0.6);
    padding: 8px 16px;
    border-radius: 20px;
}

/* ==================== RESPONSIVE ==================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .armenia-city-dot {
        font-size: 11px;
        border-width: 2px;
        padding: 6px;
    }

    .armenia-boxes-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

/* Tablet (до 768px) */
@media (max-width: 768px) {
    .armenia-map-container {
        padding: 15px;
        max-width: 100%; /* Занимает всю ширину */
    }

    .armenia-city-dot {
        font-size: 10px;
        border-width: 2px;
        padding: 5px;
    }

    .armenia-boxes-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .armenia-image-box img {
        height: 120px;
    }

    .armenia-image-box h4 {
        font-size: 13px;
        padding: 10px 8px;
    }

    .armenia-boxes-title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .armenia-boxes-content {
        padding: 30px 20px 20px;
    }

    .armenia-modal-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }

    .armenia-gallery-prev,
    .armenia-gallery-next {
        padding: 12px 16px;
        font-size: 22px;
    }

    .armenia-gallery-prev {
        left: 10px;
    }

    .armenia-gallery-next {
        right: 10px;
    }

    .armenia-gallery-counter {
        bottom: 20px;
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* Mobile (до 480px) - ГЛАВНЫЕ ИЗМЕНЕНИЯ */
@media (max-width: 480px) {
    .armenia-map-container {
        padding: 10px;
        max-width: 100vw; /* Не выходит за границы экрана */
        overflow: hidden; /* Обрезаем всё что выходит */
    }

    .armenia-map-wrapper {
        width: 100%;
        overflow: visible;
    }

    /* SVG карта - адаптивная */
    .armenia-svg-map {
        width: 100%;
        height: auto;
        max-width: 100%;
    }

    /* МАЛЕНЬКИЕ ТОЧКИ БЕЗ ТЕКСТА */
    .armenia-city-dot {
        width: 30px !important; /* Переопределяем inline стили */
        height: 30px !important;
        padding: 0;
        border-width: 2px;
        font-size: 0; /* Скрываем текст */
    }

    .armenia-city-dot span {
        display: none; /* Полностью скрываем текст */
    }

    /* Ереван чуть крупнее */
    .armenia-city-dot.yerevan-dot {
        width: 45px !important;
        height: 45px !important;
    }

    /* ПОКАЗЫВАЕМ ЛЕГЕНДУ НА МОБИЛЬНОМ */
    .armenia-map-legend {
        display: block;
        margin-top: 15px;
        padding: 12px;
    }

    .legend-title {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .legend-grid {
        gap: 8px;
    }

    .legend-item {
        padding: 6px;
    }

    .legend-dot {
        width: 16px;
        height: 16px;
    }

    .legend-name {
        font-size: 12px;
    }

    /* Image boxes на мобильном */
    .armenia-boxes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .armenia-image-box img {
        height: 100px;
    }

    .armenia-image-box h4 {
        font-size: 12px;
        padding: 8px 6px;
    }

    .armenia-boxes-title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .armenia-boxes-content {
        padding: 25px 15px 15px;
        width: 95%;
    }

    .armenia-gallery-prev,
    .armenia-gallery-next {
        padding: 10px 12px;
        font-size: 20px;
    }

    .armenia-gallery-image {
        max-height: 70vh;
    }
}

/* Very small mobile (до 360px) */
@media (max-width: 360px) {
    .armenia-map-container {
        padding: 8px;
    }

    /* Еще меньше точки */
    .armenia-city-dot {
        width: 25px !important;
        height: 25px !important;
    }

    .armenia-city-dot.yerevan-dot {
        width: 38px !important;
        height: 38px !important;
    }

    /* Легенда в 1 колонку на очень маленьких экранах */
    .legend-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    /* Image boxes в 1 колонку */
    .armenia-boxes-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .armenia-image-box img {
        height: 150px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.armenia-city-dot.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Smooth scrollbar for boxes modal */
.armenia-boxes-content::-webkit-scrollbar {
    width: 8px;
}

.armenia-boxes-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.armenia-boxes-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.armenia-boxes-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}
