/* Мониторинг серверов - Новый дизайн */

/* Заголовок с кнопкой обновления */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.refresh-all-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.refresh-all-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.refresh-all-btn:active:not(:disabled) {
    transform: translateY(0);
}

.refresh-all-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.refresh-all-btn i {
    font-size: 14px;
}

/* Контейнер серверов */
.servers-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* Блок сервера */
.server-block {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.server-block:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Заголовок сервера */
.server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.server-info h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.server-host {
    font-size: 13px;
    color: #888;
    margin-top: 5px;
}

/* Статус сервера */
.server-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.status-indicator.online {
    background: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.status-indicator.offline {
    background: #dc3545;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.5);
}

.status-indicator.loading {
    background: #ffc107;
    animation: spin 1s linear infinite;
}

.status-text {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

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

/* Кнопки управления Docker */
.docker-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

.docker-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.docker-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.docker-btn:active {
    transform: translateY(0);
}

.start-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.stop-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.restart-btn {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #333;
}

.docker-btn:disabled,
.docker-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

.docker-btn:disabled:hover,
.docker-btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Круговые диаграммы */
.metrics-circles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.metric-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.metric-circle canvas {
    display: block;
}

.metric-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.metric-details {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    font-weight: 500;
}

/* Секция графиков */
.charts-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #f0f0f0;
}

.charts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.charts-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.period-selector {
    display: flex;
    gap: 8px;
}

.period-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.period-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.period-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Статус балансера */
.load-balancer-card {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

.load-balancer-card.online {
    border-left: 5px solid #28a745;
}

.load-balancer-card.offline {
    border-left: 5px solid #dc3545;
}

.load-balancer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.load-balancer-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.online {
    background: #d4edda;
    color: #155724;
}

.status-badge.offline {
    background: #f8d7da;
    color: #721c24;
}

.load-balancer-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.load-balancer-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.load-balancer-info strong {
    color: #333;
}

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

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ошибка */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #dc3545;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .servers-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .metrics-circles {
        grid-template-columns: 1fr;
    }
    
    .docker-controls {
        flex-direction: column;
    }
    
    .charts-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .period-selector {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .period-btn {
        flex: 1;
        min-width: calc(50% - 4px);
    }
    
    .load-balancer-info {
        grid-template-columns: 1fr;
    }
}

/* Cron секция */
.cron-section {
    margin-top: 25px;
    padding: 20px;
    background: #1e1e2e;
    border-radius: 12px;
    border: 1px solid #2d2d44;
}

.cron-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cron-header h4 {
    margin: 0;
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-cron-btn {
    background: transparent;
    border: 1px solid #3d3d5c;
    color: #a0a0c0;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.refresh-cron-btn:hover {
    background: #2d2d44;
    border-color: #4d4d6c;
    color: #e0e0e0;
}

.refresh-cron-btn i {
    font-size: 12px;
}

.cron-status {
    min-height: 50px;
}

.cron-status .loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #a0a0c0;
    font-size: 14px;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #3d3d5c;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.cron-status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.cron-status-item.success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4caf50;
}

.cron-status-item.warning {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #ff9800;
}

.cron-status-item.error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #f44336;
}

.cron-status-item i {
    font-size: 16px;
}

.cron-tasks-list {
    margin-top: 15px;
}

.cron-task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
    background: #252535;
    border: 1px solid #2d2d44;
}

.cron-task-item.success {
    border-left: 3px solid #4caf50;
}

.cron-task-item.error {
    border-left: 3px solid #f44336;
}

.cron-task-item .task-name {
    flex: 1;
    color: #e0e0e0;
    font-weight: 500;
}

.cron-task-item .task-schedule {
    color: #a0a0c0;
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

.cron-task-item i {
    font-size: 14px;
}

.cron-task-item.success i {
    color: #4caf50;
}

.cron-task-item.error i {
    color: #f44336;
}
