/* Modern Performance & Smooth Enhancements */

/* CSS Variables for Better Performance */
:root {
    --transition-fast: 0.2s ease-out;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.2);
    --border-radius: 12px;
    --border-radius-lg: 20px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* Performance Optimizations */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* Modern Button Enhancements */
.btn {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: all var(--transition-smooth);
    border-radius: var(--border-radius);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-smooth);
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn:active {
    transform: translateY(0);
}

/* Enhanced Card Animations */
.card,
.policy-section,
.product-item {
    transition: all var(--transition-smooth);
    border-radius: var(--border-radius);
    will-change: transform;
}

.card:hover,
.policy-section:hover,
.product-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

/* Smooth Navigation */
.navbar {
    backdrop-filter: blur(10px);
    transition: all var(--transition-smooth);
}

.nav-link {
    position: relative;
    transition: all var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--bs-secondary);
    transition: all var(--transition-smooth);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Enhanced Spinner */
#spinner {
    backdrop-filter: blur(5px);
    background: rgba(255, 255, 255, 0.9);
}

.spinner-border {
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Smooth Carousel Transitions */
.carousel-item {
    transition: transform var(--transition-slow);
}

/* Enhanced Form Elements */
.form-control {
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
    transform: scale(1.02);
}

/* Modern Dropdown */
.dropdown-menu {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    border: none;
    animation: fadeInUp var(--transition-fast);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Enhanced Footer */
.footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.footer a {
    transition: all var(--transition-fast);
}

.footer a:hover {
    transform: translateX(5px);
    color: var(--bs-primary) !important;
}

/* Smooth Back to Top */
.back-to-top {
    border-radius: 50%;
    transition: all var(--transition-smooth);
    backdrop-filter: blur(10px);
    background: rgba(var(--bs-primary-rgb), 0.9) !important;
}

.back-to-top:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: var(--shadow-medium);
}

/* Enhanced Product Items */
.product-item-inner {
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all var(--transition-smooth);
}

.product-item:hover .product-item-inner {
    transform: scale(1.02);
}

/* Modern Search Bar */
.search-container {
    position: relative;
}

.search-container input {
    transition: all var(--transition-fast);
}

.search-container input:focus {
    box-shadow: 0 0 20px rgba(var(--bs-primary-rgb), 0.3);
}

/* Enhanced Policy Pages */
.policy-header {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #1a237e 100%);
    position: relative;
    overflow: hidden;
}

.policy-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

/* Smooth Animations */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

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

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Apply animations to elements */
.animate-slide-left {
    animation: slideInFromLeft var(--transition-smooth) ease-out;
}

.animate-slide-right {
    animation: slideInFromRight var(--transition-smooth) ease-out;
}

.animate-fade-scale {
    animation: fadeInScale var(--transition-smooth) ease-out;
}

/* Performance: Reduce paint and layout thrashing */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* Modern Focus States */
*:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Enhanced Mobile Experience */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        /* Better touch targets */
    }

    .nav-link {
        padding: 12px 16px;
        /* Better touch targets */
    }

    .card:hover,
    .policy-section:hover,
    .product-item:hover {
        transform: none;
        /* Disable hover effects on mobile */
    }
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}