/* Стили для новой карты */

.world-map-container {
    position: relative;
    width: 100%;
    height: 100%;  /* ВАЖНО: 100% а не min-height */
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    overflow: hidden;
    /* Убираем min-height: 400px; */
}

/* SVG карта должна занимать все пространство */
#world-map-svg {
    width: 100%;
    height: 100%;  /* Занимает всю высоту контейнера */
    display: block;
    transition: transform 0.3s ease;
    transform-origin: center;
}

/* Обнови map-placeholder если нужно */
.map-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 0;  /* Важно для flex */
    overflow: hidden;
    border-radius: 12px;
}

/* ID контейнер для карты */
#world-map-container {
    flex: 1;
    position: relative;
    min-height: 300px; /* Минимальная высота */
}

/* Адресная плашка внизу */
.map-address-box {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 12px;
    z-index: 500;
}


/* Панель информации внизу карты */
.map-info-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: rgba(0,0,0,0.5);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    font-size: 12px;
    z-index: 100;  /* Ниже чем map-address-box */
}


/* Кнопка карандашик */
.btn-edit-map {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    opacity: 0.6;
    transition: 0.2s;
}
.btn-edit-map:hover { opacity: 1; transform: scale(1.1); }

/* Континенты */
.continent {
    transition: all 0.3s ease;
    cursor: pointer;
}

.continent:hover {
    fill: #d0d0d0;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.3));
}

/* События на карте */
.map-event {
    cursor: pointer;
    transition: filter 0.3s ease;
}

.map-event:hover {
    filter: brightness(1.3) drop-shadow(0 0 10px currentColor);
}

/* Панель управления */
.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 1000;
}

.map-controls button {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.9);
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.map-controls button:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Информационная панель */
.map-info-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: rgba(0,0,0,0.5);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    font-size: 12px;
    font-family: monospace;
}

/* Подсказки */
.map-tooltip {
    position: fixed;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    max-width: 250px;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: none;
}

.tooltip-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #b5b5b5;
}

.tooltip-description {
    line-height: 1.4;
}

/* Полноэкранный режим */
.map-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;  /* Центрируем содержимое */
    animation: fadeIn 0.3s ease;
}

.map-fullscreen-overlay .world-map-container {
    width: 90vw;
    height: 90vh;
    max-width: 1800px;  /* Ограничиваем максимальную ширину */
    margin: 0 auto;     /* Центрируем горизонтально */
}

.map-fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100000;
}

.map-fullscreen-close:hover {
    transform: scale(1.1) rotate(90deg);
    background: #ff3b3b;
    color: white;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Адаптивность */
@media (max-width: 768px) {
    .map-controls {
        top: 5px;
        right: 5px;
    }
    
    .map-controls button {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .map-info-panel {
        font-size: 10px;
        padding: 0 10px;
    }
}

/* Оптимизация производительности */
.map-event {
    will-change: transform, opacity;
}

/* Отключение анимаций при низкой производительности */
@media (prefers-reduced-motion: reduce) {
    .map-event animate,
    .map-event animateTransform {
        animation: none !important;
    }
}

/* Стили для стран с реальными границами */
.country {
    transition: all 0.2s ease;
    cursor: pointer;
    vector-effect: non-scaling-stroke;
}

.country:hover {
    fill: #b0b0b0 !important;
    stroke-width: 1px !important;
}

.country.selected {
    fill: #525252 !important;
    stroke: #9d9d9d !important;
    stroke-width: 2px !important;
}

/* Оптимизация для большого количества путей */
#continents {
    shape-rendering: geometricPrecision;
}



/* Исправление для России и других стран, пересекающих антимеридиан */
.country[data-id="643"], /* Россия */
.country[data-id="840"], /* США (Аляска) */
.country[data-id="242"] /* Фиджи */ {
    fill-rule: evenodd;
}

