/* Fixes for text overlap issues */

/* Ensure proper stacking context */
section {
    position: relative;
    isolation: isolate;
}

/* Hero section specific fixes */
.hero {
    position: relative;
    z-index: 1;
    margin-bottom: 0;
}

.hero-content {
    position: relative;
    z-index: 5;
    padding-bottom: 20px;
}

.hero-text {
    position: relative;
    z-index: 6;
}

.hero-visual {
    position: relative;
    z-index: 4;
}

/* Features section fixes */
.features {
    position: relative;
    z-index: 10;
    margin-top: -1px; /* Prevent gap */
    background: var(--light-color);
}

.features .container {
    position: relative;
    z-index: 11;
}

/* Section transitions */
.section-transition {
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--light-color));
    position: relative;
    z-index: 8;
    margin-top: -40px;
}

/* Buttons protection */
.btn {
    position: relative;
    z-index: 15;
}

/* Cards and content */
.feature-card,
.robot-card,
.price-card,
.case-card {
    position: relative;
    z-index: 12;
}

/* Navigation always on top */
.navbar {
    z-index: 1000 !important;
}

/* Modal on top of everything */
.modal,
.video-modal {
    z-index: 2000 !important;
}

/* Mobile menu */
.nav-menu {
    z-index: 999 !important;
}

/* Smooth scroll padding */
html {
    scroll-padding-top: 80px;
}

/* Prevent text selection overlap */
::selection {
    background: rgba(37, 99, 235, 0.2);
}

/* Additional mobile fixes */
@media (max-width: 768px) {
    .hero {
        padding-bottom: 60px;
    }
    
    .features {
        padding-top: 80px;
    }
    
    .hero-content {
        padding-bottom: 10px;
    }
    
    html {
        scroll-padding-top: 70px;
    }
}

@media (max-width: 576px) {
    .hero {
        padding-bottom: 40px;
    }
    
    .features {
        padding-top: 60px;
    }
    
    html {
        scroll-padding-top: 60px;
    }
}

/* Ensure animations don't cause overlap */
[data-animate] {
    position: relative;
    z-index: inherit;
}

/* Fix for sticky elements */
.sticky {
    position: sticky;
    top: 80px;
    z-index: 20;
}

/* Backdrop filters fix */
@supports (backdrop-filter: blur(10px)) {
    .navbar {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
    .hero-content {
        transform: translateZ(0);
    }
    
    .features {
        transform: translateZ(0);
    }
}

/* Safari specific fixes */
@supports (-webkit-appearance: none) {
    .hero-content {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .features {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Edge specific fixes */
@supports (-ms-ime-align: auto) {
    .hero-content {
        transform: translateZ(0);
    }
    
    .features {
        transform: translateZ(0);
    }
}