html { 
    scroll-behavior: smooth; 
}

/* Hero Background - Light Version */
.hero-bg {
    background-image: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7)), 
                      url('https://images.unsplash.com/photo-1436491865332-7a61a109cc05?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Malaysia Specific Background - Light Flag Theme */
.malaysia-bg {
    background-image: linear-gradient(135deg, rgba(240, 248, 255, 0.85) 0%, rgba(255, 240, 240, 0.85) 100%), 
                      url('https://images.unsplash.com/photo-1596422846543-75c6fc197f07?ixlib=rb-1.2.1&auto=format&fit=crop&w=1000&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Estonia Specific Background - Light Flag Theme */
.estonia-bg {
    background-image: linear-gradient(to bottom, rgba(230, 242, 255, 0.85) 0%, rgba(240, 240, 240, 0.85) 100%), 
                      url('https://images.unsplash.com/photo-1561314358-0050b556c523?ixlib=rb-1.2.1&auto=format&fit=crop&w=1000&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Mobile optimization */
.tap-target {
    min-height: 48px;
    min-width: 48px;
}

/* CSS Only Mobile Menu Logic */
#menu-toggle:checked ~ #mobile-menu {
    display: block;
}

/* Smooth transitions for all interactive elements */
a, button {
    transition: all 0.3s ease;
}

/* Enhanced focus states for accessibility */
a:focus, button:focus, input:focus, select:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #3B82F6;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563EB;
}

/* Prevent layout shift during page load */
img {
    max-width: 100%;
    height: auto;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .hero-bg, 
    .malaysia-bg, 
    .estonia-bg {
        background-attachment: scroll;
    }
    
    /* Improve touch targets on mobile */
    .tap-target {
        min-height: 48px;
        min-width: 48px;
    }
}

/* Print styles */
@media print {
    .fixed,
    nav,
    #mobile-bottom-bar,
    .floating-whatsapp {
        display: none !important;
    }
}

/* Animation for form submission success */
@keyframes successPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.success-animation {
    animation: successPulse 0.5s ease-in-out;
}

/* Loading state for buttons */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Improved mobile menu animation */
#mobile-menu {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced card hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Gradient text animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: #3B82F6;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-main:focus {
    top: 0;
}

/* Performance optimization - reduce motion for users who prefer it */
@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;
    }
}

/* Cookie Consent Banner Animations */
@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

#cookieConsentBanner {
    animation: slideUp 0.4s ease-out reverse;
}
