/* Slider Responsive Fixes - Override existing styles */

/* Fix slider responsive layout - reduce margins */
.slider-container {
    width: 100% !important;
    max-width: 100vw !important;
    overflow: hidden !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
}

.slides {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

.slide {
    width: 100% !important;
    height: auto !important;
    min-height: 60vh !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: clamp(15px, 3vw, 40px) !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    /* Keep original slide positioning logic for proper transitions */
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(100%) !important;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    z-index: 1 !important;
}

/* Fix active slide positioning - make it visible */
.slide.active {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: clamp(15px, 3vw, 40px) !important;
    /* Make active slide visible */
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    z-index: 2 !important;
}

/* Ensure proper slide transitions */
.slide.next {
    transform: translateX(100%) !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.slide.prev {
    transform: translateX(-100%) !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

@media (min-width: 768px) {
    .slide {
        flex-direction: row !important;
        min-height: 70vh !important;
        padding: clamp(20px, 3vw, 50px) !important;
    }

    .slide.active {
        padding: clamp(20px, 3vw, 50px) !important;
    }
}

@media (min-width: 1200px) {
    .slide {
        padding: clamp(30px, 4vw, 60px) clamp(40px, 5vw, 80px) !important;
    }

    .slide.active {
        padding: clamp(30px, 4vw, 60px) clamp(40px, 5vw, 80px) !important;
    }
}

/* DYNAMIC SPACING: Auto-adjusting gap between text and image based on screen size */
.slide-content {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    /* Dynamic gap that scales with screen size */
    gap: clamp(10px, 2vw, 30px) !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: clamp(10px, 2vw, 25px) !important;
    min-height: auto !important;
    height: auto !important;
    /* Ensure content doesn't overflow */
    max-height: calc(100vh - 120px) !important;
    overflow: visible !important;
}

@media (min-width: 768px) {
    .slide-content {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        /* Responsive gap between text and image */
        gap: clamp(15px, 3vw, 40px) !important;
        padding: clamp(15px, 2.5vw, 35px) clamp(25px, 3.5vw, 50px) !important;
    }
}

@media (min-width: 1200px) {
    .slide-content {
        gap: clamp(20px, 4vw, 60px) !important;
        padding: clamp(25px, 3vw, 45px) clamp(40px, 4vw, 70px) !important;
    }
}

@media (min-width: 1400px) {
    .slide-content {
        gap: clamp(25px, 5vw, 70px) !important;
        padding: clamp(35px, 4vw, 60px) clamp(60px, 5vw, 90px) !important;
        max-width: 1400px !important;
    }
}

/* NEW: Compact spacing for very large screens (1600px+) */
@media (min-width: 1600px) {
    .slide-content {
        gap: clamp(20px, 3vw, 50px) !important;
        padding: clamp(25px, 2.5vw, 40px) clamp(40px, 3vw, 60px) !important;
        max-width: 1500px !important;
    }

    .slide-text-content {
        padding: clamp(10px, 1.5vw, 20px) !important;
    }

    .slide-image-content {
        padding: clamp(10px, 1.5vw, 20px) !important;
    }
}

/* RESPONSIVE TEXT AREA: Auto-scaling based on screen size */
.slide-text-content {
    width: 100% !important;
    text-align: center !important;
    order: 2 !important;
    flex: none !important;
    max-width: none !important;
    min-width: auto !important;
    padding: clamp(5px, 1.5vw, 15px) !important;
    margin: 0 !important;
}

@media (min-width: 768px) {
    .slide-text-content {
        width: clamp(45%, 50vw, 55%) !important;
        text-align: left !important;
        order: 1 !important;
        padding: clamp(10px, 2vw, 20px) !important;
    }
}

@media (min-width: 1200px) {
    .slide-text-content {
        width: clamp(30%, 35vw, 40%) !important; /* Reduced from clamp(40%, 45vw, 50%) */
        padding: clamp(15px, 2.5vw, 25px) !important;
    }
}

/* RESPONSIVE IMAGE AREA: Auto-scaling based on screen size */
.slide-image-content {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    order: 1 !important;
    flex: none !important;
    max-width: none !important;
    min-width: auto !important;
    padding: clamp(5px, 1.5vw, 15px) !important;
    margin: 0 !important;
}

@media (min-width: 768px) {
    .slide-image-content {
        width: clamp(40%, 45vw, 50%) !important;
        order: 2 !important;
        padding: clamp(10px, 2vw, 20px) !important;
    }
}

@media (min-width: 1200px) {
    .slide-image-content {
        width: clamp(75%, 65vw, 95%) !important; /* Increased from clamp(65%, 55vw, 60%) */
        padding: clamp(3px, 1.5vw, 0px) clamp(20px, 3vw, 40px) clamp(3px, 1.5vw, 0px) clamp(5px, 1vw, 15px) !important; /* top right bottom left */
    }
}

/* Wide screen image left shift */
@media (min-width: 1400px) {
    .slide-image-content {
        margin-left: 0 !important;
        transform: translateX(-40px) !important;
    }
}

@media (min-width: 1700px) {
    .slide-image-content {
        margin-left: 0 !important;
        transform: translateX(-60px) !important;
    }
}

/* DYNAMIC IMAGE SCALING: Images automatically scale with screen size - 21% larger total */
.slide-robot-image {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
    /* Dynamic image height that scales with viewport - 21% larger than original */
    max-height: clamp(218px, 36.3vh, 339px) !important; /* Increased from 198px, 33vh, 308px */
}

@media (min-width: 768px) {
    .slide-robot-image {
        max-height: clamp(303px, 42.35vh, 460px) !important; /* Increased from 275px, 38.5vh, 418px */
    }
}

@media (min-width: 1200px) {
    .slide-robot-image {
        max-height: clamp(387px, 48.4vh, 581px) !important; /* Increased from 352px, 44vh, 528px */
    }
}

@media (min-width: 1400px) {
    .slide-robot-image {
        max-height: clamp(460px, 54.45vh, 666px) !important; /* Increased from 418px, 49.5vh, 605px */
    }
}

/* IMPROVED BUTTON POSITIONING: Always visible and properly sized */
.slide .button-frame {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    margin-top: clamp(8px, 1.5vw, 15px) !important;
    margin-bottom: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important;
    width: auto !important;
    max-width: 100% !important;
    /* Responsive button sizing */
    padding: clamp(0.6rem, 1.2vw, 1rem) clamp(0.8rem, 1.5vw, 1.2rem) !important;
    font-size: clamp(0.75rem, 1.4vw, 1rem) !important;
    border-radius: clamp(20px, 4vw, 30px) !important;
    /* Ensure button stays within viewport */
    align-self: center !important;
}

@media (min-width: 768px) {
    .slide .button-frame {
        align-self: flex-start !important;
        font-size: clamp(0.85rem, 1.6vw, 1.1rem) !important;
        padding: clamp(0.7rem, 1.3vw, 1.1rem) clamp(0.9rem, 1.6vw, 1.3rem) !important;
    }
}

/* IMPROVED TEXT SIZING: Smaller text to give more space for images */
.slide-title {
    /* Reduced text sizes for better balance with images */
    font-size: clamp(0.9rem, 4vw, 2rem) !important; /* Reduced from clamp(1rem, 5vw, 2.5rem) */
    margin-bottom: clamp(4px, 1vw, 10px) !important; /* Reduced from clamp(6px, 1.2vw, 15px) */
    margin-top: 0 !important;
    line-height: 1.1 !important;
    /* Ensure text fits */
    word-break: break-word !important;
    hyphens: auto !important;
}

@media (min-width: 768px) {
    .slide-title {
        font-size: clamp(1.2rem, 3.5vw, 2.5rem) !important; /* Reduced from clamp(1.4rem, 4vw, 3rem) */
        margin-bottom: clamp(6px, 1.2vw, 15px) !important; /* Reduced from clamp(8px, 1.5vw, 20px) */
        line-height: 1.2 !important;
    }
}

@media (min-width: 1200px) {
    .slide-title {
        font-size: clamp(1.5rem, 4vw, 2.8rem) !important; /* Reduced from clamp(1.8rem, 5vw, 3.5rem) */
        margin-bottom: clamp(8px, 1.5vw, 18px) !important; /* Reduced from clamp(10px, 2vw, 25px) */
    }
}

.slide-description {
    /* Smaller description text for better space utilization */
    font-size: clamp(0.6rem, 2vw, 0.95rem) !important; /* Reduced from clamp(0.7rem, 2.5vw, 1.1rem) */
    line-height: clamp(1.2, 1.3vw, 1.4) !important; /* Reduced from clamp(1.2, 1.4vw, 1.5) */
    margin-bottom: clamp(6px, 1.5vw, 14px) !important; /* Reduced from clamp(8px, 2vw, 18px) */
    margin-top: 0 !important;
    /* Ensure text is readable */
    word-break: break-word !important;
}

@media (min-width: 768px) {
    .slide-description {
        font-size: clamp(0.75rem, 1.8vw, 1.1rem) !important; /* Reduced from clamp(0.85rem, 2vw, 1.3rem) */
        margin-bottom: clamp(10px, 2vw, 18px) !important; /* Reduced from clamp(12px, 2.5vw, 22px) */
        line-height: clamp(1.3, 1.4vw, 1.5) !important; /* Reduced from clamp(1.3, 1.5vw, 1.6) */
    }
}

@media (min-width: 1200px) {
    .slide-description {
        font-size: clamp(0.85rem, 2vw, 1.2rem) !important; /* Reduced from clamp(1rem, 2.5vw, 1.5rem) */
        margin-bottom: clamp(12px, 2.5vw, 20px) !important; /* Reduced from clamp(15px, 3vw, 25px) */
    }
}

/* AGGRESSIVE OVERRIDE: Remove the excessive original padding */
.slide .container-inner {
    padding: 0 !important;
    margin: 0 !important;
}

.slide .text-area {
    padding: 0 !important;
    margin: 0 !important;
}

/* Fix navigation positioning */
.slider-nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 100 !important;
    display: flex !important;
    justify-content: space-between !important;
    left: clamp(10px, 2vw, 25px) !important;
    right: clamp(10px, 2vw, 25px) !important;
    padding: 0 !important;
    pointer-events: none !important;
}

.slider-nav .nav-btn {
    pointer-events: all !important;
    /* Responsive navigation button size */
    width: clamp(40px, 6vw, 60px) !important;
    height: clamp(40px, 6vw, 60px) !important;
}

/* FIXED: Navigation dots positioning - move to bottom of slider */
.slider-indicators {
    position: absolute !important;
    bottom: clamp(10px, 2vh, 25px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 100 !important;
    display: flex !important;
    gap: clamp(6px, 1vw, 12px) !important;
}

.slider-indicators .indicator {
    /* Responsive indicator size */
    width: clamp(8px, 1.5vw, 12px) !important;
    height: clamp(8px, 1.5vw, 12px) !important;
    margin: 0 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
}

/* CRITICAL FIX: Ensure all elements after slider are full width */
.gradient-section,
.introducing-block-info,
.whats-new,
.introducing-block,
.talk-to-us,
footer,
.attribution {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

@media (min-width: 1600px) {
    .talk-to-us .banner {
        min-height: 75vh !important;
    }
}

.carousel {
    width: 87vw !important;
    max-width: 87vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

/* Fix any container elements inside these sections */
.gradient-section .container-inner,
.introducing-block-info .container-inner,
.carousel .container-inner,
.whats-new .container-inner,
.introducing-block .container-inner,
.talk-to-us .container-inner {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

.talk-to-us-2 .container-inner {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding-left: 1px !important;
    padding-right: 1px !important;
}

/* Ensure body and html don't add unwanted spacing */
body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

/* Fix any section that might have restricted width */
.introducing-block-info {
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
}

/* Ensure carousel takes full width */
.carousel {
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
}

/* Fix gradient section specifically */
.gradient-section {
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
}

/* When the slider is hidden on mobile, ensure the next Gradient Section clears the fixed navbar */
@media (max-width: 767.98px) {
  .slider-container + .gradient-section {
    margin-top: calc(var(--nav-height-mobile, 80px) + 14px) !important;
  }
}

/* === Unified Slider Button Styling Override === */
.slide .button-frame,
.slide a.button-frame {
    background: transparent !important;
    border: 2px solid var(--color-accent, #0087dc) !important;
    padding: clamp(0.6rem, 1.2vw, 1rem) clamp(1rem, 1.8vw, 1.4rem) !important;
    font-size: clamp(0.8rem, 1.5vw, 1rem) !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    gap: 0.4rem !important;
    border-radius: 50px !important;
    transform: none !important;
    box-shadow: none !important;
    transition: transform .25s ease, background-color .25s ease, color .25s ease, border-color .25s ease !important;
    animation: none !important;
    opacity: 1 !important;
}

/* Remove gradient / duplicate border pseudo element */
.slide .button-frame::before,
.slide a.button-frame::before,
.slide .button-frame:hover::before,
.slide a.button-frame:hover::before {
    content: none !important;
    display: none !important;
}

/* Simple scale hover effect */
.slide .button-frame:hover,
.slide a.button-frame:hover {
    background: var(--color-accent, #0087dc) !important;
    color: #0a0f14 !important;
    transform: scale(1.05) !important;
    border-color: var(--color-accent, #0087dc) !important;
    padding: clamp(0.6rem, 1.2vw, 1rem) clamp(1rem, 1.8vw, 1.4rem) !important; /* keep size stable */
}

/* Neutralize other hover side-effects */
.slide .button-frame span.icon,
.slide a.button-frame span.icon {
    transition: none !important;
    transform: none !important;
    margin-left: 0.4em !important;
}

.slide .button-frame:hover span.icon,
.slide a.button-frame:hover span.icon {
    transform: none !important;
}

/* === Slide #5 (Automation Costs) full-width adjustments === */
.slide.slide--fullwidth,
.slide.slide--fullwidth.active {
    padding: clamp(5px, 1.5vw, 15px) !important; /* remove excessive outer padding */
}

.slide.slide--fullwidth .slide-content {
    max-width: 100% !important; /* no inner max width cap */
    width: 100% !important;
    padding: clamp(10px, 2vw, 24px) clamp(12px, 2.5vw, 28px) !important; /* tighter */
    gap: clamp(10px, 2vw, 22px) !important;
}

.slide.slide--fullwidth .slide-text-content,
.slide.slide--fullwidth .slide-image-content {
    padding: clamp(4px, 1vw, 12px) !important; /* reduce inner padding */
}

/* Prevent wide-screen left shift used by other slides */
.slide.slide--fullwidth .slide-image-content {
    margin-left: 0 !important;
    transform: none !important;
}

@media (min-width: 768px) {
    /* Use fixed split that sums to 100% */
    .slide.slide--fullwidth .slide-text-content {
        width: 38% !important;
    }

    .slide.slide--fullwidth .slide-image-content {
        width: 62% !important;
    }
}

@media (min-width: 1200px) {
    .slide.slide--fullwidth .slide-content {
        padding: clamp(12px, 2vw, 24px) clamp(18px, 2.5vw, 32px) !important;
        gap: clamp(12px, 2vw, 24px) !important;
    }
}

@media (min-width: 1400px) {
    .slide.slide--fullwidth .slide-content {
        max-width: 100vw !important; /* keep full width even on very wide screens */
    }

    .slide.slide--fullwidth .slide-image-content {
        transform: none !important; /* re-assert no shift on very wide screens */
    }
}

/* === Consistent left alignment between text and buttons within sliders === */
/* Remove inner padding/margins so left edges match exactly */
.slide .slide-text-content .container-inner,
.slide .slide-text-content .text-area,
.slider-container .slide-content .container-inner,
.slider-container .slide-content .text-area {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Ensure text and button share the same left alignment baseline */
.slide .slide-text-content .text-area,
.slider-container .slide-content .text-area {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}

/* Zero any stray left margins on core text elements and the CTA */
.slide .slide-text-content .text-area > .slide-title,
.slide .slide-text-content .text-area > .slide-description,
.slide .slide-text-content .text-area > a.button-frame,
.slider-container .slide-content .text-area > .slide-title,
.slider-container .slide-content .text-area > .slide-description,
.slider-container .slide-content .text-area > a.button-frame {
    margin-left: 0 !important;
}

/* Force the CTA to align with the text start at all widths */
.slide .slide-text-content a.button-frame,
.slider-container .slide-content a.button-frame {
    align-self: flex-start !important;
}

/* === Per-slide Germany flag footer: appears under each slide, right-aligned === */
.slide > .de_flag_slider_container {
    position: static !important;
    width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin-top: clamp(10px, 1.5vh, 16px) !important;
    margin-right: clamp(12px, 2vw, 24px) !important;
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    pointer-events: none !important;
}

/* Ensure no visible overflow during scroll and better perf */
.carousel {
    overflow: hidden !important;
}

.carousel .carousel-track {
    will-change: transform;
}

/* Keep inner visuals compact */
.slide > .de_flag_slider_container .de_flag_slider_bars {
    display: flex !important;
    gap: clamp(4px, 0.6vw, 8px) !important;
    margin: 0 clamp(4px, 0.6vw, 8px) 0 0 !important;
}

.slide > .de_flag_slider_container .de_flag_slider_bar {
    width: clamp(16px, 2.2vw, 26px) !important;
    height: clamp(4px, 0.5vw, 6px) !important;
    border-radius: 2px !important;
}

.slide > .de_flag_slider_container .de_flag_slider_text {
    color: #ffffff !important;
    font-size: clamp(10px, 1.2vw, 12px) !important;
    letter-spacing: clamp(3px, 0.5vw, 6px) !important;
    line-height: 1 !important;
    margin: 0 !important;
}

/* === Carousel card square enforcement === */
/* Force all carousel cards to be square at every breakpoint without touching style.css */
.carousel {
    --card-height: var(--card-width) !important; /* tie height to width */
}

.carousel .deconstructed-card {
    height: var(--card-width) !important; /* ensure 1:1 using the width var */
    aspect-ratio: 1 / 1 !important; /* modern safety net */
}

.carousel .card-layer,
.carousel .card-image,
.carousel .wave-svg {
    width: 100% !important;
    height: 100% !important; /* keep inner layers filling the square */
}

/* === Footer social & CTA color unification === */
/* Make icon backgrounds and button background #129fff, overriding inline/earlier styles */
#social-connect .sc-icon {
    background: #129fff !important;
    color: #129fff !important;
}

#social-connect .sc-icon:hover {
    background: #129fff !important; /* keep the same on hover */
}

#social-connect .sc-cta {
    background: #129fff !important; /* override gradient inline styles */
}

#social-connect .sc-cta:hover {
    background: #129fff !important; /* keep color consistent on hover */
}

/* Fix: prevent info-section images from blocking clicks on buttons/links */
.introducing-block-info .text-area {
    position: relative !important;
    z-index: 2 !important;
}

.introducing-block-info .img-area img {
    pointer-events: none !important;
}

/* Hide entire slider section on small screens */
@media (max-width: 767.98px) {
  .slider-container {
    display: none !important;
    visibility: hidden !important;
  }
}
