/* =============================================================================
   SunBurst KPI Component - Estilos CSS
   Componente de visualização hierárquica para KPIs de tempo
   ============================================================================= */

/* 🎯 CONTAINER PRINCIPAL */
.sunburst-kpi-container {
    position: relative;
    width: 100%;
    min-height: 800px;
    background: transparent;
}

/* 🎯 CABEÇALHO */
.sunburst-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.sunburst-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.sunburst-controls .rz-dropdown {
    min-width: 120px;
}

.sunburst-controls .rz-button {
    min-width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sunburst-controls .rz-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 🎯 CARD DO GRÁFICO */
.sunburst-chart-card {
    background: linear-gradient(135deg, 
        rgba(248, 250, 252, 0.95) 0%, 
        rgba(255, 255, 255, 0.98) 100%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 4px 16px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
}

.sunburst-chart-card:hover {
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* 🎯 CONTAINER DO GRÁFICO */
.sunburst-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 700px;
}

.sunburst-chart-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 600px;
    padding: 2rem 0;
}

.sunburst-svg-container {
    position: relative;
    overflow: visible;
    border-radius: 50%;
    background: transparent;
    transition: all 0.3s ease;
}



/* 🎯 ELEMENTOS SVG (aplicados via JavaScript) */
.sunburst-svg-container svg {
    overflow: visible;
    border-radius: 50%;
}

.sunburst-segment {
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.sunburst-segment:hover {
    filter: 
        drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15))
        brightness(1.1)
        saturate(1.2);
    transform: scale(1.02);
}

.sunburst-segment.selected {
    filter: 
        drop-shadow(0 6px 12px rgba(0, 0, 0, 0.2))
        brightness(1.15)
        saturate(1.3);
    transform: scale(1.05);
}

.sunburst-text {
    font-family: var(--rz-font-family, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif);
    font-size: 11px;
    font-weight: 600;
    fill: #333333;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    pointer-events: none;
    text-anchor: middle;
    dominant-baseline: central;
}

.sunburst-center-text {
    font-family: var(--rz-font-family, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif);
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.sunburst-center-bg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

.sunburst-center-value {
    font-size: 28px;
    font-weight: 700;
    fill: var(--rz-text-color, #333333);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.sunburst-center-label {
    font-size: 14px;
    font-weight: 500;
    fill: var(--rz-text-secondary-color, #666666);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
}

/* 🎯 CONTAINER DA LEGENDA */
.sunburst-legend-container {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sunburst-chart-card .sunburst-legend-container {
    color: rgba(0, 0, 0, 0.8);
}

.sunburst-chart-card .rz-fieldset {
    border-color: rgba(0, 0, 0, 0.2);
}

.sunburst-chart-card .rz-fieldset legend {
    color: rgba(0, 0, 0, 0.8);
}

/* 🎯 LEGENDA */
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.legend-item:hover {
    background-color: var(--rz-background-color-lighter, rgba(0, 0, 0, 0.04));
    transform: translateX(4px);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.legend-item:hover .legend-color {
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 🎯 RESUMO EXECUTIVO MELHORADO */
.summary-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--rz-border-color-lighter, rgba(0, 0, 0, 0.06));
    transition: all 0.2s ease;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item:hover {
    padding-left: 0.5rem;
    background-color: var(--rz-background-color-lighter, rgba(0, 0, 0, 0.02));
    border-radius: 6px;
    border-bottom-color: transparent;
}

.summary-section {
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

.kpi-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.kpi-row:hover {
    background-color: var(--rz-background-color-lighter, rgba(0, 0, 0, 0.03));
    transform: translateX(4px);
}

/* 🎯 HIERARQUIA DA LEGENDA */
.hierarchy-level {
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: var(--rz-background-color-lighter, rgba(0, 0, 0, 0.02));
    border-left: 4px solid var(--rz-primary, #2196f3);
    transition: all 0.3s ease;
}

.hierarchy-level:hover {
    background: var(--rz-background-color-lighter, rgba(0, 0, 0, 0.04));
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.legend-subcategory {
    margin: 0.75rem 0;
    padding-left: 0.5rem;
    border-left: 2px solid var(--rz-border-color, rgba(0, 0, 0, 0.1));
}

.sunburst-chart-card .hierarchy-level {
    background: rgba(0, 0, 0, 0.03);
    border-left-color: rgba(0, 0, 0, 0.2);
}

.sunburst-chart-card .hierarchy-level:hover {
    background: rgba(0, 0, 0, 0.06);
}

.sunburst-chart-card .legend-subcategory {
    border-left-color: rgba(0, 0, 0, 0.15);
}

/* 🎯 MÉTRICAS ADICIONAIS */
.sunburst-additional-metrics .rz-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    background: linear-gradient(135deg, 
        var(--rz-panel-background-color, #ffffff) 0%, 
        rgba(248, 250, 252, 0.8) 100%);
    border: 1px solid var(--rz-border-color-lighter, rgba(0, 0, 0, 0.08));
}

.sunburst-additional-metrics .rz-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 25px rgba(0, 0, 0, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.08);
}

.sunburst-additional-metrics .rz-icon {
    transition: all 0.3s ease;
}

.sunburst-additional-metrics .rz-card:hover .rz-icon {
    transform: scale(1.1) rotate(5deg);
}

/* 🎯 ESTADO VAZIO */
.sunburst-empty-state {
    background: linear-gradient(135deg, 
        var(--rz-panel-background-color, #ffffff) 0%, 
        rgba(248, 250, 252, 0.9) 100%);
    border: 2px dashed var(--rz-border-color, #e0e0e0);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.sunburst-empty-state:hover {
    border-color: var(--rz-primary-lighter, rgba(33, 150, 243, 0.3));
    background: linear-gradient(135deg, 
        rgba(33, 150, 243, 0.02) 0%, 
        rgba(248, 250, 252, 0.95) 100%);
}

/* 🎯 LOADING OVERLAY */
.sunburst-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

/* 🎯 TOOLTIP PERSONALIZADO */
.sunburst-tooltip {
    position: absolute;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #333333;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        0 4px 10px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 1001;
    max-width: 250px;
    opacity: 0;
    transform: scale(0.8) translateY(10px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.sunburst-tooltip.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.sunburst-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border: 6px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.95);
}

/* 🎯 ANIMAÇÕES */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Aplicar animações aos elementos */
.sunburst-kpi-container .animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.sunburst-kpi-container .animate-slide-up {
    animation: slideInUp 0.6s ease forwards;
}

.sunburst-kpi-container .animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* 🎯 RESPONSIVIDADE */
@media (max-width: 1200px) {
    .sunburst-legend-container {
        order: 2;
    }
    
    .sunburst-chart-container {
        order: 1;
    }
}

@media (max-width: 768px) {
    .sunburst-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .sunburst-controls {
        justify-content: center;
        width: 100%;
    }
    
    .sunburst-svg-container {
        width: 350px !important;
        height: 350px !important;
    }
    
    .sunburst-chart-wrapper {
        min-height: 300px;
    }
    
    .sunburst-additional-metrics .rz-column {
        margin-bottom: 1rem;
    }
    
    .legend-item {
        padding: 0.75rem;
    }
    
    .legend-color {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 576px) {
    .sunburst-kpi-container {
        padding: 0.5rem;
    }
    
    .sunburst-chart-card {
        padding: 1rem !important;
        margin: 0.5rem 0;
    }
    
    .sunburst-svg-container {
        width: 280px !important;
        height: 280px !important;
    }
    
    .sunburst-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .sunburst-controls .rz-dropdown,
    .sunburst-controls .rz-button {
        width: 100%;
        min-width: unset;
    }
    
    .sunburst-legend-container {
        padding: 0.5rem;
    }
    
    .sunburst-additional-metrics {
        margin-top: 1rem;
    }
}

/* 🎯 MODO ESCURO (desabilitado para manter tema claro) */
/*
@media (prefers-color-scheme: dark) {
    .sunburst-chart-card {
        background: linear-gradient(135deg, 
            rgba(20, 24, 35, 0.98) 0%, 
            rgba(10, 12, 18, 0.99) 100%);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 
            0 12px 40px rgba(0, 0, 0, 0.5),
            0 6px 20px rgba(0, 0, 0, 0.3);
    }
    
    .sunburst-empty-state {
        background: linear-gradient(135deg, 
            rgba(30, 30, 30, 0.95) 0%, 
            rgba(20, 20, 20, 0.9) 100%);
    }
    
    .sunburst-loading-overlay {
        background: rgba(30, 30, 30, 0.9);
    }
}
*/

/* 🎯 PRINT STYLES */
@media print {
    .sunburst-controls,
    .sunburst-loading-overlay {
        display: none !important;
    }
    
    .sunburst-chart-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .sunburst-kpi-container {
        break-inside: avoid;
    }
}

/* 🎯 ACESSIBILIDADE */
@media (prefers-reduced-motion: reduce) {
    .sunburst-kpi-container *,
    .sunburst-kpi-container *::before,
    .sunburst-kpi-container *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Melhorar contraste para usuários com necessidades especiais */
@media (prefers-contrast: high) {
    .sunburst-chart-card {
        border: 2px solid var(--rz-text-color, #000000);
    }
    
    .legend-color {
        border: 1px solid var(--rz-text-color, #000000);
    }
    
    .sunburst-segment {
        stroke: var(--rz-text-color, #000000);
        stroke-width: 1px;
    }
} 