/* Performance Optimizations - Prevent Flickering and Blinking */

/* Prevent layout shifts */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure body is always visible */
body {
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

/* Optimize rendering */
.dashboard-wrapper,
.main-content,
.content {
    contain: layout style paint;
}

/* Prevent image flickering */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Prevent text selection flicker */
* {
    -webkit-tap-highlight-color: transparent;
}

a, button, input, textarea, select, .menu-item {
    user-select: none;
    -webkit-user-select: none;
}

input, textarea {
    user-select: text;
    -webkit-user-select: text;
}

/* GPU acceleration for animations */
.card,
.stat-card,
.menu-item,
.btn {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Prevent reflows */
.clock {
    min-width: 300px;
    text-align: center;
}

/* Optimize table rendering */
.table {
    table-layout: fixed;
    width: 100%;
}

.table th,
.table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading state */
.content {
    opacity: 1;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Prevent flash of unstyled content - Removed visibility hidden to prevent blank page */
body {
    opacity: 1;
    visibility: visible !important;
}

/* Prevent layout shifts during load */
.content {
    min-height: 400px;
}

/* Optimize font rendering */
body, input, textarea, select, button {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

