/**
 * MessengerOS Dashboard CSS
 *
 * Custom styles for the analytics dashboard.
 * Complements Tailwind CSS for WordPress admin compatibility.
 */

/* Dashboard Container */
.messos-dashboard {
    max-width: 1400px;
    margin: 20px auto 40px;
}

/* Loading State */
.messos-dashboard.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Skeleton Loading Animation */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Stat Cards */
.stat-card {
    transition: all 0.2s ease-in-out;
}

.stat-card:hover {
    transform: translateY(-2px);
}

/* Chart Containers */
.chart-container {
    position: relative;
    min-height: 200px;
}

.chart-container canvas {
    max-height: 100%;
}

/* Spin Animation for Refresh Button */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Pulse Animation for Loading States */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* WordPress Admin Compatibility */
.messos-dashboard h1,
.messos-dashboard h2,
.messos-dashboard h3,
.messos-dashboard h4 {
    margin: 0;
    padding: 0;
}

.messos-dashboard .notice {
    margin: 0 0 20px 0;
}

/* Table Responsive Scroll */
.messos-dashboard table {
    border-collapse: collapse;
}

.messos-dashboard tbody tr:hover {
    background-color: #f9fafb;
}

/* Ensure Tailwind classes work */
.messos-dashboard * {
    box-sizing: border-box;
}

/* Empty State Styling */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state svg {
    margin: 0 auto 16px;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 48px 24px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .messos-dashboard {
        margin: 10px;
    }

    .messos-dashboard table {
        font-size: 12px;
    }

    .messos-dashboard .text-3xl {
        font-size: 24px;
    }
}

/* Print Styles */
@media print {
    .messos-dashboard #refresh-dashboard {
        display: none;
    }
}
