/* Custom styles to complement Tailwind CSS */

/* Media Loading States - Handle broken images and videos gracefully */
img {
    transition: opacity 0.3s ease;
}

video {
    transition: opacity 0.3s ease;
}

/* Only hide broken images, not loading ones */
img[src=""]:not(.loaded),
img:not([src]):not(.loaded) {
    opacity: 0;
    background: transparent;
    border: none;
    font-size: 0;
}

/* Hide broken videos - only if they have no src and no source elements */
video:not([src]):not(:has(source)) {
    opacity: 0;
    background: transparent;
}

video[src=""] {
    opacity: 0;
    background: transparent;
}

/* Ensure videos with valid sources are visible */
video[src]:not([src=""]),
video:has(source[src]:not([src=""])) {
    opacity: 1;
}

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Custom focus styles for form elements */
input:focus, textarea:focus {
    box-shadow: 0 0 0 2px rgba(0, 168, 107, 0.2);
}

/* Custom hover effect for buttons */
.hover-scale {
    transition: transform 0.2s ease-in-out;
}

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

/* Growing underline effect for anchor tags */
.underline-effect {
    position: relative;
    transition: color 0.3s ease;
}

.underline-effect::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #00A86B;
    transition: width 0.3s ease;
}

.underline-effect:hover::after {
    width: 100%;
}

/* Special handling for flex containers */
.underline-effect.flex::after {
    bottom: -4px;
}

/* Alternative underline effect using span element (for existing nav links) */
.underline-effect-span {
    position: relative;
    display: inline-block;
}

.underline-effect-span::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #00A86B;
    transition: width 0.3s ease;
}

.underline-effect-span:hover::after {
    width: 100%;
}

/* Custom animation for the hero section */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

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

.animate-slide-in-left {
    animation: slideInLeft 1s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 1s ease-out;
}

/* Staggered animations for service cards */
.hero-service-card:nth-child(1) { animation-delay: 0.2s; }
.hero-service-card:nth-child(2) { animation-delay: 0.4s; }
.hero-service-card:nth-child(3) { animation-delay: 0.6s; }
.hero-service-card:nth-child(4) { animation-delay: 0.8s; }

/* Enhanced hover effects for hero elements */
.hero-cta-primary {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.hero-cta-primary::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;
}

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

/* Glass morphism effect for service cards */
.glass-card {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Hero section video background styles */
#home {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

#home video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0;
}

/* Ensure video covers the entire section on all devices */
@media (max-width: 768px) {
    #home video {
        height: 100%;
        width: auto;
    }
}

/* Service cards modern styling */
.service-card {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

.service-card img {
    transition: transform 0.3s ease-in-out;
}

.service-card:hover img {
    transform: scale(1.1);
}

/* Projects Carousel Custom Styles */
.projects-swiper {
    padding: 20px 0 60px 0;
}

.swiper-slide {
    height: auto;
}

.swiper-button-next,
.swiper-button-prev {
    color: #00A86B;
    background: rgba(255, 255, 255, 0.9);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: #00A86B;
    color: white;
    transform: scale(1.1);
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 20px;
    font-weight: bold;
}

.swiper-pagination-bullet {
    background: #00A86B;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.2);
}

/* Clients Carousel Styles */
.clients-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.clients-track {
    display: flex;
    animation: scroll 30s linear infinite;
    width: max-content;
}

.clients-track:hover {
    animation-play-state: paused;
}

.client-logo {
    min-width: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.client-logo img {
    width: 120px;
    height: 80px;
    object-fit: contain;
    transition: all 0.3s ease;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Responsive adjustments for clients carousel */
@media (max-width: 768px) {
    .client-logo {
        min-width: 150px;
    }
    
    .client-logo img {
        width: 100px;
        height: 70px;
    }
    
    .clients-track {
        animation-duration: 20s;
    }
}

@media (max-width: 480px) {
    .client-logo {
        min-width: 120px;
    }
    
    .client-logo img {
        width: 80px;
        height: 60px;
    }
    
    .clients-track {
        animation-duration: 15s;
    }
}

/* Custom styles for the language selector */
#languageSelect {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Modern Header Styles */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #00A86B, #059669);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Header scroll effect */
.header-scrolled {
    backdrop-filter: blur(20px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Logo gradient animation */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.logo-gradient {
    background: linear-gradient(45deg, #00A86B, #059669, #00A86B, #10B981);
    background-size: 300% 300%;
    animation: gradientShift 4s ease-in-out infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Smooth transitions for all interactive elements */
* {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Enhanced focus states for accessibility */
.nav-link:focus,
.mobile-nav-link:focus,
button:focus {
    outline: 2px solid #00A86B;
    outline-offset: 2px;
}

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

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

::-webkit-scrollbar-thumb {
    background: #00A86B;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #059669;
}

/* Mobile Menu Styles */
#mobileMenu {
    height: 100vh;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

#mobileMenu.active {
    transform: translateX(0%);
}

/* Prevent body scroll when mobile menu is open */
body.menu-open {
    overflow: hidden;
}

/* Mobile menu button animation */
#mobileMenuBtn:focus {
    outline: none;
}

#mobileMenuBtn.active #menuIcon {
    display: none;
}

#mobileMenuBtn.active #closeIcon {
    display: block;
}

#mobileMenuBtn #closeIcon {
    display: none;
}

/* Mobile menu links animation */
#mobileMenu .space-y-8 > div {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

#mobileMenu.active .space-y-8 > div {
    opacity: 1;
    transform: translateY(0);
}

#mobileMenu.active .space-y-8 > div:nth-child(1) { transition-delay: 0.1s; }
#mobileMenu.active .space-y-8 > div:nth-child(2) { transition-delay: 0.2s; }
#mobileMenu.active .space-y-8 > div:nth-child(3) { transition-delay: 0.3s; } 