/* ==========================================================================
   NOC - MONITOR CENTRAL DE STATUS (NOC.CSS COMPLETO)
   ========================================================================== */

/* ──────────────────────────────────────────────────────────
   1. CONFIGURAÇÕES BASE E FUNDO ANIMADO
   ────────────────────────────────────────────────────────── */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    color: #f4f4f4; 
    margin: 0; 
    padding: 20px; 
    min-height: 100vh;
}

.bg-slideshow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background-size: cover;
    background-position: center;
    animation: slideShow 21s infinite alternate; 
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

@keyframes slideShow {
    0%, 25% { background-image: url('img/bg1.jpg'); }
    33%, 58% { background-image: url('img/bg2.jpg'); }
    66%, 91% { background-image: url('img/bg3.jpg'); }
    100% { background-image: url('img/bg1.jpg'); }
}

h1 { 
    text-align: center; 
    color: #ffffff; 
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
    margin-bottom: 30px;
}

/* ──────────────────────────────────────────────────────────
   2. BARRA DE PESQUISA E BOTÃO DE PREFERÊNCIAS
   ────────────────────────────────────────────────────────── */
.search-container {
    max-width: 1200px;
    margin: 0 auto 25px auto;
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 0 20px;
}

#searchInput {
    width: 100%;
    max-width: 600px;
    padding: 12px 25px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #fff;
    font-size: 1rem;
    outline: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

#searchInput::placeholder { color: rgba(255, 255, 255, 0.7); }

#searchInput:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: #63b8ff;
    box-shadow: 0 4px 20px rgba(99, 184, 255, 0.4);
}

#btnPreferences {
    padding: 12px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    white-space: nowrap;
}

#btnPreferences:hover {
    background: rgba(99, 184, 255, 0.4);
    border-color: #63b8ff;
    box-shadow: 0 4px 20px rgba(99, 184, 255, 0.4);
}

/* ──────────────────────────────────────────────────────────
   3. GRELHA PRINCIPAL (DASHBOARD) E CARTÕES
   ────────────────────────────────────────────────────────── */
.dashboard { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 20px; 
    max-width: 1200px; 
    margin: 0 auto; 
}

.card { 
    background: rgba(255, 255, 255, 0.15); 
    backdrop-filter: blur(5px); 
    -webkit-backdrop-filter: blur(5px); 
    padding: 20px; 
    border-radius: 12px; 
    box-shadow: 0 8px 32px rgba(0,0,0,0.4); 
    display: flex; 
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.2); 
    color: #ffffff;
    transition: opacity 0.3s ease;
}

.card h2 { 
    margin-top: 0; 
    margin-bottom: 5px; 
    font-size: 1.2rem; 
    border-bottom: 2px solid rgba(255, 255, 255, 0.2); 
    padding-bottom: 10px; 
    color: #ffffff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.badge-inactive {
    background-color: #ffc107;
    color: #000;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.meta-info { 
    font-size: 0.75rem; 
    color: #e0e0e0; 
    margin-bottom: 10px; 
    font-weight: 600; 
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* NOVO: Estilos das Tags/Categorias */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.tag-badge {
    font-size: 0.65rem;
    background: rgba(99, 184, 255, 0.15);
    color: #9cd3ff;
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid rgba(99, 184, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.official-link { font-size: 0.85rem; margin-bottom: 15px; }
.official-link a { color: #63b8ff; text-decoration: none; font-weight: bold; } 
.official-link a:hover { text-decoration: underline; color: #9cd3ff; }

/* Indicadores de Status */
.status-indicator { 
    font-weight: bold; 
    padding: 5px 10px; 
    border-radius: 4px; 
    display: inline-block; 
    margin-bottom: 15px; 
    width: fit-content; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.status-ok { background-color: rgba(212, 237, 218, 0.95); color: #155724; border: 1px solid #c3e6cb; }
.status-error { background-color: rgba(248, 215, 218, 0.95); color: #721c24; border: 1px solid #f5c6cb; }
.status-loading { background-color: rgba(226, 227, 229, 0.95); color: #383d41; border: 1px solid #d6d8db; }

/* Caixa de Log (Mensagens detalhadas) */
.log { 
    font-size: 0.9rem; 
    max-height: 200px; 
    overflow-y: auto; 
    background: rgba(0, 0, 0, 0.3); 
    padding: 10px; 
    border-radius: 6px; 
    flex-grow: 1; 
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.log-item { border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding: 8px 0; margin-bottom: 5px; }
.log-item:last-child { border-bottom: none; }

.no-results {
    text-align: center;
    width: 100%;
    color: rgba(255,255,255,0.8);
    font-size: 1.2rem;
    margin-top: 40px;
}

/* ──────────────────────────────────────────────────────────
   4. GRÁFICOS DE HISTÓRICO (BARRAS)
   ────────────────────────────────────────────────────────── */
.history-wrapper {
    margin-top: 15px; 
    margin-bottom: 0;
}
.history-title {
    font-size: 0.75rem;
    color: #e0e0e0;
    margin-bottom: 5px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.history-chart {
    display: flex;
    gap: 4px;
    height: 28px;
    background: rgba(0, 0, 0, 0.4); 
    padding: 4px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    align-items: center;
    overflow-x: auto;
}
.history-bar {
    min-width: 8px; 
    flex: 1;
    height: 100%;
    border-radius: 3px;
    transition: all 0.2s;
    cursor: help;
}
.history-bar:hover {
    transform: scaleY(1.15);
    filter: brightness(1.2);
}
.bar-up { background-color: #2ecc71 !important; }   
.bar-down { background-color: #e74c3c !important; } 
.bar-err { background-color: #95a5a6 !important; }  

/* ──────────────────────────────────────────────────────────
   5. JANELA MODAL DE PREFERÊNCIAS (COMPACTA)
   ────────────────────────────────────────────────────────── */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.modal-content {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    margin: 5% auto; 
    padding: 20px; 
    border-radius: 12px;
    width: 90%;
    max-width: 500px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    position: relative;
    animation: fadeInModal 0.3s ease;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-modal:hover { color: #fff; }

.modal-actions-quick {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}
.modal-actions-quick button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}
.modal-actions-quick button:hover { background: rgba(255, 255, 255, 0.25); }

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 8px; 
    max-height: 50vh; 
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85rem; 
}

.checkbox-item input {
    cursor: pointer;
    width: 14px; 
    height: 14px;
}

.modal-footer {
    margin-top: 20px;
    text-align: right;
}
.btn-save {
    background: #28a745;
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
    transition: background 0.2s;
}
.btn-save:hover { background: #218838; }

/* ──────────────────────────────────────────────────────────
   6. INFORMAÇÕES DO SISTEMA (NOTA E VERSÃO)
   ────────────────────────────────────────────────────────── */
.system-info {
    text-align: center;
    margin-top: -15px; 
    margin-bottom: 25px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65); 
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.sys-version {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
    font-weight: bold;
    letter-spacing: 0.5px;
}
