/* Estilos específicos para os gráficos do dashboard */
.chart-bar-container {
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    background-color: #f9fafb;
    transition: all 0.2s ease;
    width: 100%;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.chart-bar-container:hover {
    background-color: #f3f4f6;
    transform: translateY(-1px);
}

.chart-bar {
    transition: width 0.5s ease;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 0.25rem;
    height: 1rem;
    min-width: 4px;
}

/* Garantir que os containers dos gráficos sejam visíveis */
#chart-top-suppliers,
#chart-by-department,
#chart-by-urgency {
    min-height: 200px;
    padding: 1rem 0;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Animações para a dashboard */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Efeitos de hover para os cards KPI */
#view-dashboard .bg-white.rounded-2xl {
    animation: fadeInUp 0.6s ease-out;
}

#view-dashboard .bg-white.rounded-2xl:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Efeitos para os indicadores de status */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Melhorias nos botões de filtro */
.dashboard-filter-btn {
    position: relative;
    overflow: hidden;
}

.dashboard-filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.dashboard-filter-btn:hover::before {
    left: 100%;
}

/* Efeitos para as barras de progresso */
.chart-bar {
    position: relative;
    overflow: hidden;
}

.chart-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Melhorias no header da dashboard */
#view-dashboard .bg-gradient-to-r {
    position: relative;
    overflow: hidden;
}

#view-dashboard .bg-gradient-to-r::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

/* Responsividade melhorada */
@media (max-width: 768px) {
    #view-dashboard .grid {
        gap: 1rem;
    }
    
    #view-dashboard .bg-gradient-to-r {
        padding: 1.5rem;
    }
    
    #view-dashboard .bg-gradient-to-r h2 {
        font-size: 1.875rem;
    }
}

/* Efeito de sucesso da dashboard */
.dashboard-success {
    position: relative;
}

.dashboard-success::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(34, 197, 94, 0.1) 50%, transparent 70%);
    animation: successSweep 2s ease-out;
    pointer-events: none;
    z-index: 10;
}

@keyframes successSweep {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Melhorias nos indicadores de status */
.dashboard-status-indicator {
    position: relative;
    display: inline-block;
}

.dashboard-status-indicator::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Estilos para as barras dos gráficos */
.chart-bar-container .flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.chart-bar-container .text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.chart-bar-container .font-medium {
    font-weight: 500;
}

.chart-bar-container .font-bold {
    font-weight: 700;
}

.chart-bar-container .text-gray-700 {
    color: #374151;
}

/* Estilos para o container das barras */
.chart-bar-container .w-full {
    width: 100%;
}

.chart-bar-container .bg-gray-200 {
    background-color: #e5e7eb;
}

.chart-bar-container .rounded-full {
    border-radius: 9999px;
}

.chart-bar-container .h-4 {
    height: 1rem;
}

.chart-bar-container .mb-1 {
    margin-bottom: 0.25rem;
}

/* Estilos específicos para as barras azuis */
.chart-bar-container .bg-blue-500 {
    background-color: #3b82f6;
}

/* Garantir que o espaço entre os itens funcione */
.space-y-3 > * + * {
    margin-top: 0.75rem;
}

/* Estilos para o container das barras de progresso */
.chart-bar-container .w-full.bg-gray-200.rounded-full.h-4 {
    position: relative;
    overflow: hidden;
    background-color: #e5e7eb;
    border-radius: 9999px;
    height: 1rem;
    width: 100%;
}

/* Estilos para as barras de progresso */
.chart-bar-container .bg-blue-500.h-4.rounded-full.chart-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #3b82f6;
    border-radius: 9999px;
    transition: width 0.5s ease;
}

/* Forçar visibilidade dos gráficos */
#chart-top-suppliers .chart-bar-container,
#chart-by-department .chart-bar-container,
#chart-by-urgency .chart-bar-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Estilos específicos para as barras de progresso com inline styles */
.chart-bar-container div[style*="position: absolute"] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%) !important;
    border-radius: 9999px !important;
    transition: width 0.5s ease !important;
    min-width: 4px !important;
}

/* Garantir que os containers das barras sejam visíveis */
.chart-bar-container div[style*="width: 100%"] {
    width: 100% !important;
    background-color: #e5e7eb !important;
    border-radius: 9999px !important;
    height: 1rem !important;
    position: relative !important;
    overflow: hidden !important;
}
