/* ============================================
   BSC ECOLAB - Global Aesthetics & Animations Enhancements
   ============================================ */

/* Better Root Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #0071e3 0%, #4facfe 100%);
    --card-hover-shadow: 0 20px 40px rgba(0, 113, 227, 0.15);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Nav Improvements - Glassmorphism (All Devices) */
nav {
    background: rgba(255, 255, 255, 0.65) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease !important;
}

.nav-logo {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.nav-logo img {
    height: 32px !important;
    width: auto !important;
}

.nav-menu a {
    position: relative;
    transition: color 0.3s ease, transform 0.2s ease !important;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background-color: var(--primary-color, #0071e3);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 80%;
}

/* ============================================
   Hero Section Enhancements
   ============================================ */

/* Default Hero (Low/High End Baseline) */
.hero-section {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Light background elements for default mode */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
    z-index: -1;
}

/* High-End Specific: Moving Gradient Hero */
html.high-end-device .hero-section {
    background: linear-gradient(-45deg, #fdfbfb 0%, #ebedee 100%, #e0c3fc 0%, #8ec5fc 100%) !important;
    background-size: 300% 300% !important;
    animation: gradientBG 15s ease infinite !important;
}

/* Low-End Specific: Static Gradient Hero */
html.low-end-device .hero-section {
    background: linear-gradient(135deg, #fdfbfb 0%, #e0c3fc 50%, #8ec5fc 100%) !important;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Hero Content Initial State */
.hero h1,
.hero p,
.hero-emoji {
    opacity: 0;
    /* Hidden initially, triggered by JS removing loading screen */
}

/* Hero Content Animations (Triggered via body.page-loaded) */
body.page-loaded .hero h1 {
    display: inline-block;
    background: linear-gradient(90deg, #023e8a 0%, #0077b6 33%, #0096c7 66%, #48cae4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: slideDownFade 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, gradientText 3s linear infinite;
}

.google-cursor {
    display: inline-block;
    margin-left: 2px;
    background: linear-gradient(180deg, #023e8a 0%, #0077b6 33%, #0096c7 66%, #48cae4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: blink 1s step-end infinite;
}

@keyframes gradientText {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

body.page-loaded .hero p {
    animation: slideUpFade 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s forwards;
}

body.page-loaded .hero-emoji {
    animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.hero-emoji img {
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.15));
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hero-emoji:hover img {
    transform: scale(1.15) rotate(5deg);
}


/* ============================================
   Card Design & Hover Effects 
   ============================================ */

/* Base Card (All Devices) */
.card {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.05) !important;
}

/* Low-End Card Hover - Simplified */
html.low-end-device .card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease !important;
}

html.low-end-device .card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 24px rgba(0, 113, 227, 0.1) !important;
    border-color: rgba(0, 113, 227, 0.2) !important;
    background: rgba(255, 255, 255, 0.85) !important;
}

/* High-End Card Hover - Complex 3D/Scale */
html.high-end-device .card {
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

html.high-end-device .card:hover {
    box-shadow: var(--card-hover-shadow) !important;
    border-color: rgba(0, 113, 227, 0.3) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    /* Transform handled by JS Tilt effect in high-end mode */
}


.card-icon {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.card:hover .card-icon {
    transform: scale(1.15) rotate(8deg) !important;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: -1;
    border-radius: inherit;
}

.btn:hover::after {
    transform: translateY(0);
}

.btn-primary {
    background-image: var(--primary-gradient) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 113, 227, 0.3) !important;
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(0, 113, 227, 0.4) !important;
    transform: translateY(-3px) !important;
}

/* ============================================
   Scroll Animations
   ============================================ */

/* High-End scroll animations */
html.high-end-device .animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

html.high-end-device .animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Low-End scroll animations (Fade only, no translation) */
html.low-end-device .animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

html.low-end-device .animate-on-scroll.is-visible {
    opacity: 1;
}

/* Keyframes */
@keyframes slideDownFade {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   Image & Footer Enhancements
   ============================================ */

img:not(.hero-emoji img):not(.card-icon img):not(.nav-logo img):not(.inline-icon):not(.menu-icon) {
    transition: transform 0.5s ease, filter 0.5s ease;
}

html.high-end-device img:not(.hero-emoji img):not(.card-icon img):not(.nav-logo img):not(.inline-icon):not(.menu-icon):hover {
    transform: scale(1.02);
    filter: brightness(1.05);
}

footer {
    background: linear-gradient(135deg, #1d1d1f 0%, #2c2c2e 100%) !important;
    color: #e5e5e7 !important;
    border-top: none !important;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
}

footer h3 {
    color: #ffffff !important;
}

footer a {
    color: #a1a1a6 !important;
    transition: color 0.3s ease, padding-left 0.3s ease !important;
    display: inline-block;
}

footer a:hover {
    color: #4facfe !important;
    padding-left: 6px !important;
}

/* Custom Selection */
::selection {
    background-color: rgba(0, 113, 227, 0.2);
    color: #0071e3;
}