﻿:root {
    /* Modern Color Palette */
    --bgMain: #f8f9fa; /* Lighter background for better contrast */
    --fcBase: #343a40; /* Darker font for better readability */
    --primaryColor: #1a73e8; /* Modern blue from Google's design system */
    --secondaryColor: #ff5722; /* Vibrant orange for accents */
    --bgMenuActive: var(--primaryColor); /* Use primary color for active menu */
    --bcMenuActive: var(--secondaryColor); /* Orange border for active menu item */
    --bgButton: var(--primaryColor); /* Consistent button styling */
    --logoImageUrl: url('https://api.menphis.net.br/assets/img/MenphisLogo.png') !important;
    --bgAside: #1a73e8; /* Darker sidebar for contrast */
    --bgTable: #ffffff; /* White table background */
    --bgTableSecondary: #f1f3f5; /* Light gray for alternating rows */
    /* Additional Modern Variables */
    --borderRadius: 8px; /* Rounded corners */
    --boxShadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    --transition: all 0.3s ease; /* Smooth transitions */
    --spacing: 16px; /* Consistent spacing */
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--fcBase);
    background-color: var(--bgMain);
    line-height: 1.5;
}

/* Buttons */
button, .btn {
    background-color: transparent;
    color: white;
    border: none;
    border-radius: var(--borderRadius);
    padding: 8px 16px;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--boxShadow);
}

    button:hover, .btn:hover {
        opacity: 0.9;
        transform: translateY(-2px);
    }

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: var(--spacing) 0;
    border-radius: var(--borderRadius);
    overflow: hidden;
    box-shadow: var(--boxShadow);
}

th {
    background-color: var(--primaryColor);
    color: #ff6633; /* Changed to the specified orange color */
    font-weight: 600;
    text-align: left;
    padding: 12px var(--spacing);
}

td {
    padding: 12px var(--spacing);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

tr:nth-child(even) {
    background-color: var(--bgTableSecondary);
}

tr:hover {
    background-color: rgba(26, 115, 232, 0.05);
}

/* Tag Styling */
.tag {
    background-color: #38b2ac !important; /* Teal color */
    color: white;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
    margin-right: 8px;
}

/* Counter styling */
.hc-checks-table {
    counter-reset: rowNumber -1;
}

    .hc-checks-table tr {
        counter-increment: rowNumber;
    }

        .hc-checks-table tr td:first-child::before {
            content: counter(rowNumber);
            min-width: 1.5em;
            margin-right: 0.75em;
            font-weight: 600;
            color: var(--primaryColor);
        }

/* Navigation */
nav, aside {
    background-color: var(--bgAside);
    color: white;
}

a {
    color: var(--primaryColor);
    text-decoration: none;
    transition: var(--transition);
}

    a:hover {
        color: var(--secondaryColor);
    }

/* Menu items */
.menu-item, .nav-link {
    padding: 12px var(--spacing);
    border-radius: var(--borderRadius);
    margin-bottom: 8px;
    transition: var(--transition);
}

    .menu-item.active, .nav-link.active {
        background-color: var(--bgMenuActive);
        border-left: 4px solid var(--bcMenuActive);
        color: white;
    }

/* Cards */
.card {
    background-color: white;
    border-radius: var(--borderRadius);
    box-shadow: var(--boxShadow);
    padding: var(--spacing);
    margin-bottom: var(--spacing);
    transition: var(--transition);
}

    .card:hover {
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    }

/* System Link */
a[href="#/healthchecks"] span {
    display: none;
}

a[href="#/healthchecks"]::after {
    content: "Sistema";
    font-weight: 500;
}




/* Estilo moderno e sofisticado para hc-status */
.hc-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

    /* Efeito de brilho em hover */
    .hc-status:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .hc-status:after {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient( to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100% );
        transform: rotate(30deg);
        transition: transform 0.7s;
        opacity: 0;
    }

    .hc-status:hover:after {
        transform: rotate(30deg) translate(100%, 100%);
        opacity: 1;
    }

/* Status específicos com design refinado */
.hc-status-healthy {
    background: linear-gradient(135deg, #00c853, #4caf50);
    color: white;
    border-left: 3px solid #388e3c;
}

.hc-status-degraded {
    background: linear-gradient(135deg, #ffa726, #ff9800);
    color: white;
    border-left: 3px solid #ef6c00;
}

.hc-status-unhealthy {
    background: linear-gradient(135deg, #ef5350, #f44336);
    color: white;
    border-left: 3px solid #d32f2f;
}

    /* Ícones para cada status */
    .hc-status-healthy:before,
    .hc-status-degraded:before,
    .hc-status-unhealthy:before {
        content: '';
        display: inline-block;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        margin-right: 8px;
    }

.hc-status-healthy:before {
    background-color: white;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.hc-status-degraded:before {
    background-color: white;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.hc-status-unhealthy:before {
    background-color: white;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Status em tabelas */
.hc-checks-table .hc-status {
    font-size: 0.8rem;
    padding: 4px 10px;
}

/* Animação para status alternativos (pode ser usado para indicar carregamento ou transição) */
@keyframes pulse {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.7;
    }
}

.hc-status-loading {
    background: linear-gradient(135deg, #42a5f5, #2196f3);
    color: white;
    border-left: 3px solid #1976d2;
    animation: pulse 1.5s infinite ease-in-out;
}

/* Display em modo dark */
@media (prefers-color-scheme: dark) {
    .hc-status {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

        .hc-status:hover {
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
        }
}


/* Estilo Ultra Moderno para hc-status - Versão Apenas CSS */

/* Estilo base para todos os status */
.hc-status {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    margin: 8px 0;
    text-transform: uppercase;
    min-width: 120px;
    /* Define o fundo padrão para ser sobrescrito */
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.85), rgba(32, 161, 98, 0.9));
    color: white;
    border-left: 3px solid #20A162;
}

    /* Resetando estilos inline do ícone */
    .hc-status .material-icons {
        padding-right: 0.5rem;
        font-size: 1.2rem;
        color: white !important; /* Sobrescreve cor inline */
    }

    /* Efeito hover sofisticado */
    .hc-status:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
    }

    /* Efeito de brilho com glassmorphism */
    .hc-status::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 40%;
        background: linear-gradient( to bottom, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05) );
        z-index: 0;
        border-radius: 12px 12px 24px 24px;
    }

    /* Posicionamento do conteúdo acima do efeito de brilho */
    .hc-status .material-icons,
    .hc-status span {
        position: relative;
        z-index: 1;
    }

    /* Status específicos baseados no conteúdo - CSS puro */

    /* Healthy - Verde (padrão) */
    /* Já definido no estilo base acima */

    /* Degraded - Amarelo/Laranja - Baseado em conteúdo */
    .hc-status:has(.material-icons[style*="warning"]),
    .hc-status:has(.material-icons:contains("warning")),
    .hc-status:-webkit-any(:contains("Degraded"), :contains("degraded")) {
        background: linear-gradient(135deg, rgba(255, 159, 67, 0.85), rgba(224, 130, 30, 0.9)) !important;
        color: white !important;
        border-left: 3px solid #E0821E !important;
    }

    /* Unhealthy - Vermelho - Baseado em conteúdo */
    .hc-status:has(.material-icons[style*="error"]),
    .hc-status:has(.material-icons:contains("error")),
    .hc-status:-webkit-any(:contains("Unhealthy"), :contains("unhealthy")) {
        background: linear-gradient(135deg, rgba(247, 78, 78, 0.85), rgba(220, 53, 69, 0.9)) !important;
        color: white !important;
        border-left: 3px solid #DC3545 !important;
    }

    /* Método alternativo usando atributos para compatibilidade */
    .hc-status[data-status="Degraded"] {
        background: linear-gradient(135deg, rgba(255, 159, 67, 0.85), rgba(224, 130, 30, 0.9)) !important;
        color: white !important;
        border-left: 3px solid #E0821E !important;
    }

    .hc-status[data-status="Unhealthy"] {
        background: linear-gradient(135deg, rgba(247, 78, 78, 0.85), rgba(220, 53, 69, 0.9)) !important;
        color: white !important;
        border-left: 3px solid #DC3545 !important;
    }

/* Opção mais específica - sobrescreve com !important para garantir */
div.hc-status:nth-child(n):has(i.material-icons[style*="color: var(--warningColor)"]) {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.85), rgba(224, 130, 30, 0.9)) !important;
    color: white !important;
    border-left: 3px solid #E0821E !important;
}

div.hc-status:nth-child(n):has(i.material-icons[style*="color: var(--dangerColor)"]) {
    background: linear-gradient(135deg, rgba(247, 78, 78, 0.85), rgba(220, 53, 69, 0.9)) !important;
    color: white !important;
    border-left: 3px solid #DC3545 !important;
}

/* Animação de borda brilhante */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    }

    100% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    }
}

.hc-status:hover .material-icons {
    animation: glow 1.5s infinite;
}

/* Responsividade */
@media (max-width: 768px) {
    .hc-status {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

        .hc-status .material-icons {
            font-size: 1rem;
        }
}

/* Status em containers específicos */
.card .hc-status,
.table .hc-status {
    margin: 4px 0;
    font-size: 0.75rem;
    padding: 5px 10px;
}

/* CSS para cores específicas dos ícones (para casos onde o estilo inline não pode ser removido) */
.hc-status .material-icons[style*="color: var(--successColor)"] {
    color: white !important;
}

.hc-status .material-icons[style*="color: var(--warningColor)"] {
    color: white !important;
}

.hc-status .material-icons[style*="color: var(--dangerColor)"] {
    color: white !important;
}

/* Abordagem alternativa por classes específicas se precisar adicionar classes no HTML */
.hc-status.healthy {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.85), rgba(32, 161, 98, 0.9));
    color: white;
    border-left: 3px solid #20A162;
}

.hc-status.degraded {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.85), rgba(224, 130, 30, 0.9));
    color: white;
    border-left: 3px solid #E0821E;
}

.hc-status.unhealthy {
    background: linear-gradient(135deg, rgba(247, 78, 78, 0.85), rgba(220, 53, 69, 0.9));
    color: white;
    border-left: 3px solid #DC3545;
}

/* CSS Moderno Completo - Sem alterações de HTML necessárias */

/* ===== ESTILO PARA hc-status ===== */
.hc-status {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    margin: 8px 0;
    text-transform: uppercase;
    min-width: 120px;
    /* Definição padrão para Healthy */
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.85), rgba(32, 161, 98, 0.9));
    color: white !important;
    border-left: 3px solid #20A162;
}

    /* Efeito hover sofisticado */
    .hc-status:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
    }

    /* Efeito de brilho com glassmorphism */
    .hc-status::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 40%;
        background: linear-gradient( to bottom, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05) );
        z-index: 0;
        border-radius: 12px 12px 24px 24px;
    }

    /* Garantir que ícones e texto sejam visíveis acima do efeito de brilho */
    .hc-status i,
    .hc-status .material-icons {
        position: relative;
        z-index: 1;
        margin-right: 8px;
        color: white !important;
    }

    /* Detectar e estilizar baseado no conteúdo do ícone */
    .hc-status:has(.material-icons:contains("warning")),
    .hc-status:has(.material-icons[style*="color: var(--warningColor)"]) {
        background: linear-gradient(135deg, rgba(255, 159, 67, 0.85), rgba(224, 130, 30, 0.9)) !important;
        color: white !important;
        border-left: 3px solid #E0821E !important;
    }

    .hc-status:has(.material-icons:contains("error")),
    .hc-status:has(.material-icons[style*="color: var(--dangerColor)"]) {
        background: linear-gradient(135deg, rgba(247, 78, 78, 0.85), rgba(220, 53, 69, 0.9)) !important;
        color: white !important;
        border-left: 3px solid #DC3545 !important;
    }

    .hc-status:has(.material-icons:contains("info")),
    .hc-status:has(.material-icons[style*="color: var(--infoColor)"]) {
        background: linear-gradient(135deg, rgba(66, 165, 245, 0.85), rgba(33, 150, 243, 0.9)) !important;
        color: white !important;
        border-left: 3px solid #2196F3 !important;
    }

    /* Também detectar baseado no texto do componente */
    .hc-status:has(text():contains("Degraded")) {
        background: linear-gradient(135deg, rgba(255, 159, 67, 0.85), rgba(224, 130, 30, 0.9)) !important;
        color: white !important;
        border-left: 3px solid #E0821E !important;
    }

    .hc-status:has(text():contains("Unhealthy")) {
        background: linear-gradient(135deg, rgba(247, 78, 78, 0.85), rgba(220, 53, 69, 0.9)) !important;
        color: white !important;
        border-left: 3px solid #DC3545 !important;
    }

/* Animação de brilho para ícones */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    }

    100% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    }
}

.hc-status:hover .material-icons {
    animation: glow 1.5s infinite;
}

/* ===== ESTILO PARA ÍCONES EM CÉLULAS DE TABELA ===== */

/* Estilo base para células com ícones */
td.align-center {
    text-align: center;
    vertical-align: middle;
    position: relative;
    transition: all 0.3s ease;
    padding: 12px 16px;
}

    /* Transformação do ícone */
    td.align-center .material-icons {
        font-size: 1.25rem;
        border-radius: 50%;
        height: 36px;
        width: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        position: relative;
        z-index: 1;
        background: transparent;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        margin: 0 auto;
        padding: 0 !important; /* Importante: sobrescreve padding-right inline */
        color: white !important; /* Importante: sobrescreve cor inline */
    }

        /* Fundo do ícone */
        td.align-center .material-icons::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 50%;
            z-index: -1;
        }

        /* Efeito de brilho superior */
        td.align-center .material-icons::after {
            content: '';
            position: absolute;
            top: 0;
            left: 20%;
            right: 20%;
            height: 40%;
            background: linear-gradient( to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.1) );
            border-radius: 50% 50% 100% 100%;
            z-index: 2;
        }

        /* Efeito hover */
        td.align-center .material-icons:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
        }

/* Efeito de pulso para borda em hover */
@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4), 0 3px 10px rgba(0, 0, 0, 0.1);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(255, 255, 255, 0), 0 3px 10px rgba(0, 0, 0, 0.1);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0), 0 3px 10px rgba(0, 0, 0, 0.1);
    }
}

td.align-center .material-icons:hover {
    animation: pulse-border 1.5s infinite;
}

/* Detecção de tipo de ícone baseado no conteúdo ou estilo */

/* Success (Verde) */
td.align-center .material-icons[style*="color: var(--successColor)"],
td.align-center .material-icons:contains("check_circle") {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.95), rgba(32, 161, 98, 0.95));
}

    td.align-center .material-icons[style*="color: var(--successColor)"]::before,
    td.align-center .material-icons:contains("check_circle")::before {
        background: linear-gradient(135deg, rgba(46, 213, 115, 0.95), rgba(32, 161, 98, 0.95));
    }

/* Warning (Amarelo/Laranja) */
td.align-center .material-icons[style*="color: var(--warningColor)"],
td.align-center .material-icons:contains("warning") {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.95), rgba(224, 130, 30, 0.95));
}

    td.align-center .material-icons[style*="color: var(--warningColor)"]::before,
    td.align-center .material-icons:contains("warning")::before {
        background: linear-gradient(135deg, rgba(255, 159, 67, 0.95), rgba(224, 130, 30, 0.95));
    }

/* Error/Danger (Vermelho) */
td.align-center .material-icons[style*="color: var(--dangerColor)"],
td.align-center .material-icons:contains("error") {
    background: linear-gradient(135deg, rgba(247, 78, 78, 0.95), rgba(220, 53, 69, 0.95));
}

    td.align-center .material-icons[style*="color: var(--dangerColor)"]::before,
    td.align-center .material-icons:contains("error")::before {
        background: linear-gradient(135deg, rgba(247, 78, 78, 0.95), rgba(220, 53, 69, 0.95));
    }

/* Info (Azul) */
td.align-center .material-icons[style*="color: var(--infoColor)"],
td.align-center .material-icons:contains("info") {
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.95), rgba(33, 150, 243, 0.95));
}

    td.align-center .material-icons[style*="color: var(--infoColor)"]::before,
    td.align-center .material-icons:contains("info")::before {
        background: linear-gradient(135deg, rgba(66, 165, 245, 0.95), rgba(33, 150, 243, 0.95));
    }

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .hc-status {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    td.align-center .material-icons {
        font-size: 1rem;
        height: 30px;
        width: 30px;
    }
}

/* ===== FALLBACKS PARA COMPATIBILIDADE ===== */

/* Para navegadores que não suportam :has() ou :contains() */
/* Estas alternativas não funcionarão tão bem, mas oferecem algum estilo */

/* Fallback para detecção de conteúdo em hc-status */
.hc-status .material-icons[style*="color: var(--warningColor)"] + * {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.85), rgba(224, 130, 30, 0.9)) !important;
}

.hc-status .material-icons[style*="color: var(--dangerColor)"] + * {
    background: linear-gradient(135deg, rgba(247, 78, 78, 0.85), rgba(220, 53, 69, 0.9)) !important;
}

.hc-status .material-icons[style*="color: var(--infoColor)"] + * {
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.85), rgba(33, 150, 243, 0.9)) !important;
}

/* Estilos para garantir que os ícones em tabelas fiquem visíveis */
td.align-center .material-icons {
    background-color: #28a745; /* Cor padrão se os gradientes não funcionarem */
}

    td.align-center .material-icons[style*="color: var(--warningColor)"] {
        background-color: #ffc107;
    }

    td.align-center .material-icons[style*="color: var(--dangerColor)"] {
        background-color: #dc3545;
    }

    td.align-center .material-icons[style*="color: var(--infoColor)"] {
        background-color: #17a2b8;
    }



/* Make the container horizontally scrollable */
.health-check-container {
    width: 100%;
    min-width: 600px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
}

/* Ensure the table maintains its structure */
.health-check-table {
    min-width: 600px; /* Set minimum width to ensure all columns are visible */
    table-layout: fixed;
}
