/* dashboard_server/static/css/style.css */
/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #1a1a1a;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Навигация */
.navbar {
    background: #2a2a2a;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 {
    font-size: 1.5rem;
    color: #4a9eff;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    font-size: 1.2rem;
}

.status-indicator.online {
    color: #4caf50;
}

.status-indicator.offline {
    color: #f44336;
}

/* Кнопка выхода */
.btn-logout {
    margin-left: 20px;
    background: #666;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #555;
}

/* Основной контент */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h2 {
    font-size: 1.8rem;
    color: #fff;
}

/* Кнопки */
.btn-refresh {
    background: #4a9eff;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-refresh:hover {
    background: #357abd;
}

/* Сетка метрик */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 3rem;
}

.metric-card {
    background: #2a2a2a;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.metric-card h3 {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.metric-value {
    font-size: 2rem;
    font-weight: bold;
    color: #4a9eff;
}

.metric-unit {
    font-size: 1.2rem;
    color: #666;
    margin-left: 0.2rem;
}

/* Секции */
.section {
    margin-bottom: 3rem;
}

.section h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #fff;
}

/* Таблица данных */
.data-table {
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #333;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.data-table td {
    padding: 1rem;
    border-top: 1px solid #333;
}

.data-table tr:hover {
    background: #333;
}

/* Статусы */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.status-badge.failed {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.status-badge.pending {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

/* Направления */
.direction-up {
    color: #4caf50;
}

.direction-down {
    color: #f44336;
}

/* Загрузка */
.loading {
    text-align: center;
    padding: 3rem;
    color: #666;
}

/* Футер */
.footer {
    background: #2a2a2a;
    padding: 1rem 0;
    text-align: center;
    color: #666;
    margin-top: auto;
}

/* Адаптивность */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .data-table {
        overflow-x: auto;
    }
    
    .data-table table {
        min-width: 600px;
    }
    
    /* Адаптивность навбара */
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav-status {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-logout {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
}