/* Performance Optimization Styles */

/* GPU Acceleration for frequently animated elements */
.project-card,
.appointment-card,
.btn-new,
.btn-animated,
.time-slot,
.calendar-day {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Optimize scroll performance - use transform instead of position changes */
.header {
    transform: translateZ(0);
}

/* Reduce paint area for shadows on hover */
.project-card:hover,
.appointment-card:hover {
    isolation: isolate;
}

/* Optimize image rendering */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.project-image {
    transform: translateZ(0);
    will-change: auto; /* Reset after animation */
}

/* Contain layout shifts */
.appointments-scroll {
    contain: layout style paint;
}

.projects-grid {
    contain: layout style;
}

/* Optimize fonts */
.btn-new,
.btn-animated {
    text-rendering: optimizeLegibility;
    font-smooth: always;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Reduce complexity of box-shadows during scroll */
@media (prefers-reduced-motion: no-preference) {
    * {
        scroll-behavior: smooth;
    }
}

/* Performance hint for transitions */
.project-card,
.appointment-card,
.btn-new:hover,
.time-slot:hover {
    will-change: transform;
}

/* After transition completes, remove will-change */
.project-card:not(:hover),
.appointment-card:not(:hover) {
    will-change: auto;
}

/* Optimize calendar rendering */
.calendar-days {
    contain: layout style paint;
}

/* Reduce repaints on form inputs */
.reg-input,
.form-input {
    contain: layout style;
}

/* Composite layers for better performance */
.booking-container,
.auth-container,
.registration-container {
    transform: translateZ(0);
}

/* Optimize background images */
.auth-section,
.dashboard-section,
.registration-section {
    /* Background images are handled in layout.css */
    /* Fixed backgrounds removed for 60fps scrolling */
    contain: layout;
}
