:root {
    --disable-animations: 0;
    --animation-speed: 1s;
    --animation-delay: 0s;
}

/* Disable all animations when loading */
html[style*="--disable-animations: 1"] *,
html[style*="--disable-animations: 1"] *::before,
html[style*="--disable-animations: 1"] *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0.01ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0.01ms !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background: #1a1a1a;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    font-display: swap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    /* Optimize for faster loading */
    contain: layout style;
    will-change: opacity, visibility;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Optimized Loading Screen Styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    pointer-events: auto;
    contain: strict;
    will-change: opacity, visibility, transform;
    backdrop-filter: blur(15px);
}

/* Loading screen hide state */
.loading-screen.hide {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    pointer-events: none;
}

.loading-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(154, 205, 50, 0.08) 0%, transparent 70%);
    opacity: 0.4;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 480px;
    width: 90%;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(154, 205, 50, 0.3);
    backdrop-filter: blur(15px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.loading-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.loading-logo .main-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    animation: logoFloat 3s ease-in-out infinite;
}

.loading-text h1 {
    color: #9ACD32;
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(154, 205, 50, 0.5);
}

.loading-text p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin: 0;
    opacity: 0.9;
}

.loading-brands {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
}

.brand-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(154, 205, 50, 0.2);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: brandFloat 4s ease-in-out infinite, fadeInUp 0.8s ease 1.2s both;
}

.brand-logo img {
    width: 50px;
    height: 50px;
    margin-bottom: 0.5rem;
    border-radius: 10px;
}

.brand-logo span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 600;
}

.loading-progress {
    width: 100%;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes brandFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-container {
    text-align: center;
    max-width: 500px;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.loading-logo {
    margin-bottom: 3rem;
    animation: logoFloat 3s ease-in-out infinite;
}

.loading-logo .main-logo {
    height: 120px;
    width: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 10px 30px rgba(154, 205, 50, 0.4));
    animation: logoGlow 2s ease-in-out infinite alternate;
}

.loading-text {
    opacity: 0;
    animation: textReveal 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.5s both;
}

.loading-text h1 {
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
    font-weight: 800;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

.loading-text p {
    color: #9ACD32;
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0.9;
    text-shadow: 0 0 10px rgba(154, 205, 50, 0.3);
}

.loading-brands {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
    opacity: 0;
    animation: brandsReveal 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) 1s both;
}

.brand-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    border: 1px solid rgba(154, 205, 50, 0.3);
    backdrop-filter: blur(15px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px) scale(0.8);
    animation: brandAppear 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

.brand-logo:nth-child(1) { animation-delay: 1.2s; }
.brand-logo:nth-child(2) { animation-delay: 1.4s; }
.brand-logo:nth-child(3) { animation-delay: 1.6s; }
.brand-logo:nth-child(4) { animation-delay: 1.8s; }

.brand-logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(154, 205, 50, 0.2), transparent);
    transition: left 0.8s ease;
}

.brand-logo:hover::before {
    left: 100%;
}

.brand-logo img {
    height: 50px;
    width: auto;
    filter: brightness(1.2) drop-shadow(0 5px 15px rgba(154, 205, 50, 0.3));
    transition: all 0.3s ease;
}

.brand-logo span {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.loading-progress {
    margin-top: 2rem;
    opacity: 0;
    animation: progressReveal 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) 1.8s both;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid rgba(154, 205, 50, 0.4);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #9ACD32 0%, #7CB342 50%, #9ACD32 100%);
    width: 0%;
    border-radius: 12px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 25px rgba(154, 205, 50, 0.7);
    animation: progressGlow 2s ease-in-out infinite alternate;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50px;
    width: 50px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: progressShine 2s infinite;
}

.loading-percentage {
    color: #9ACD32;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(154, 205, 50, 0.6);
    animation: numberGlow 2s ease-in-out infinite alternate;
}

.loading-fallback {
    padding: 2rem;
    text-align: center;
    background: rgba(154, 205, 50, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(154, 205, 50, 0.3);
    color: #9ACD32;
    font-weight: 600;
}

/* Optimized Animations */
@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes progressShine {
    0% { left: -50px; }
    100% { left: calc(100% + 50px); }
}

/* Mobile Loading Optimizations */
@media (max-width: 768px) {
    .loading-container {
        padding: 1.5rem;
        max-width: 90vw;
    }

    .loading-logo .main-logo {
        height: 100px;
    }

    .loading-text h1 {
        font-size: 2rem;
    }

    .loading-text p {
        font-size: 1rem;
    }

    .loading-brands {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .brand-logo {
        padding: 1.2rem;
    }

    .brand-logo img {
        height: 45px;
    }

    .brand-logo span {
        font-size: 0.85rem;
    }

    .progress-bar {
        height: 6px;
    }

    .loading-percentage {
        font-size: 1.1rem;
    }

    /* Mobile optimizations */
    .loading-screen.hide {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: scale(0.95);
    }
}

@media (max-width: 480px) {
    .loading-container {
        padding: 1rem;
        max-width: 95vw;
    }

    .loading-logo .main-logo {
        height: 80px;
    }

    .loading-text h1 {
        font-size: 1.8rem;
    }

    .loading-brands {
        gap: 1rem;
    }

    .brand-logo {
        padding: 1rem;
    }

    .brand-logo img {
        height: 35px;
    }

    .brand-logo span {
        font-size: 0.8rem;
    }
}

/* Enhanced Button Styles */
.btn {
    display: inline-block;
    padding: 16px 32px;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

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

.btn-primary {
    background: linear-gradient(135deg, #9ACD32 0%, #7CB342 100%);
    color: #1a1a1a;
    box-shadow: 0 12px 30px rgba(154, 205, 50, 0.4);
    border: 2px solid transparent;
    font-size: 1.2rem;
    padding: 20px 40px;
    font-weight: 800;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7CB342 0%, #689F38 100%);
    color: #000000;
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 20px 40px rgba(154, 205, 50, 0.5);
}

.btn-secondary {
    background: rgba(26, 26, 26, 0.95);
    color: #9ACD32;
    border: 2px solid #9ACD32;
    box-shadow: 0 12px 30px rgba(26, 26, 26, 0.4);
    font-size: 1.2rem;
    padding: 20px 40px;
    backdrop-filter: blur(15px);
}

.btn-secondary:hover {
    background: rgba(154, 205, 50, 0.15);
    color: #7CB342;
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 20px 40px rgba(154, 205, 50, 0.3);
    border-color: #7CB342;
}

/* Enhanced Card Styles */
.service-card,
.feature-card,
.contact-card,
.testimonial-card {
    background: #1a1a1a;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(154, 205, 50, 0.1);
    position: relative;
    overflow: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.service-card::before,
.feature-card::before,
.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(154, 205, 50, 0.08), rgba(124, 179, 66, 0.04));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.service-card:hover::before,
.feature-card:hover::before,
.contact-card:hover::before {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 30px 60px rgba(154, 205, 50, 0.25);
    border-color: rgba(154, 205, 50, 0.3);
}

.feature-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border-color: rgba(154, 205, 50, 0.3);
}

.contact-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 30px 55px rgba(154, 205, 50, 0.3);
    border-color: rgba(154, 205, 50, 0.4);
}

.testimonial-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Enhanced Icon Animations */
.service-icon,
.feature-icon {
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 2;
}

.service-icon:hover,
.feature-icon:hover {
    transform: scale(1.3) rotate(15deg);
    filter: brightness(1.4) drop-shadow(0 15px 25px rgba(154, 205, 50, 0.4));
}

/* Enhanced Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation Classes */
.animated {
    animation-fill-mode: both;
}

.fadeInUp {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slideInRight {
    animation: slideInRight 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scaleIn {
    animation: scaleIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bounceIn {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Page Sections */
.content-section,
section {
    padding: 5rem 0;
    position: relative;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Prevent layout shifts */
    contain: layout style;
    will-change: opacity, visibility, transform;
}

.content-section.loaded,
section.animated {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Container optimization - FASTER */
[id$="-container"] {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    contain: layout style;
    will-change: opacity, visibility;
}

[id$="-container"]:not(:empty) {
    opacity: 1;
    visibility: visible;
}

/* Critical containers load immediately */
#header-container,
#hero-container {
    transition: opacity 0.1s ease, visibility 0.1s ease;
}

/* Ensure header is always visible above loading screen */
#header-container {
    position: relative;
    z-index: 10001;
}

/* Force header visibility when content is loaded */
#header-container:not(:empty) {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Responsive Improvements */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    .service-card,
    .feature-card {
        min-height: 280px;
        padding: 1.8rem;
    }

    .btn {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
        display: block;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .content-section,
    section {
        padding: 3rem 0;
    }

    .service-card,
    .feature-card,
    .contact-card {
        padding: 1.5rem;
        min-height: auto;
    }

    .btn {
        width: 100%;
        max-width: 300px;
        font-size: 1rem;
        padding: 16px 28px;
    }

    /* Simplified mobile hover effects */
    .service-card:hover,
    .feature-card:hover,
    .contact-card:hover {
        transform: translateY(-8px) scale(1.01);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .content-section,
    section {
        padding: 2.5rem 0;
    }

    .service-card,
    .feature-card,
    .contact-card {
        padding: 1.2rem;
    }

    .btn {
        font-size: 0.95rem;
        padding: 14px 24px;
        max-width: 280px;
    }
}

/* Critical Performance Optimizations */
/* Prevent FOUC (Flash of Unstyled Content) */
.loading {
    visibility: hidden !important;
}

/* Optimize images for faster loading */
img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[src] {
    opacity: 1;
}

/* Prevent layout shifts during loading */
img[width][height] {
    aspect-ratio: attr(width) / attr(height);
}

/* Critical resource hints */
.loading-screen img {
    loading: eager;
    decoding: sync;
    fetchpriority: high;
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* GPU acceleration for smooth animations */
.loading-screen,
.service-card,
.feature-card,
.btn {
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform, opacity;
}

/* Reduce paint complexity */
.loading-screen *,
.service-card *,
.feature-card * {
    contain: layout style paint;
}

/* Enhanced Focus States */
*:focus-visible {
    outline: 3px solid rgba(154, 205, 50, 0.8);
    outline-offset: 2px;
    transition: outline 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Image Optimizations */
img {
    max-width: 100%;
    height: auto;
    loading: lazy;
    decoding: async;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backface-visibility: hidden;
    transform: translateZ(0);
}

img:hover {
    transform: scale(1.05);
    filter: brightness(1.1) contrast(1.1);
}

/* Print Styles */
@media print {
    .loading-screen,
    .header,
    .btn,
    .floating-elements {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000 !important;
        border: 3px solid #000 !important;
        color: #fff !important;
    }

    .btn-secondary {
        background: #fff !important;
        color: #000 !important;
        border: 3px solid #000 !important;
    }

    .loading-screen {
        background: #000 !important;
    }

    .brand-logo,
    .service-card,
    .feature-card {
        border: 2px solid #fff !important;
    }
}