/* ============================================
   SS14 Dashboard - Стили в стиле Grafana
   Цветовая палитра:
   - Фон: #111111
   - Текст/Подписи/Заголовок: #d21e1e
   - Кнопка/Ссылка: #f05a5a
   - Ховер: #ffffff
   ============================================ */

/* Основной контейнер */
.ss14-grafana-dashboard {
    background: #111111;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    color: #d21e1e;
    line-height: 1.5;
}

/* Заголовок */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #1a1a1a;
    flex-wrap: wrap;
    gap: 15px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dashboard-header h2 {
    margin: 0;
    color: #d21e1e;
    font-size: 24px;
    font-weight: 600;
}

/* Статус сервера */
.server-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: #1a1a1a;
    border-radius: 20px;
    font-size: 13px;
    color: #d21e1e;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff !important;
}

.server-status.status-online .status-dot {
    background: #ffffff !important;
    animation: none;
}

.server-status.status-offline .status-dot {
    background: #e02f44 !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Сетка карточек */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

/* Карточки */
.stat-card, .wide-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #222222;
    border-bottom: 1px solid #2a2a2a;
}

.card-icon {
    font-size: 18px;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: #d21e1e;
    text-transform: uppercase;
}

.card-content {
    padding: 15px;
}

.main-value {
    font-size: 32px;
    font-weight: 700;
    color: #d21e1e;
    margin-bottom: 15px;
}

.sub-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sub-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #222222;
    border-radius: 4px;
}

.sub-label {
    font-size: 13px;
    color: #d21e1e;
}

.sub-value {
    font-size: 14px;
    font-weight: 600;
    color: #d21e1e;
}

#preset-desc {
    font-size: 12px;
    font-weight: 400;
    color: #d21e1e;
    text-align: left;
    max-width: 200px;
}

/* Статусы раунда */
.status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: #2a2a2a;
    color: #d21e1e;
}

.status-badge.round-waiting { 
    background: rgba(245, 166, 35, 0.2); 
    color: #f5a623; 
}

.status-badge.round-active { 
    background: #1a1a1a; 
    color: #ffffff; 
}

.status-badge.round-ended { 
    background: #d21e1e; 
    color: #f05a5a;
    animation: round-ended-pulse 2s infinite;
}

@keyframes round-ended-pulse {
    0%, 100% { 
        opacity: 1;
    }
    50% { 
        opacity: 0.7;
    }
}

/* Фильтры графика */
.graph-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    background: #f05a5a;
    border: 1px solid #d21e1e;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #ffffff;
    color: #111111;
    border-color: #ffffff;
}

.filter-btn.active {
    background: #ffffff;
    border-color: #ffffff;
    color: #111111;
    font-weight: 600;
}

/* Нижняя строка с графиком */
.bottom-row {
    margin-top: 15px;
}

.wide-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    overflow: hidden;
}

.wide-card .card-header {
    background: #222222;
}

.card-body {
    padding: 15px;
    height: 250px;
}

.card-body canvas {
    width: 100% !important;
    height: 230px !important;
}

/* Карточка карты */
.map-name {
    font-size: 22px !important;
    color: #d21e1e !important;
}

/* Карточка инфо */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: #222222;
    border-radius: 4px;
}

.info-label {
    font-size: 13px;
    color: #d21e1e;
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: #f05a5a;
}

/* Пульсация для таймера когда осталось меньше часа */
.info-value.urgent-pulse {
    animation: urgent-pulse-animation 1s infinite;
    color: #ffffff !important;
}

@keyframes urgent-pulse-animation {
    0%, 100% { 
        opacity: 1;
        color: #ffffff;
    }
    50% { 
        opacity: 0.5;
        color: #ff6b6b;
    }
}

/* Простая карточка metrics */
.ss14-metrics-container {
    background: #111111;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    max-width: 400px;
    font-family: 'Segoe UI', sans-serif;
    color: #d21e1e;
}

.ss14-metrics-container .ss14-server-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 14px;
    background: #1a1a1a;
    color: #d21e1e;
}

.ss14-metrics-container .ss14-server-status.status-online {
    background: #1a1a1a;
    color: #ffffff;
}

.ss14-metrics-container .ss14-server-status.status-online .status-indicator {
    background: #ffffff !important;
}

.ss14-metrics-container .ss14-server-status.status-offline {
    background: rgba(224, 47, 68, 0.2);
    color: #e02f44;
}

.ss14-metrics-container .ss14-server-status.status-offline .status-indicator {
    background: #e02f44 !important;
    animation: pulse 2s infinite;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

.ss14-metrics-container .ss14-metric {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #2a2a2a;
}

.ss14-metrics-container .ss14-metric:last-child {
    border-bottom: none;
}

.ss14-metrics-container .ss14-metric .metric-label {
    color: #d21e1e;
    font-size: 14px;
}

.ss14-metrics-container .ss14-metric .metric-value {
    color: #f05a5a;
    font-weight: 600;
    font-size: 16px;
}

.ss14-metrics-container .ss14-metrics-error {
    color: #e02f44;
    background: rgba(224, 47, 68, 0.1);
    padding: 10px 15px;
    border-radius: 5px;
    border-left: 3px solid #e02f44;
}

.ss14-players-count {
    background: #f05a5a;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 18px;
    display: inline-block;
}

.ss14-players-error {
    color: #e02f44;
    background: rgba(224, 47, 68, 0.1);
    padding: 10px 15px;
    border-radius: 5px;
    border-left: 3px solid #e02f44;
}

/* Адаптивность */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .graph-filters {
        width: 100%;
    }
}

/* Gutenberg блок - предпросмотр */
.ss14-block-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: #f0f0f1;
    border: 2px dashed #ccc;
    border-radius: 4px;
    font-size: 14px;
    color: #3c434a;
}

.ss14-block-preview .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #2271b1;
}
