/* 
   Arise Machine Tools - Premium Optimization & Enhancements
   Strictly additive, performance-focused, and isolated.
*/

/* =========================================
   1. GLOBAL SMOOTH SCROLLING & SCROLLBAR
   ========================================= */
:root {
    scroll-behavior: smooth;
}

/* Respect user motion preference */
@media (prefers-reduced-motion: reduce) {
    :root {
        scroll-behavior: auto;
    }
}

/* Premium Scrollbar (WebKit) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: content-box;
    transition: background-color 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

/* =========================================
   2. PERFORMANCE & LAYOUT OPTIMIZATIONS
   ========================================= */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* GPU Acceleration for media to prevent jank */
img,
video,
iframe {
    transform: translateZ(0);
    will-change: opacity;
    /* Only anticipate opacity changes to avoid memory overhead */
}

/* Optimize touch interactions */
a,
button,
input,
select,
textarea,
.btn {
    touch-action: manipulation;
    /* Removes 300ms delay on older devices if viewport meta fails */
}

/* =========================================
   3. PREMIUM UI MICRO-INTERACTIONS
   ========================================= */

/* Soft transitions for interactive elements */
a,
button,
.btn,
.nav-link,
.dropdown-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subtle hover lift effect for cards (additive class) */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Improved Focus States for Accessibility & Premium Feel */
:focus-visible {
    outline: 2px solid #0056b3;
    /* Adjust to brand color if possible, blue is safe default */
    outline-offset: 4px;
}

/* Fade In Up Keyframes for Smooth Entrance */
@keyframes fadeInUpSubtle {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up-subtle {
    animation: fadeInUpSubtle 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}