/* Custom Animations */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(1.1);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.animate-fade-in-up {
    animation: fade-in-up 0.8s ease-out;
}

.animate-fade-in {
    animation: fade-in 0.8s ease-out;
}

/* Hero Pattern */
.hero-pattern {
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23D4AF37" fill-opacity="0.05"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
}

/* Service Cards */
.service-card {
    animation: fade-in 0.8s ease-out both;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

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

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

::-webkit-scrollbar-thumb {
    background: #8B6F47;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2C1810;
}

/* CTA Buttons */
.cta-button {
    position: relative;
    overflow: hidden;
}

.cta-button::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 0.5s;
}

.cta-button:hover::before {
    left: 100%;
}

/* Testimonial Cards Hover */
.testimonial-card {
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
}

/* Location Badges */
.location-badge {
    transition: all 0.3s ease;
}

.location-badge:hover {
    transform: scale(1.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-pattern {
        opacity: 0.3;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Hero Slideshow */
.hero-slideshow {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    z-index: 0;
}

.hero-slide.active {
    opacity: 1;
    animation: slideIn 2s ease-in-out;
    z-index: 1;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Testimonials Carousel */
.testimonials-grid {
    position: relative;
}

/* Mobile Carousel Styles */
@media (max-width: 768px) {
    .testimonials-grid {
        display: block;
        position: relative;
    }
    
    .testimonial-card {
        display: none;
        opacity: 0;
        transform: translateX(50px);
    }
    
    .testimonial-card.active {
        display: block;
        opacity: 1;
        transform: translateX(0);
        animation: slideInTestimonial 0.5s ease-out;
    }
}

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

/* Dot Indicators */
.dot {
    cursor: pointer;
}

.dot.active {
    transform: scale(1.3);
}

.dot:hover {
    opacity: 0.8;
}

/* Language Float Switcher */
.lang-float-switcher {
    position: relative;
}

.lang-selected {
    cursor: pointer;
    user-select: none;
}

.lang-selected:hover {
    transform: translateY(-2px);
}

.lang-selected:active {
    transform: translateY(0);
}

#langArrow.rotate {
    transform: rotate(180deg);
}

.lang-options {
    animation: slideUpFade 0.3s ease-out;
}

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

.lang-option-btn:hover img {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Mobile adjustments for language selector */
@media (max-width: 640px) {
    #langFloatWrapper {
        bottom: 5rem !important; /* 80px - Safe area for mobile gestures */
        left: 1rem;
    }
    
    .lang-selected {
        padding: 0.625rem 0.75rem;
        gap: 0.5rem;
    }
    
    .lang-options {
        min-width: 160px;
    }
    
    #currentLangCode {
        font-size: 0.75rem;
    }
}

/* Off-Canvas Menu */
.off-canvas-menu {
    visibility: hidden;
    transition: visibility 0s linear 1.2s;
    will-change: transform, opacity;
}

.off-canvas-menu:not(.hidden) {
    visibility: visible;
    transition-delay: 0s;
}

.off-canvas-overlay {
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity;
}

.off-canvas-menu:not(.hidden) .off-canvas-overlay {
    opacity: 1;
}

.off-canvas-content {
    opacity: 0;
    transform: translateX(100%);
    transition: transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s;
    will-change: transform, opacity;
}

.off-canvas-menu:not(.hidden) .off-canvas-content {
    opacity: 1;
    transform: translateX(0);
}

/* Off-Canvas Links Animation */
.off-canvas-link {
    opacity: 0;
    transform: translateX(30px);
    animation: none;
    will-change: transform, opacity;
}

.off-canvas-menu:not(.hidden) .off-canvas-link {
    animation: slideInLink 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.off-canvas-menu:not(.hidden) .off-canvas-link:nth-child(2) {
    animation-delay: 0.7s;
}

.off-canvas-menu:not(.hidden) .off-canvas-link:nth-child(3) {
    animation-delay: 0.85s;
}

.off-canvas-menu:not(.hidden) .off-canvas-link:nth-child(4) {
    animation-delay: 1s;
}

@keyframes slideInLink {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Prevent body scroll when menu is open */
body {
    transition: padding-right 0.3s ease;
}

body.menu-open {
    overflow: hidden;
}

/* Smooth transition for header padding */
header {
    transition: padding-right 0.3s ease;
}

/* Menu button animation */
#menuIcon,
#closeIcon {
    transform-origin: center;
}

#menuIcon {
    animation: none;
}

#closeIcon {
    animation: none;
}

body.menu-open #menuIcon {
    animation: rotateOut 0.3s ease-out forwards;
}

body.menu-open #closeIcon {
    animation: rotateIn 0.3s ease-out forwards;
}

@keyframes rotateOut {
    from {
        transform: rotate(0deg);
        opacity: 1;
    }
    to {
        transform: rotate(90deg);
        opacity: 0;
    }
}

@keyframes rotateIn {
    from {
        transform: rotate(-90deg);
        opacity: 0;
    }
    to {
        transform: rotate(0deg);
        opacity: 1;
    }
}
