/* ============================================
   НОВАЯ КАРТА МИРА (визуальная, на базе vis-network)
   ============================================ */

/* Переменные */
:root {
    --world-map-bg: radial-gradient(ellipse at center, #0f0f1a 0%, #0a0a12 50%, #050508 100%);
    --world-map-node-size: 50;
    --world-map-edge-color: rgba(76, 201, 240, 0.4);
    --world-map-edge-width: 2;
    --world-map-text-color: #e0e0e0;
}

/* Контейнер новой карты */
#new-map-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--world-map-bg);
    z-index: 1500;
    overflow: hidden;
}

#new-map-screen.active {
    display: block;
}

/* Верхняя панель с вкладками миров и кнопками */
.new-map-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Вкладки миров */
.world-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
}

.world-tab {
    padding: 8px 16px;
    background: rgba(76, 201, 240, 0.1);
    border: 1px solid rgba(76, 201, 240, 0.3);
    border-radius: 0;
    color: #4cc9f0;
    font-family: 'Noto Sans', sans-serif;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.world-tab:hover {
    background: rgba(76, 201, 240, 0.2);
    border-color: rgba(76, 201, 240, 0.6);
}

.world-tab.active {
    background: rgba(76, 201, 240, 0.25);
    border-color: #4cc9f0;
    box-shadow: 0 0 15px rgba(76, 201, 240, 0.3);
}

.world-tab .world-tab-icon {
    font-size: 16px;
}

.world-tab .world-tab-count {
    font-size: 11px;
    opacity: 0.7;
    margin-left: 4px;
}

/* Кнопки управления */
.new-map-controls {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.new-map-btn {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    color: #ccc;
    font-family: 'Noto Sans', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.new-map-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.new-map-btn.active {
    background: rgba(76, 201, 240, 0.3);
    border-color: #4cc9f0;
    color: #4cc9f0;
}

/* Контейнер визуальной карты */
#new-map-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Легенда карты */
.new-map-legend {
    position: absolute;
    bottom: 80px;
    left: 16px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(76, 201, 240, 0.3);
    padding: 12px;
    border-radius: 0;
    z-index: 10;
    min-width: 180px;
}

.new-map-legend-title {
    font-size: 12px;
    color: #4cc9f0;
    margin-bottom: 8px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #ccc;
}

.legend-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid currentColor;
    font-size: 12px;
}

.legend-icon.current {
    background: rgba(0, 188, 212, 0.3);
    border-color: #00bcd4;
}

.legend-icon.ship {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
}

.legend-icon.jump {
    background: rgba(156, 39, 176, 0.2);
    border-color: #9c27b0;
}

.legend-icon.locked {
    background: rgba(244, 67, 54, 0.15);
    border-color: #f44336;
    opacity: 0.6;
}

.legend-icon.available {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4caf50;
}

/* Панель информации о локации */
.new-map-info-panel {
    position: absolute;
    bottom: 80px;
    right: 16px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(76, 201, 240, 0.3);
    padding: 16px;
    border-radius: 0;
    z-index: 10;
    min-width: 220px;
    max-width: 300px;
    display: none;
}

.new-map-info-panel.active {
    display: block;
}

.new-map-info-title {
    font-size: 16px;
    color: #4cc9f0;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-map-info-desc {
    font-size: 13px;
    color: #aaa;
    line-height: 1.4;
    margin-bottom: 12px;
}

.new-map-info-status {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.new-map-info-badge {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 0;
    border: 1px solid;
}

.new-map-info-badge.current {
    background: rgba(0, 188, 212, 0.2);
    border-color: #00bcd4;
    color: #00bcd4;
}

.new-map-info-badge.ship {
    background: rgba(255, 193, 7, 0.15);
    border-color: #ffc107;
    color: #ffc107;
}

.new-map-info-badge.jump {
    background: rgba(156, 39, 176, 0.15);
    border-color: #9c27b0;
    color: #9c27b0;
}

.new-map-info-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.new-map-action-btn {
    padding: 10px 16px;
    background: rgba(76, 201, 240, 0.2);
    border: 1px solid rgba(76, 201, 240, 0.4);
    border-radius: 0;
    color: #4cc9f0;
    font-family: 'Noto Sans', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.new-map-action-btn:hover {
    background: rgba(76, 201, 240, 0.3);
    border-color: #4cc9f0;
}

.new-map-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Нижняя панель со статусом */
.new-map-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.new-map-current-location {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #e0e0e0;
}

.new-map-current-location-icon {
    font-size: 20px;
}

.new-map-ship-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #aaa;
}

.new-map-ship-icon {
    font-size: 18px;
}

/* Кнопка закрытия */
.new-map-close-btn {
    padding: 10px 20px;
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.4);
    border-radius: 0;
    color: #f44336;
    font-family: 'Noto Sans', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.new-map-close-btn:hover {
    background: rgba(244, 67, 54, 0.3);
    border-color: #f44336;
}

/* Анимации для узлов */
@keyframes node-pulse-current {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 188, 212, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 188, 212, 0.8);
    }
}

@keyframes node-pulse-jump {
    0%, 100% {
        box-shadow: 0 0 10px rgba(156, 39, 176, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(156, 39, 176, 0.8);
    }
}

@keyframes node-pulse-available {
    0%, 100% {
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.7);
    }
}

/* Стили для vis-network узлов через CSS классы */
.vis-network .current-location {
    animation: node-pulse-current 2s ease-in-out infinite;
}

.vis-network .jump-point {
    animation: node-pulse-jump 2.5s ease-in-out infinite;
}

.vis-network .available-location {
    animation: node-pulse-available 2s ease-in-out infinite;
}

/* Тултипы */
.vis-tooltip {
    background: rgba(0, 0, 0, 0.9) !important;
    border: 1px solid rgba(76, 201, 240, 0.4) !important;
    border-radius: 0 !important;
    padding: 10px 14px !important;
    font-family: 'Noto Sans', sans-serif !important;
    font-size: 13px !important;
    color: #e0e0e0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

/* Адаптив для мобильных */
@media (max-width: 480px) {
    .new-map-header {
        padding: 8px 12px;
    }
    
    .world-tabs {
        order: 1;
        width: 100%;
    }
    
    .new-map-controls {
        order: 2;
        width: 100%;
        justify-content: center;
    }
    
    .new-map-legend {
        bottom: 140px;
        left: 8px;
        right: 8px;
        min-width: auto;
    }
    
    .new-map-info-panel {
        bottom: 140px;
        left: 8px;
        right: 8px;
        min-width: auto;
        max-width: none;
    }
    
    .new-map-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 12px;
    }
    
    .new-map-close-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Скроллбар для вкладок */
.world-tabs::-webkit-scrollbar {
    height: 4px;
}

.world-tabs::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.world-tabs::-webkit-scrollbar-thumb {
    background: rgba(76, 201, 240, 0.4);
}

.world-tabs::-webkit-scrollbar-thumb:hover {
    background: rgba(76, 201, 240, 0.6);
}

/* Фильтры */
.new-map-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.new-map-filter {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #aaa;
    cursor: pointer;
    user-select: none;
}

.new-map-filter input[type="checkbox"] {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    position: relative;
}

.new-map-filter input[type="checkbox"]:checked {
    background: rgba(76, 201, 240, 0.4);
    border-color: #4cc9f0;
}

.new-map-filter input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 10px;
}
