/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #fbbf24;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal-on-scroll {
    opacity: 0;
    transition: all 1s ease-out;
    transform: translateY(30px);
}

.reveal-on-scroll.active {
    opacity: 1;
    transform: translateY(0);
}

/* Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Language Direction Support */
html[dir="rtl"] body {
    text-align: right;
}

html[dir="ltr"] body {
    text-align: left;
}

/* Text alignment adjustments for LTR */
html[dir="ltr"] .text-right,
html[dir="ltr"] .md\:text-right {
    text-align: left !important;
}

html[dir="ltr"] .text-center {
    text-align: center !important;
}

/* Padding adjustments for LTR */
html[dir="ltr"] .md\:pr-10 {
    padding-right: 0 !important;
    padding-left: 2.5rem !important;
}

html[dir="ltr"] .border-r-4 {
    border-right: 0 !important;
    border-left: 4px solid #fbbf24 !important;
}

html[dir="ltr"] .pr-4 {
    padding-right: 0 !important;
    padding-left: 1rem !important;
}

/* Margin adjustments for LTR */
html[dir="ltr"] .mr-auto {
    margin-right: 0 !important;
    margin-left: auto !important;
}

html[dir="ltr"] .space-x-reverse {
    flex-direction: row-reverse;
}

/* Navigation menu order for LTR - keep natural order (Home first from left) */
@media (min-width: 768px) {
    html[dir="ltr"] nav .hidden.md\:flex {
        flex-direction: row !important;
        gap: 1rem;
        margin-left: 0;
        padding-left: 0;
    }
    
    /* Ensure language switcher stays at the end */
    html[dir="ltr"] nav .hidden.md\:flex #lang-switcher {
        order: 10;
    }
}

/* Hero section alignment for LTR */
html[dir="ltr"] .justify-center.md\:justify-start {
    justify-content: center;
}

@media (min-width: 768px) {
    html[dir="ltr"] .md\:justify-start {
        justify-content: flex-start !important;
    }
}

/* Fix hero section spacing on mobile for English */
@media (max-width: 767px) {
    html[dir="ltr"] #home {
        padding-bottom: 3rem;
    }
    
    html[dir="ltr"] #home .relative.z-20.container {
        padding-top: 5rem;
        padding-bottom: 2rem;
    }
    
    html[dir="ltr"] #home .max-w-5xl {
        margin-top: 0;
        padding-top: 1rem;
        margin-bottom: 2rem;
    }
    
    html[dir="ltr"] #home .flex.flex-col {
        gap: 1.5rem;
    }
}

/* About image overlay styling */
.about-image {
    filter: brightness(0.7) saturate(0.75) contrast(0.95);
}

/* Force LTR direction for numbers */
.dir-ltr,
[dir="ltr"] {
    direction: ltr;
    text-align: left;
    display: inline-block;
}

/* Brand Logo Styles */
.brand-logo-sintec {
    filter: none;
    /* SINTEC logo should be red - already red in SVG */
}

.brand-logo-rolf {
    filter: none;
    /* ROLF logo should be black with German flag colors - already in SVG */
}

/* Image Carousel Styles */
.carousel-viewport {
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    scroll-padding: 0.5rem; /* matches mobile padding */
}

.carousel-viewport::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.carousel-image {
    width: 100%;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: high-quality;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

@media (min-width: 768px) {
    .carousel-image {
        width: calc(50% - 0.5rem);
    }
    .carousel-viewport {
        scroll-padding: 0;
    }
}

@media (min-width: 1024px) {
    .carousel-image {
        width: calc(33.333% - 0.67rem);
    }
}

#image-carousel img {
    transition: opacity 0.3s ease;
}

#image-carousel img:hover {
    opacity: 0.9;
}

#carousel-prev,
#carousel-next {
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#carousel-prev:hover,
#carousel-next:hover {
    transform: scale(1.1);
}