/* --- НАСТРОЙКИ ЦВЕТОВ --- */
:root {
    --neon-blue: #00f3ff;
    --deep-bg: #020b14;
    --glass-bg: rgba(0, 243, 255, 0.001);
    --glass-border: rgba(0, 243, 255, 0.3);
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--deep-bg);
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-blue);
}

/* Фон (Canvas 2D) */
#bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Основной контейнер интерфейса */
#app-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
    box-sizing: border-box;
    pointer-events: none;
}

/* Заголовок */
header {
    text-align: center;
    margin-bottom: 10px;
}

h1 {
    font-size: clamp(1.5rem, 4vw, 3.5rem);
    margin: 0;
    text-shadow: 0 0 25px rgba(0, 243, 255, 0.6);
    letter-spacing: 4px;
    font-weight: 900;
    pointer-events: auto;
}

.status-text {
    font-size: clamp(0.7rem, 1vw, 1rem);
    opacity: 0.8;
    letter-spacing: 2px;
    margin-top: 5px;
}

/* --- ОБЩАЯ СЕТКА (DASHBOARD) --- */
.dashboard {
    display: flex;
    width: 100%;
    max-width: 1400px;
    height: 60vh;
    gap: 20px;
    pointer-events: none;
}

/* Общий стиль для стеклянных панелей */
.glass-panel {
    pointer-events: auto;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.05), inset 0 0 30px rgba(0, 243, 255, 0.02);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
}

.glass-panel:hover {
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.15), inset 0 0 30px rgba(0, 243, 255, 0.1);
    border-color: rgba(0, 243, 255, 0.6);
}

/* ЛЕВАЯ ПАНЕЛЬ (КАРТА) */
.map-section {
    flex: 2;
    position: relative;
    overflow: hidden;
}

/* Верхний блок с локацией и меню */
.map-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 20px;
    z-index: 5;
    pointer-events: none;
}

.location-info {
    pointer-events: auto;
    text-align: left;
}

.location-label {
    font-size: 0.65rem;
    opacity: 0.6;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.location-value {
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.provider-value {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 2px;
}

/* Меню выбора сервера */
.server-menu {
    position: relative;
    pointer-events: auto;
}

.menu-btn {
    background: transparent;
    border: none;
    color: var(--neon-blue);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: normal;
    letter-spacing: 1px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.menu-btn:hover {
    text-shadow: 0 0 10px var(--neon-blue);
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: rgba(2, 11, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.server-menu:hover .menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item {
    padding: 12px 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: rgba(0, 243, 255, 0.1);
    padding-left: 20px;
}

.menu-item.active {
    color: var(--neon-blue);
    font-weight: bold;
    background: rgba(0, 243, 255, 0.05);
}

#map-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

#map-container svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 5px rgba(0, 243, 255, 0.3));
    pointer-events: none;
}

#anim-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.map-section path {
    fill: rgba(0, 243, 255, 0.01) !important;
    stroke: var(--neon-blue) !important;
    stroke-width: 0.8px !important;
}

/* Контейнер для центрирования кнопки внизу */
.button-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 30px; /* Отступ снизу */
    box-sizing: border-box;
    z-index: 10;
    pointer-events: none;
}

/* ПРАВАЯ ПАНЕЛЬ (СТАТИСТИКА) */
.stats-section {
    flex: 1;
    gap: 15px;
    min-width: 300px;
}

/* Блоки внутри статистики */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.7;
}

.stat-value-small {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Графики */
.chart-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 243, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
}

.chart-title {
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: #fff;
    display: flex;
    justify-content: space-between;
}

.chart-value-big {
    font-size: 2rem;
    font-weight: 900;
    text-shadow: 0 0 10px var(--neon-blue);
}

.unit {
    font-size: 0.8rem;
    opacity: 0.6;
    font-weight: normal;
}

canvas.stat-canvas {
    width: 100%;
    height: 60px;
    margin-top: auto;
}


/* --- НОВАЯ КНОПКА (Glow Button) --- */

.glow-container {
    position: relative;
    width: max-content;
    /* Убрали margin: 100px auto, так как позиционируем через flex */
    pointer-events: auto;
    --anim-duration: 8s; /* Чуть ускорил для динамики */
    
    --mask-angle-start: 0deg;
    --mask-angle-range: 360deg;
}

/* Обёртки градиентов */
.gradient-and-mask-wrapper {
  position: absolute;
  inset: -1px;
  border-radius: 100px;
  overflow: hidden;
  opacity: 1;
  pointer-events: none;

  /* 1. Задаем толщину видимой линии (рамки) */
  padding: 2px; 

  /* 2. Создаем маску: вырезаем внутреннюю часть (content-box) из общей площади */
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  
}

.outer-glow {
    filter: blur(4px); 
    opacity: 0.6;
}

/* Внутренние маски (кольца) */
.mask {
    position: absolute;
    inset: 0;
    transform-origin: center;
    translate: 0 -50%;
    top: 50%;
    aspect-ratio: 1/1;
    scale: 1.05 0.5; /* Сплющивание для эффекта перспективы */
    border-radius: 50%;
}

.mask::before {
    content: "";
    position: absolute;
    inset: 0;
    transform-origin: center;
    /* Градиент адаптирован под Neon Blue */
    background: conic-gradient(
        transparent 0deg,
        transparent 100deg,
        rgba(0, 243, 255, 0.2) 130deg,    /* слабый хвост */
        rgba(0, 243, 255, 1.0) 180deg,    /* яркий центр */
        rgba(0, 243, 255, 0.2) 230deg,    /* слабый нос */
        transparent 260deg,
        transparent 360deg
    );
    animation: maskSpin var(--anim-duration) linear infinite;
}

/* Сама кнопка */
.compose-container {
    position: relative;
    padding: 12px 35px; /* Чуть шире */
    background: transparent; /* Цвет фона приложения */
    border: 1px ;
    border-radius: 24px;
    font-family: 'Orbitron';
    font-size: 1rem;
    color: var(--neon-blue);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 10;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: text-shadow 0.3s ease, background 0.3s ease;
}

.compose-container:hover {
    text-shadow: 0 0 15px var(--neon-blue);
    
    /* Исправление:
       Мы используем множественные фоны.
       1. Слой оттенка (полупрозрачный голубой).
       2. Слой основного цвета (var(--deep-bg)), чтобы перекрыть анимацию снизу.
    */
    background:   transparent;
        
    /* Важно: background-clip: padding-box, чтобы фон не лез под границы, если они есть */
    background-clip: padding-box; 
}

/* Анимация вращения */
@keyframes maskSpin {
    from { rotate: var(--mask-angle-start); }
    to   { rotate: calc(var(--mask-angle-start) + var(--mask-angle-range)); }
}

/* АДАПТИВНОСТЬ */
@media (max-width: 900px) {
    .dashboard {
        flex-direction: column;
        height: auto;
    }

    .map-section {
        height: 40vh;
        min-height: 300px;
        display: block !important;
    }

    .stats-section {
        height: auto;
    }

    #app-content {
        overflow-y: auto;
        justify-content: flex-start;
    }

    .button-wrapper {
        display: flex !important;
        position: absolute !important;
        padding-bottom: 20px;
    }
}

@media (max-width: 500px) {
    h1 {
        font-size: 1.8rem;
    }

    .map-section {
        min-height: 250px;
    }
    
    .compose-container {
        font-size: 0.9rem;
        padding: 10px 25px;
    }
}