/* Dashboard Loading States and Micro-interactions */

/* Loading skeleton animation */
@keyframes skeleton-loading {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
    background-color: #f3f4f6;
    background-image: linear-gradient(
        90deg,
        #f3f4f6 0px,
        #e5e7eb 40px,
        #f3f4f6 80px
    );
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Card hover effects */
.dashboard-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-card: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);
}

/* Pulse animation for live data */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth number transitions */
.number-transition {
    transition: all 0.3s ease-out;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(2px);
}

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

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

/* Mobile responsiveness improvements */
@media (max-width: 640px) {
    .dashboard-card {
        margin-bottom: 1rem;
    }
    
    .stat-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-container {
        height: 250px !important;
    }
    
    .mobile-stack {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .mobile-center {
        text-align: center !important;
    }
}

@media (max-width: 768px) {
    .tablet-stack {
        flex-direction: column !important;
    }
    
    .chart-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Enhanced button interactions */
.btn-hover-lift {
    transition: all 0.2s ease;
}

.btn-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.2);
}

.btn-hover-lift:active {
    transform: translateY(0);
    box-shadow: 0 5px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Status indicators */
.status-indicator {
    position: relative;
}

.status-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.online::before {
    background-color: #10b981;
}

.status-indicator.offline::before {
    background-color: #ef4444;
}

.status-indicator.pending::before {
    background-color: #f59e0b;
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Focus states for accessibility */
.focus-ring:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Chart responsive improvements */
.chart-responsive {
    position: relative;
    height: 300px;
    width: 100%;
}

@media (max-width: 640px) {
    .chart-responsive {
        height: 250px;
    }
}

/* Data table improvements */
.data-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table table {
    min-width: 600px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .dashboard-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
    }
}
