/* Dashboard - Melhorias Responsivas e UX */

/* Melhorias de UX gerais */
.page-inner {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estatísticas com hover melhorado */
.card-stats {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.card-stats:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.card-stats .icon-big {
    transition: transform 0.3s ease;
}

.card-stats:hover .icon-big {
    transform: scale(1.1);
}

/* Loading states */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Tooltips modernos */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    pointer-events: none;
}

/* Melhorias na tabela de produtos com baixo estoque */
.low-stock-table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.low-stock-table .table thead th {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
    color: #374151;
    padding: 1rem;
}

.low-stock-table .table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
}

.low-stock-table .table tbody tr:hover {
    background: #fef3c7;
    transform: scale(1.01);
}

.low-stock-table .table tbody td {
    border: none;
    padding: 1rem;
    vertical-align: middle;
}

/* Cards de atividade melhorados */
.activity-timeline {
    position: relative;
    padding-left: 2rem;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #e5e7eb, #f3f4f6);
}

.activity-timeline .activity-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.activity-timeline .activity-item::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 8px;
    width: 12px;
    height: 12px;
    background: #6366f1;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Gráficos responsivos */
.chart-responsive {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

@media (max-width: 768px) {
    .chart-responsive {
        height: 250px;
    }
}

/* Alerts modernos */
.modern-alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.modern-alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
}

.modern-alert-warning {
    background: linear-gradient(135deg, #fef3c7, #fbbf24);
    color: #92400e;
}

.modern-alert-danger {
    background: linear-gradient(135deg, #fee2e2, #f87171);
    color: #991b1b;
}

.modern-alert-success {
    background: linear-gradient(135deg, #d1fae5, #34d399);
    color: #065f46;
}

/* Botões de ação flutuantes */
.floating-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    cursor: pointer;
}

.fab-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.fab-success {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Skeleton loading para cards */
.skeleton-card {
    background: #f3f4f6;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.skeleton-line {
    height: 1rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.skeleton-line:last-child {
    margin-bottom: 0;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.medium {
    width: 80%;
}

/* Progress bars modernos */
.modern-progress {
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.modern-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
    position: relative;
}

.modern-progress-bar.success {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.modern-progress-bar.warning {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.modern-progress-bar.danger {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Micro-interações */
.clickable {
    transition: all 0.2s ease;
    cursor: pointer;
}

.clickable:hover {
    transform: translateY(-1px);
}

.clickable:active {
    transform: translateY(0);
}

/* Estados de loading para botões */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsividade aprimorada */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-card {
        padding: 1rem;
    }
    
    .floating-actions {
        bottom: 1rem;
        right: 1rem;
    }
    
    .fab {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .dashboard-header {
        text-align: center;
        padding: 2rem 1rem;
    }
    
    .dashboard-welcome {
        font-size: 2rem;
    }
    
    .modern-table thead th,
    .modern-table tbody td {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .skeleton-line {
        background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    }
    
    .modern-progress {
        background: #374151;
    }
    
    .activity-timeline::before {
        background: linear-gradient(to bottom, #4b5563, #6b7280);
    }
}
