/* Sistema de Labels Amigáveis - Estilos */

/* Tooltips para explicações */
[title] {
    position: relative;
    cursor: help;
}

/* Estilo melhorado para labels com tooltips */
.metric-label-friendly {
    border-bottom: 1px dotted rgba(255, 255, 255, 0.3);
    cursor: help;
    transition: border-color 0.2s ease;
}

.metric-label-friendly:hover {
    border-bottom-color: rgba(0, 255, 255, 0.5);
}

/* Estilo para bandas de frequência com Hz */
.frequency-band-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.frequency-band-name {
    font-weight: 600;
    color: #f5f7fa;
}

.frequency-band-range {
    font-size: 0.85em;
    opacity: 0.7;
    color: #9fb3d9;
}

/* Cards de métricas com melhor legibilidade */
.data-row .label {
    font-weight: 500;
    color: #d6e7ff;
    min-width: 120px;
    display: inline-block;
}

.data-row .value {
    font-weight: 600;
    color: #fff;
}

/* Indicadores visuais para diferentes tipos de métricas */
.metric-loudness .label::before {
    content: "🔊";
    margin-right: 4px;
    opacity: 0.7;
}

.metric-dynamics .label::before {
    content: "📊";
    margin-right: 4px;
    opacity: 0.7;
}

.metric-stereo .label::before {
    content: "🎧";
    margin-right: 4px;
    opacity: 0.7;
}

.metric-spectral .label::before {
    content: "🌈";
    margin-right: 4px;
    opacity: 0.7;
}

/* Animação suave para mudanças de valor */
.data-row {
    transition: background-color 0.2s ease;
}

.data-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
}

/* Melhor contraste para tooltips nativos */
[title]:hover {
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

/* Referência comparativa - células de diferença melhoradas */
.ref-compare-table td.ok {
    background: rgba(82, 247, 173, 0.15);
    color: #52f7ad;
    font-weight: 600;
    border: 1px solid rgba(82, 247, 173, 0.3);
}

.ref-compare-table td.yellow {
    background: rgba(255, 206, 77, 0.15);
    color: #ffce4d;
    font-weight: 600;
    border: 1px solid rgba(255, 206, 77, 0.3);
}

.ref-compare-table td.warn {
    background: rgba(255, 123, 123, 0.15);
    color: #ff7b7b;
    font-weight: 600;
    border: 1px solid rgba(255, 123, 123, 0.3);
}

/* Indicadores de direção */
.direction-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
}

.direction-increase {
    color: #52f7ad;
    background: rgba(82, 247, 173, 0.1);
    border: 1px solid rgba(82, 247, 173, 0.3);
}

.direction-decrease {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* Melhor layout para células de diferença */
.diff-cell-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 50px;
    justify-content: center;
}

.diff-value {
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.diff-status {
    font-size: 9px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.diff-action {
    font-size: 10px;
    font-weight: 600;
    opacity: 0.85;
}

/* Animações suaves */
.ref-compare-table td {
    transition: all 0.25s ease;
    padding: 6px 8px;
    text-align: center;
    font-size: clamp(11.5px, 0.9vw, 13px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.8);
}

.ref-compare-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* 🎯 Estilos refinados e compactos para tabela A/B */
.ab-compare-table {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(20, 20, 40, 0.5));
    border-radius: 10px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0 1px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.ab-compare-table thead th {
    background: linear-gradient(90deg, rgba(127, 0, 255, 0.2), rgba(0, 255, 255, 0.2));
    border-bottom: 1px solid rgba(82, 247, 173, 0.25);
    padding: 8px 10px;
    font-size: clamp(12px, 1vw, 13px);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.ab-compare-table tbody tr {
    background: rgba(255, 255, 255, 0.015);
    border-radius: 4px;
    transition: background 0.2s ease, transform 0.15s ease;
}

.ab-compare-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(2px);
}

.ab-compare-table .metric-name {
    text-align: left;
    font-weight: 500;
    padding-left: 12px;
    color: rgba(255, 255, 255, 0.65);
    font-size: clamp(11.5px, 0.9vw, 13px);
}

.ab-compare-table .ab-user,
.ab-compare-table .ab-ref {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: clamp(11.5px, 0.9vw, 13px);
    background: linear-gradient(90deg, rgba(50, 50, 100, 0.12), rgba(0, 0, 0, 0.12));
    padding: 6px 8px;
}

.ab-compare-table .delta-col {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: clamp(11px, 0.85vw, 12px);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 8px;
}

.ab-compare-table .status-col {
    min-width: 80px;
    padding: 6px 8px;
    font-size: 12px;
}

.ab-compare-table .diff-cell-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-direction: row;
}

.ab-compare-table .diff-value {
    font-size: 13px;
    line-height: 1;
}

.ab-compare-table .diff-status {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Status com cores refinadas e bordas neon suaves */
.ref-compare-table td.ok,
.ab-compare-table .status-col.ok {
    background: rgba(0, 40, 20, 0.3);
    color: #32ffb2;
    font-weight: 600;
    border: 1px solid rgba(0, 255, 170, 0.2);
    border-left: 3px solid rgba(0, 255, 170, 0.35);
    border-radius: 4px;
}

.ref-compare-table td.yellow,
.ab-compare-table .status-col.yellow {
    background: rgba(80, 60, 0, 0.3);
    color: #ffd65a;
    font-weight: 600;
    border: 1px solid rgba(255, 204, 0, 0.2);
    border-left: 3px solid rgba(255, 204, 0, 0.35);
    border-radius: 4px;
}

.ref-compare-table td.warn,
.ab-compare-table .status-col.warn {
    background: rgba(50, 0, 0, 0.35);
    color: #ff6677;
    font-weight: 600;
    border: 1px solid rgba(255, 51, 85, 0.2);
    border-left: 3px solid rgba(255, 51, 85, 0.35);
    border-radius: 4px;
}

/* Headers coloridos com text-shadow sutil */
.ab-user-header {
    color: #52f7ad !important;
    text-shadow: 0 0 6px rgba(82, 247, 173, 0.3);
}

.ab-ref-header {
    color: #ffce4d !important;
    text-shadow: 0 0 6px rgba(255, 206, 77, 0.3);
}

/* Track names no header - Refinado e compacto */
.ab-header {
    animation: fadeInUp 0.4s ease-out;
    margin-bottom: 10px;
}

.track-name {
    transition: all 0.3s ease;
    position: relative;
}

.track-name:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Separadores suaves entre linhas */
.ab-compare-table tbody tr {
    margin-bottom: 2px;
}

.ab-compare-table tbody tr td {
    border-bottom: none;
    vertical-align: middle;
}

.ab-compare-table tbody tr:first-child td {
    padding-top: 0.6rem;
}

.ab-compare-table tbody tr:last-child td {
    padding-bottom: 0.6rem;
    border-bottom: none;
}

/* Responsividade mobile - Compacta e centralizada */
@media (max-width: 768px) {
    .ab-header {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 8px !important;
    }
    
    .ab-compare-table {
        font-size: 10px;
        border-spacing: 0 1px;
    }
    
    .ab-compare-table th,
    .ab-compare-table td {
        padding: 5px 6px;
        font-size: 10.5px;
    }
    
    .ab-compare-table .metric-name {
        font-size: 10px;
        padding-left: 8px;
    }
    
    .ab-compare-table .delta-col {
        display: none; /* Esconder coluna Δ no mobile */
    }
    
    .ab-compare-table thead th:nth-child(4) {
        display: none; /* Esconder header Δ no mobile */
    }
    
    .diff-status {
        font-size: 9px !important;
    }
    
    .diff-value {
        font-size: 11px !important;
    }
    
    .ab-compare-table .status-col {
        min-width: 65px;
        padding: 5px;
    }
    
    .track-name {
        text-align: center;
    }
    
    .ab-compare-table tbody tr:first-child td {
        padding-top: 8px;
    }
    
    .ab-compare-table tbody tr:last-child td {
        padding-bottom: 8px;
    }
}

/* Animação sutil nas células de valor */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(82, 247, 173, 0.1);
    }
    50% {
        box-shadow: 0 0 10px rgba(82, 247, 173, 0.2);
    }
}

.ab-compare-table .ab-user:hover,
.ab-compare-table .ab-ref:hover {
    animation: pulseGlow 2s ease-in-out infinite;
}
