/* Monitor do Servidor - Estilos CSS */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Cabeçalho */
.cabecalho {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.conteudo-cabecalho h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.info-servidor {
    font-size: 0.9rem;
    color: #666;
}

.separador {
    margin: 0 0.5rem;
}

.indicador-status .badge-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.badge-status.status-ok {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.badge-status.status-aviso {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ff9800;
}

.badge-status.status-critico {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

.badge-status.status-carregando {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.ponto-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Visão Geral */
.visao-geral {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.cards-metricas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.card-metrica {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.card-metrica:hover {
    transform: translateY(-2px);
}

.icone-metrica {
    font-size: 2.5rem;
    opacity: 0.8;
}

.conteudo-metrica {
    flex: 1;
}

.valor-metrica {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.label-metrica {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.barra-metrica {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.preenchimento-metrica {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.preenchimento-metrica.aviso {
    background: linear-gradient(90deg, #ff9800, #ffc107);
}

.preenchimento-metrica.critico {
    background: linear-gradient(90deg, #f44336, #e57373);
}

/* Conteúdo Principal */
.conteudo-principal {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Painéis */
.painel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.painel h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

/* Tabelas */
.container-tabela {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

table th,
table td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

table tr:hover {
    background: #f8f9fa;
}

/* Grade de Memória */
.grade-memoria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.card-memoria {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
}

.card-memoria h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.detalhes-memoria {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-memoria {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.progresso-memoria {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.barra-progresso {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.preenchimento-progresso {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.preenchimento-progresso.aviso {
    background: linear-gradient(90deg, #ff9800, #ffc107);
}

.preenchimento-progresso.critico {
    background: linear-gradient(90deg, #f44336, #e57373);
}

/* Grade de CPU */
.grade-cpu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.card-cpu {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
}

.card-cpu h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.detalhes-cpu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-cpu {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

/* Alertas */
.alertas {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.alertas h2 {
    color: white;
    margin-bottom: 1rem;
}

.alerta {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alerta.critico {
    border-color: #f44336;
    background: #ffebee;
}

.alerta.aviso {
    border-color: #ff9800;
    background: #fff3e0;
}

.icone-alerta {
    font-size: 1.5rem;
}

.conteudo-alerta {
    flex: 1;
}

.mensagem-alerta {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.tempo-alerta {
    font-size: 0.8rem;
    color: #666;
}

/* Indicadores de Status */
.status-bom {
    color: #4caf50;
    font-weight: 600;
}

.status-aviso {
    color: #ff9800;
    font-weight: 600;
}

.status-critico {
    color: #f44336;
    font-weight: 600;
}

/* Rodapé */
.rodape {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.conexao-ok {
    color: #4caf50;
}

.conexao-erro {
    color: #f44336;
}

/* Design Responsivo */
@media (max-width: 768px) {
    .cabecalho {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .rodape {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .conteudo-principal {
        padding: 1rem;
    }
    
    .visao-geral {
        padding: 1rem;
    }
    
    .cards-metricas {
        grid-template-columns: 1fr;
    }
    
    .grade-memoria,
    .grade-cpu {
        grid-template-columns: 1fr;
    }
}

/* Animação de Carregamento */
.carregando {
    opacity: 0.6;
    pointer-events: none;
}

.carregando::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Estilo da Barra de Rolagem */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}