/* Custom animations and transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Card animations */
.kpi-card {
    animation: fadeInUp 0.6s ease-out;
    transition: all 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Tab animations */
.tab-content {
    animation: slideInRight 0.5s ease-out;
}

/* Chart container animations */
.chart-container {
    animation: fadeInUp 0.8s ease-out;
}

/* Loading spinner */
.loading-spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #1e3a8a;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .text-2xl {
        font-size: 1.5rem;
    }
}

/* Custom button styles */
.btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 58, 138, 0.3);
}

/* Gradient backgrounds */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Status indicators */
.status-positive {
    color: #10b981;
    background-color: #d1fae5;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-negative {
    color: #ef4444;
    background-color: #fee2e2;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-neutral {
    color: #f59e0b;
    background-color: #fef3c7;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Chart styling */
.chart-wrapper {
    position: relative;
    height: 300px;
}

/* Table enhancements */
.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Progress bars */
.progress-bar {
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    transition: width 0.5s ease;
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #1f2937;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .nav-tabs {
        flex-direction: column;
        space-y: 2;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-grid {
        grid-template-columns: 1fr;
    }
}


/* CORREÇÃO: Altura fixa para gráficos */

/* Container específico para gráficos */
.chart-container {
    position: relative;
    height: 300px !important;
    width: 100% !important;
}

/* Aplicar altura fixa a todos os canvas de gráficos */
canvas {
    max-height: 300px !important;
    height: 300px !important;
    width: 100% !important;
}

/* IDs específicos dos gráficos */
#performanceChart,
#emendaChart,
#resultadosChart,
#faturamentoChart,
#npsChart,
#canaisChart {
    height: 300px !important;
    max-height: 300px !important;
    width: 100% !important;
}

/* Container pai dos gráficos com altura mínima */
.bg-white.rounded-lg.shadow-md.p-6:has(canvas) {
    min-height: 380px;
}

/* Forçar altura nos containers de gráficos */
.bg-white.rounded-lg.shadow-md.p-6 canvas {
    height: 300px !important;
    max-height: 300px !important;
    width: 100% !important;
}

/* Responsividade para gráficos em mobile */
@media (max-width: 768px) {
    .chart-container {
        height: 250px !important;
    }
    
    canvas {
        max-height: 250px !important;
        height: 250px !important;
    }
    
    #performanceChart,
    #emendaChart,
    #resultadosChart,
    #faturamentoChart,
    #npsChart,
    #canaisChart {
        height: 250px !important;
        max-height: 250px !important;
    }
    
    .bg-white.rounded-lg.shadow-md.p-6:has(canvas) {
        min-height: 330px;
    }
}

/* Ajuste adicional para Chart.js */
.chartjs-render-monitor {
    height: 300px !important;
    max-height: 300px !important;
}

@media (max-width: 768px) {
    .chartjs-render-monitor {
        height: 250px !important;
        max-height: 250px !important;
    }
}

