/* =============================================
   Страница мониторинга сервера — bcm-*
   Визуальный стиль соответствует votes-top,
   но все классы уникальные (не переиспользуют swilly-*)
   ============================================= */

/* ---------- Обёртка страницы ---------- */
.bcm-page {
    width: 100%;
}

/* ---------- Заголовок ---------- */
.bcm-header {
    background: hsla(240, 7%, 12%, 0.90);
    box-shadow: 0px -1px 4px rgb(200 196 196 / 8%), 0px 4px 4px rgb(200 196 196 / 25%);
    border-radius: 7px;
    padding: 10px;
    font-weight: bold;
    font-size: 24px;
    line-height: 30px;
    color: #5ab9ea;
    text-align: center;
    margin-bottom: 20px;
}

/* ---------- Строка статуса ---------- */
.bcm-status-bar {
    background: hsla(240, 7%, 12%, 0.90);
    box-shadow: 0px -1px 4px rgb(200 196 196 / 8%), 0px 4px 4px rgb(200 196 196 / 25%);
    border-radius: 7px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.bcm-status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #555;
    flex-shrink: 0;
}

.bcm-status-dot--online {
    background: #9AD31F;
    animation: bcm-pulse 2s infinite;
}

.bcm-status-dot--offline {
    background: #EF5350;
}

@keyframes bcm-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

.bcm-status-text {
    font-weight: bold;
    font-size: 15px;
    color: #d5dfea;
}

/* ---------- Сетка карточек ---------- */
.bcm-cards {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

/* ---------- Карточка метрики ---------- */
.bcm-card {
    background: hsla(240, 7%, 12%, 0.90);
    box-shadow: 0px -1px 4px rgb(200 196 196 / 8%), 0px 4px 4px rgb(200 196 196 / 25%);
    border-radius: 7px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(25% - 10px);
    min-width: 170px;
    flex: 0 0 calc(25% - 10px);
}

.bcm-card-icon {
    font-size: 1.6em;
    color: #7395ae;
    margin-bottom: 10px;
}

.bcm-card-value {
    font-weight: 700;
    font-size: 2em;
    color: #55b2fd;
    font-variant-numeric: tabular-nums;
    min-height: 1.25em;
    transition: color 0.4s ease;
    text-align: center;
}

.bcm-card-value--uptime {
    font-size: 1.5em;
}

.bcm-card-line {
    height: 1px;
    width: 60%;
    background: #3a3a50;
    margin: 10px 0;
}

.bcm-card-label {
    font-weight: bold;
    font-size: 13px;
    color: #7395ae;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---------- Прогресс-бар ---------- */
.bcm-bar {
    width: 80%;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.bcm-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background-color: #9AD31F;
    transition: width 0.6s ease, background-color 0.6s ease;
}

/* ---------- Подпись ---------- */
.bcm-footer {
    background: hsla(240, 7%, 12%, 0.90);
    box-shadow: 0px -1px 4px rgb(200 196 196 / 8%), 0px 4px 4px rgb(200 196 196 / 25%);
    border-radius: 7px;
    padding: 8px 15px;
    font-size: 13px;
    color: #7395ae;
    text-align: center;
}

.bcm-footer-time {
    display: inline-block;
    min-width: 72px;
    font-variant-numeric: tabular-nums;
    color: #5ab9ea;
    font-weight: bold;
    text-align: left;
}

/* ---------- График истории ---------- */
.bcm-chart-title {
    margin-top: 25px;
    font-size: 20px;
}

.bcm-chart-wrap {
    position: relative;
    background: hsla(240, 7%, 12%, 0.90);
    box-shadow: 0px -1px 4px rgb(200 196 196 / 8%), 0px 4px 4px rgb(200 196 196 / 25%);
    border-radius: 7px;
    padding: 20px;
    height: 280px;
    margin-bottom: 10px;
}

.bcm-chart-empty {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    color: #7395ae;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* показываем flex когда display:block выставлен через JS */
.bcm-chart-empty[style*="block"] {
    display: flex !important;
}

.bcm-chart-legend {
    display: flex;
    align-items: center;
    gap: 18px;
    justify-content: center;
    background: hsla(240, 7%, 12%, 0.90);
    border-radius: 7px;
    padding: 8px 15px;
    margin-bottom: 5px;
}

.bcm-legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bcm-legend-label {
    font-size: 13px;
    color: #d5dfea;
}

/* ---------- Кнопки периода графика ---------- */
.bcm-chart-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.bcm-ctrl-label {
    color: #7395ae;
    font-size: 12px;
    margin-right: 2px;
}

.bcm-chart-btn {
    padding: 4px 14px;
    border-radius: 5px;
    border: 1px solid rgba(90, 185, 234, 0.25);
    background: rgba(90, 185, 234, 0.07);
    color: #7395ae;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1.6;
}

.bcm-chart-btn:hover {
    background: rgba(90, 185, 234, 0.15);
    color: #5ab9ea;
    border-color: rgba(90, 185, 234, 0.55);
}

.bcm-chart-btn.active {
    background: rgba(90, 185, 234, 0.18);
    color: #5ab9ea;
    border-color: #5ab9ea;
}

.bcm-ctrl-hint {
    margin-left: auto;
    color: #7395ae;
    font-size: 11px;
    opacity: 0.6;
}

/* ---------- Адаптив ---------- */
@media screen and (max-width: 800px) {
    .bcm-card {
        width: calc(50% - 10px);
        flex: 0 0 calc(50% - 10px);
    }
    .bcm-chart-wrap { height: 220px; }
}

@media screen and (max-width: 440px) {
    .bcm-card {
        width: 100%;
        flex: 0 0 100%;
    }
    .bcm-header { font-size: 20px; }
    .bcm-chart-wrap { height: 180px; }
    .bcm-chart-legend { flex-wrap: wrap; gap: 10px; }
}
