/* 
 * Estilos unificados para Sistema de Farol
 * Inclui tooltips, círculos, cards e otimizações para tabelas
 */

/* =================
   CÍRCULOS DE FAROL 
   ================= */
.farol-circle {
    display: inline-block;
    border-radius: 50%;
    position: relative;
    cursor: help;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.farol-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Tamanhos dos círculos */
.farol-circle-small {
    width: 16px !important;
    height: 16px !important;
}

.farol-circle-normal {
    width: 24px !important;
    height: 24px !important;
}

.farol-circle-large {
    width: 32px !important;
    height: 32px !important;
}

/* Cores dos círculos */
.farol-green {
    background-color: #198754 !important;
}

.farol-yellow {
    background-color: #ffc107 !important;
}

.farol-red {
    background-color: #dc3545 !important;
}

.farol-gray {
    background-color: #6c757d !important;
}

/* =================
   SISTEMA DE TOOLTIPS - JAVASCRIPT PURO
   ================= */

/* Remove todos os pseudo-elementos que causam conflito */
.farol-circle::before,
.farol-circle::after {
    display: none !important;
    content: none !important;
}

/* Estilo para tooltips criados via JavaScript */
.farol-tooltip-js {
    position: fixed !important;
    background-color: rgba(0, 0, 0, 0.9) !important;
    color: white !important;
    padding: 6px 10px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    z-index: 999999 !important;
    pointer-events: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    max-width: 250px !important;
    text-align: center !important;
    opacity: 0 !important;
    transition: opacity 0.2s ease !important;
}

.farol-tooltip-js.show {
    opacity: 1 !important;
}

/* Hover do círculo - apenas visual CONTROLADO */
.farol-circle:hover {
    transform: scale(1.02) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.15s ease !important;
}

/* ANTI-ANIMAÇÃO: Remove qualquer pseudo-elemento ou transform indesejado */
.farol-circle,
.farol-circle::before,
.farol-circle::after {
    animation: none !important;
    transform: none !important;
}

.farol-circle:hover {
    transform: scale(1.02) !important; /* Apenas esse transform controlado */
}

/* Garantir que não há elementos flutuantes ou deslizantes */
.farol-circle * {
    animation: none !important;
    transition: none !important;
}

/* Tooltip JS com posicionamento fixo sem transforms */
.farol-tooltip-js {
    transform: none !important;
    will-change: opacity !important; /* Otimização de performance */
}

/* =================
   OTIMIZAÇÕES PARA TABELAS
   ================= */
.dash-table-container .farol-circle {
    margin: 0 auto !important;
    display: block !important;
}

.farol-table-mode {
    margin: 0 auto;
    vertical-align: middle;
}

/* Centralizar células de tabela com farois */
.dash-table-container .dash-cell-value {
    text-align: center !important;
    vertical-align: middle !important;
}

/* Reduzir tamanho de texto "Farol" em tabelas */
.dash-table-container {
    font-size: 13px !important;
}

.dash-table-container .dash-header {
    font-size: 14px !important;
    font-weight: 600 !important;
}

.dash-table-container .dash-cell-value {
    font-size: 12px !important;
    padding: 8px !important;
}

/* Forçar texto pequeno em colunas de farol */
.dash-table-container [data-dash-column*='farol'] .dash-cell-value,
.dash-table-container [data-dash-column*='Farol'] .dash-cell-value {
    font-size: 11px !important;
    padding: 4px !important;
}

/* =================
   CARDS DE FAROL
   ================= */
.farol-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 120px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.farol-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.farol-card.sem-problema {
    border-color: rgba(25, 135, 84, 0.3);
}

.farol-card.com-problema {
    border-color: rgba(255, 193, 7, 0.3);
}

.farol-card.problema-crítico {
    border-color: rgba(220, 53, 69, 0.3);
}

.farol-card.indefinido {
    border-color: rgba(108, 117, 125, 0.3);
}

/* =================
   LABELS E TEXTOS
   ================= */
.farol-label-text {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    margin-top: 4px;
}

.farol-container {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.label-small {
    font-size: 12px;
    font-weight: 500;
    color: inherit;
}

.number.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* =================
   RESPONSIVIDADE
   ================= */
@media (max-width: 768px) {
    .farol-card {
        min-width: 100px;
        padding: 16px;
    }

    .farol-circle-normal {
        width: 20px !important;
        height: 20px !important;
    }

    .farol-circle-large {
        width: 28px !important;
        height: 28px !important;
    }
}

@media (max-width: 480px) {
    .farol-card {
        min-width: 80px;
        padding: 12px;
    }

    .number.gradient-text {
        font-size: 20px !important;
    }

    .label-small {
        font-size: 10px;
    }
}

/* =================
   ANIMAÇÕES E EFEITOS
   ================= */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.interactive-element {
    transition: all 0.3s ease;
}

.interactive-element:hover {
    cursor: pointer;
}

/* =================
   TEMA ESCURO
   ================= */
[data-bs-theme='dark'] .farol-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme='dark'] .farol-card:hover {
    background: rgba(0, 0, 0, 0.3);
}

[data-bs-theme='dark'] .farol-circle::before {
    background-color: rgba(255, 255, 255, 0.9);
    color: black;
}

[data-bs-theme='dark'] .farol-circle::after {
    border-top-color: rgba(255, 255, 255, 0.9);
}
