/* Health Status Indicator Styles */
.health-status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

.health-icon {
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;
}

.health-healthy {
    color: #10b981;
    background-color: rgba(16, 185, 129, 0.1);
}

.health-warning {
    color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.1);
}

.health-error {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

.health-icon:hover {
    transform: scale(1.1);
}

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

.health-icon.checking {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Popover Styles */
.health-popover {
    position: fixed;
    z-index: 1000;
    width: 360px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.health-popover.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.health-popover::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 6px 0 6px;
    border-color: white transparent transparent transparent;
}

.health-popover::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 7px 7px 0 7px;
    border-color: #e5e7eb transparent transparent transparent;
}

/* Posicionamento da seta - será ajustado via JavaScript */
.health-popover.arrow-right::after {
    top: 100%;
    right: 16px;
}

.health-popover.arrow-right::before {
    top: 100%;
    right: 15px;
}

.health-popover.arrow-left::after {
    top: 100%;
    left: 16px;
}

.health-popover.arrow-left::before {
    top: 100%;
    left: 15px;
}

.health-popover.arrow-center::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.health-popover.arrow-center::before {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
}

/* Setas para baixo (popover acima do ícone) - padrão */
.health-popover[style*="--arrow-direction: down"]::after,
.health-popover:not([style*="--arrow-direction"])::after {
    border-width: 6px 6px 0 6px;
    border-color: white transparent transparent transparent;
}

.health-popover[style*="--arrow-direction: down"]::before,
.health-popover:not([style*="--arrow-direction"])::before {
    border-width: 7px 7px 0 7px;
    border-color: #e5e7eb transparent transparent transparent;
}

/* Setas para cima (popover abaixo do ícone) */
.health-popover[style*="--arrow-direction: up"]::after {
    top: -6px;
    border-width: 0 6px 6px 6px;
    border-color: transparent transparent white transparent;
}

.health-popover[style*="--arrow-direction: up"]::before {
    top: -7px;
    border-width: 0 7px 7px 7px;
    border-color: transparent transparent #e5e7eb transparent;
}

.health-popover[style*="--arrow-direction: up"].arrow-right::after {
    top: -6px;
    right: 16px;
}

.health-popover[style*="--arrow-direction: up"].arrow-right::before {
    top: -7px;
    right: 15px;
}

.health-popover[style*="--arrow-direction: up"].arrow-left::after {
    top: -6px;
    left: 16px;
}

.health-popover[style*="--arrow-direction: up"].arrow-left::before {
    top: -7px;
    left: 15px;
}

.health-popover[style*="--arrow-direction: up"].arrow-center::after {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
}

.health-popover[style*="--arrow-direction: up"].arrow-center::before {
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
}

.health-popover-content {
    padding: 12px;
}

.health-popover-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.health-popover-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.health-popover-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.health-popover-body {
    margin-bottom: 8px;
}

.health-popover-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    font-size: 12px;
    line-height: 1.4;
}

.health-popover-label {
    color: #6b7280;
    font-weight: 500;
    flex-shrink: 0;
    margin-right: 8px;
}

.health-popover-endpoint {
    color: #3b82f6;
    font-family: monospace;
    font-size: 11px;
}

.health-popover-error {
    color: #dc2626;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #fee2e2;
}

.health-popover-error .health-popover-label {
    color: #dc2626;
}

.health-popover-footer {
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}

.health-popover-note {
    color: #9ca3af;
    font-size: 11px;
    font-style: italic;
}

.health-popover-dot.health-healthy {
    background-color: #10b981;
}

.health-popover-dot.health-warning {
    background-color: #f59e0b;
}

.health-popover-dot.health-error {
    background-color: #ef4444;
}
