/* ============================================================
   WELCOME PAGE MOBILE RESPONSIVE STYLES
   Production-Ready Design for ShiftTech Homepage
   ============================================================ */

/* ============================================================
   1. HERO SECTION - MOBILE OPTIMIZATIONS
   ============================================================ */

/* Hero Banner Base Styles */
.hero-banner {
    position: relative;
    overflow: hidden;
}

/* Mobile Typography - Fluid & Responsive */
@media (max-width: 575px) {
    .hero-banner h1 {
        font-size: clamp(2rem, 9vw, 3.5rem) !important;
        line-height: 1.15 !important;
        margin-bottom: 1.25rem !important;
    }

    .hero-banner .hero-subtitle {
        font-size: clamp(0.875rem, 4vw, 1.125rem) !important;
        line-height: 1.65 !important;
        max-width: 100% !important;
    }

    .hero-banner .hero-badge {
        font-size: 0.75rem !important;
        padding: 0.5rem 0.875rem !important;
    }
}

/* Tablet Typography */
@media (min-width: 576px) and (max-width: 991px) {
    .hero-banner h1 {
        font-size: clamp(2.5rem, 6vw, 3.5rem) !important;
        line-height: 1.2 !important;
    }

    .hero-banner .hero-subtitle {
        font-size: 1.125rem !important;
        line-height: 1.7 !important;
    }
}

/* ============================================================
   2. HERO CTA BUTTONS - MOBILE/DESKTOP VISIBILITY
   ============================================================ */

/* Mobile: Show only "Book Discovery Call" */
@media (max-width: 767px) {
    /* HIDE "See Our Work" button on mobile */
    .btn-see-work-mobile-hide {
        display: none !important;
    }

    /* SHOW "Book Discovery Call" prominently */
    .btn-book-call-mobile {
        display: inline-flex !important;
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
        padding: 1rem 1.5rem !important;
        font-size: 1rem !important;
        margin-bottom: 0 !important;
    }

    /* CTA Button Container */
    .hero-cta-container {
        flex-direction: column !important;
        gap: 0 !important;
        width: 100%;
    }

    /* Adjust button wrapper */
    .hero-cta-container > div {
        width: 100% !important;
    }
}

/* Tablet: Show both buttons */
@media (min-width: 768px) and (max-width: 991px) {
    .btn-book-call-mobile,
    .btn-see-work-mobile-hide {
        display: inline-flex !important;
        font-size: 0.875rem !important;
        padding: 0.875rem 1.25rem !important;
    }

    .hero-cta-container {
        gap: 1rem !important;
        flex-wrap: wrap;
    }
}

/* Desktop: Show both buttons normally */
@media (min-width: 992px) {
    .btn-book-call-mobile,
    .btn-see-work-mobile-hide {
        display: inline-flex !important;
    }
}

/* ============================================================
   3. TRUST INDICATORS - MOBILE OPTIMIZATION
   ============================================================ */

@media (max-width: 575px) {
    .trust-indicators {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
        margin-top: 1.5rem !important;
    }

    .trust-indicators > div {
        width: 100%;
    }

    .trust-indicators .tw-text-sm {
        font-size: 0.8125rem !important;
    }

    /* Client avatars adjustment */
    .client-avatars .rounded-circle {
        width: 28px !important;
        height: 28px !important;
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .trust-indicators {
        gap: 1rem !important;
    }
}

/* ============================================================
   4. CODE SHOWCASE - MOBILE RESPONSIVE
   ============================================================ */

@media (max-width: 991px) {
    .hero-code-showcase {
        margin-top: 2.5rem !important;
        padding: 1.25rem !important;
    }

    .hero-code-showcase pre {
        font-size: 0.75rem !important;
        line-height: 1.5 !important;
        overflow-x: auto;
    }

    .hero-code-showcase code {
        white-space: pre;
        display: block;
    }
}

@media (max-width: 575px) {
    .hero-code-showcase {
        padding: 1rem !important;
        border-radius: 1rem !important;
    }

    .hero-code-showcase pre {
        font-size: 0.6875rem !important;
    }

    /* Browser dots */
    .hero-code-showcase .browser-dots > div {
        width: 10px !important;
        height: 10px !important;
    }
}

/* ============================================================
   5. FEATURE MARQUEE - MOBILE OPTIMIZATION
   ============================================================ */

@media (max-width: 575px) {
    .top-features-slider {
        padding: 0.5rem 0 !important;
    }

    .top-features-slider .tw-gap-3 {
        gap: 0.5rem !important;
    }

    .top-features-slider .ph-bold {
        font-size: 1.25rem !important;
    }

    .top-features-slider .fw-medium {
        font-size: 0.8125rem !important;
    }
}

/* ============================================================
   6. BRAND SLIDER - MOBILE OPTIMIZATION
   ============================================================ */

@media (max-width: 767px) {
    .brand-slider .brand-logo {
        max-height: 2.5rem !important;
    }

    .brand-slider .swiper-slide {
        padding: 0.5rem !important;
    }
}

/* ============================================================
   7. ABOUT SECTION - MOBILE LAYOUT
   ============================================================ */

@media (max-width: 991px) {
    .about-section .gradient-bg-one {
        padding: 2rem 1.5rem !important;
        border-radius: 2rem !important;
    }

    .about-section h2 {
        font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
        line-height: 1.25 !important;
    }

    .about-section .section-heading {
        margin-bottom: 2rem !important;
    }
}

@media (max-width: 575px) {
    .about-section .gradient-bg-one {
        padding: 1.5rem 1rem !important;
        border-radius: 1.5rem !important;
    }

    .about-section img {
        width: 100%;
        height: auto;
        border-radius: 1rem !important;
    }

    .about-section h6 {
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }

    .about-section p {
        font-size: 0.875rem !important;
        line-height: 1.6 !important;
    }

    /* Feature cards in about section */
    .about-feature-card {
        padding: 1.25rem !important;
        margin-bottom: 1rem !important;
    }

    .about-feature-card i {
        font-size: 2rem !important;
    }
}

/* ============================================================
   8. SERVICES SECTION - MOBILE GRID
   ============================================================ */

@media (max-width: 991px) {
    .services-section .section-heading {
        text-align: center;
        margin-bottom: 2.5rem !important;
    }

    .services-section h2 {
        font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
    }

    .service-card {
        margin-bottom: 1.5rem !important;
    }
}

@media (max-width: 575px) {
    .service-card {
        padding: 1.5rem !important;
        border-radius: 1.25rem !important;
    }

    .service-card h4 {
        font-size: 1.125rem !important;
        margin-bottom: 0.75rem !important;
    }

    .service-card p {
        font-size: 0.875rem !important;
    }

    .service-card i {
        font-size: 2.5rem !important;
    }
}

/* ============================================================
   9. STATS/NUMBERS SECTION - MOBILE LAYOUT
   ============================================================ */

@media (max-width: 767px) {
    .stats-section {
        padding: 3rem 0 !important;
    }

    .stat-card {
        margin-bottom: 2rem !important;
        text-align: center;
    }

    .stat-card h2,
    .stat-card h3 {
        font-size: clamp(2rem, 8vw, 3rem) !important;
    }

    .stat-card p {
        font-size: 0.875rem !important;
    }
}

/* ============================================================
   10. TESTIMONIALS - MOBILE CAROUSEL
   ============================================================ */

@media (max-width: 767px) {
    .testimonial-card {
        padding: 1.5rem !important;
        margin-bottom: 1.5rem;
    }

    .testimonial-card .quote-text {
        font-size: 0.9375rem !important;
        line-height: 1.6 !important;
    }

    .testimonial-card .author-name {
        font-size: 0.875rem !important;
    }

    .testimonial-card .author-title {
        font-size: 0.75rem !important;
    }
}

/* ============================================================
   11. CTA SECTION - MOBILE OPTIMIZATION
   ============================================================ */

@media (max-width: 767px) {
    .cta-section {
        padding: 3rem 1rem !important;
        text-align: center;
    }

    .cta-section h2 {
        font-size: clamp(1.5rem, 7vw, 2.25rem) !important;
        margin-bottom: 1rem !important;
    }

    .cta-section p {
        font-size: 1rem !important;
        margin-bottom: 2rem !important;
    }

    .cta-section .btn {
        width: 100%;
        max-width: 320px;
        padding: 1rem 1.5rem !important;
    }
}

/* ============================================================
   12. PORTFOLIO/WORK PREVIEW - MOBILE GRID
   ============================================================ */

@media (max-width: 991px) {
    .portfolio-preview .portfolio-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .portfolio-card {
        margin-bottom: 1.5rem;
    }

    .portfolio-card img {
        width: 100%;
        height: auto;
        aspect-ratio: 16/10;
        object-fit: cover;
    }
}

@media (max-width: 575px) {
    .portfolio-card {
        border-radius: 1rem !important;
        overflow: hidden;
    }

    .portfolio-card .card-body {
        padding: 1.25rem !important;
    }

    .portfolio-card h5 {
        font-size: 1.125rem !important;
    }

    .portfolio-card p {
        font-size: 0.875rem !important;
    }
}

/* ============================================================
   13. TOUCH TARGET OPTIMIZATION
   ============================================================ */

@media (max-width: 991px) {
    /* Ensure all interactive elements are at least 44x44px */
    a.btn,
    button,
    .clickable-element {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1.25rem;
    }

    /* Increase spacing between touch targets */
    .btn + .btn {
        margin-left: 0;
        margin-top: 0.75rem;
    }
}

/* ============================================================
   14. SPACING & PADDING ADJUSTMENTS
   ============================================================ */

@media (max-width: 991px) {
    /* Section padding reduction */
    section.py-100,
    .py-100 {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }

    section.py-120,
    .py-120 {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    /* Container padding */
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

@media (max-width: 575px) {
    section.py-100,
    .py-100 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    section.py-120,
    .py-120 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    /* Reduce gap utilities */
    .tw-gap-42-px {
        gap: 1rem !important;
    }

    .tw-gap-6 {
        gap: 1rem !important;
    }
}

/* ============================================================
   15. ANIMATION PERFORMANCE ON MOBILE
   ============================================================ */

@media (max-width: 767px) {
    /* Reduce animation complexity on lower-end devices */
    [data-aos] {
        transition-duration: 0.4s !important;
    }

    /* Disable complex animations if user prefers reduced motion */
    @media (prefers-reduced-motion: reduce) {
        [data-aos] {
            animation: none !important;
            transition: none !important;
        }
    }
}

/* ============================================================
   16. IMAGE OPTIMIZATION FOR MOBILE
   ============================================================ */

@media (max-width: 767px) {
    /* Ensure images don't overflow */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Background images - contain on mobile */
    .hero-banner .position-absolute img {
        opacity: 0.15 !important;
    }
}

/* ============================================================
   17. LANDSCAPE ORIENTATION FIXES
   ============================================================ */

@media (max-width: 991px) and (orientation: landscape) {
    .hero-banner {
        min-height: auto !important;
        padding: 3rem 0 !important;
    }

    .hero-banner h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem) !important;
    }

    .hero-code-showcase {
        margin-top: 1.5rem !important;
    }
}

/* ============================================================
   18. ACCESSIBILITY ENHANCEMENTS
   ============================================================ */

@media (max-width: 991px) {
    /* Focus states for keyboard navigation */
    a:focus,
    button:focus {
        outline: 2px solid #74b812;
        outline-offset: 3px;
    }

    /* Improve contrast for mobile */
    .text-white {
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
}

/* ============================================================
   19. BUTTON HOVER STATES - MOBILE TOUCH FEEDBACK
   ============================================================ */

@media (max-width: 991px) {
    /* Active/press states for touch feedback */
    .btn:active {
        transform: scale(0.98) !important;
        transition: transform 0.1s ease;
    }

    /* Remove hover effects on touch devices */
    @media (hover: none) {
        .hover--translate-y-1:hover {
            transform: none;
        }
    }
}

/* ============================================================
   20. SPECIFIC ELEMENT FIXES
   ============================================================ */

/* Fix for inline button labels */
@media (max-width: 575px) {
    .button__label {
        font-size: 0.9375rem !important;
        white-space: nowrap;
    }

    .button__flair {
        display: none; /* Hide decorative elements on small screens */
    }
}

/* Badge adjustments */
@media (max-width: 575px) {
    .hero-badge,
    .rounded-pill.text-white {
        font-size: 0.75rem !important;
        padding: 0.5rem 0.875rem !important;
        white-space: nowrap;
    }
}

/* Code block scrolling on mobile */
@media (max-width: 575px) {
    pre {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    pre::-webkit-scrollbar {
        height: 6px;
    }

    pre::-webkit-scrollbar-thumb {
        background: rgba(116, 184, 18, 0.5);
        border-radius: 3px;
    }
}

/* ============================================================
   21. RECENT WORK SECTION - MOBILE EDGE SPACING FIX
   ============================================================ */

/* Add proper padding to Recent Work showcase section on mobile */
@media (max-width: 991px) {
    .recent-work-section {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    /* Add padding to swiper container to prevent edge-to-edge slides */
    .recent-work-slider {
        padding-left: 0;
        padding-right: 0;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    /* Center the slide content with proper margins */
    .recent-work-slider .swiper-slide {
        padding: 0 1rem;
    }

    /* Ensure text content has proper spacing */
    .recent-work-section .group-item {
        margin: 0 auto;
        max-width: 100%;
    }

    /* Add spacing to the text below images */
    .recent-work-section .group-item > div:last-child {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        text-align: center;
        margin-top: 1.5rem !important;
    }

    /* Center the heading section */
    .recent-work-header {
        padding-left: 1rem;
        padding-right: 1rem;
        margin-bottom: 2.5rem !important;
    }
}

@media (max-width: 767px) {
    /* Tablet and large phone adjustments */
    .recent-work-section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }

    .recent-work-slider .swiper-slide {
        padding: 0 0.875rem;
    }

    /* Heading adjustments */
    .recent-work-section h3 {
        font-size: clamp(1.5rem, 6vw, 2rem) !important;
        line-height: 1.3 !important;
    }

    .recent-work-section .group-item > div:last-child {
        margin-top: 1.25rem !important;
    }
}

@media (max-width: 575px) {
    /* More aggressive padding on very small screens */
    .recent-work-section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .recent-work-slider .swiper-slide {
        padding: 0 0.75rem;
    }

    /* Image container with proper spacing and rounded corners */
    .recent-work-section .tw-rounded-28-px {
        border-radius: 1.25rem !important;
        margin-left: 0.25rem;
        margin-right: 0.25rem;
    }

    /* Text content centering and spacing */
    .recent-work-section .group-item > div:last-child {
        padding-left: 1rem;
        padding-right: 1rem;
        margin-top: 1rem !important;
    }

    /* Heading adjustments */
    .recent-work-section h3 {
        font-size: 1.5rem !important;
        padding: 0 0.5rem;
        line-height: 1.35 !important;
    }

    /* Badge text size */
    .recent-work-header .rounded-pill {
        font-size: 0.6875rem !important;
        padding: 0.375rem 0.75rem !important;
    }

    /* Project title and description */
    .recent-work-section .tw-text-base {
        font-size: 0.8125rem !important;
    }

    .recent-work-section h5 {
        font-size: 0.9375rem !important;
        margin-top: 0.375rem !important;
    }

    /* Ensure images are properly sized */
    .recent-work-section .tw-max-h-410-px {
        max-height: 280px !important;
    }
}

/* ============================================================
   22. TOP FEATURES SLIDER - FOUC FIX (Flash Before Marquee Loads)
   ============================================================ */

/*
   Fix: Prevent vertical stacking flash before marquee JS initializes
   Strategy: Use flexbox to keep items horizontal from the start
*/

.top-features-section {
    /* Ensure section is ready */
    min-height: 60px;
}

.top-features-slider {
    /* CRITICAL: Hide overflow to prevent vertical stacking */
    overflow: hidden !important;

    /* Fixed height to prevent layout shift */
    min-height: 48px;
    max-height: 60px;

    /* Flexbox layout - items stay horizontal before JS loads */
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 2rem;
    align-items: center;

    /* Positioning for marquee plugin */
    position: relative;
    width: 100%;

    /* Prevent any wrapping or stacking */
    white-space: nowrap;
}

/* Direct children must be inline and not wrap */
.top-features-slider > div {
    /* Keep items in a row */
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center;
    white-space: nowrap;

    /* Ensure spacing between items */
    margin-right: 2rem;
}

/* Ensure inner flex containers stay inline */
.top-features-slider .d-flex {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
}

/* Prevent any text wrapping */
.top-features-slider span,
.top-features-slider i {
    white-space: nowrap !important;
    flex-shrink: 0;
}

/* Add CSS animation as fallback before JS loads */
@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Apply animation only before marquee plugin initializes */
.top-features-slider:not(.marquee):not(.js-marquee-wrapper) {
    /* Subtle CSS animation as fallback */
    animation: marquee-scroll 30s linear infinite;
}

/* When marquee is initialized, it adds .js-marquee-wrapper class */
.top-features-slider.js-marquee-wrapper {
    animation: none;
}

/* Mobile responsive adjustments */
@media (max-width: 991px) {
    .top-features-slider {
        gap: 1.5rem;
        min-height: 44px;
        max-height: 56px;
    }

    .top-features-slider > div {
        margin-right: 1.5rem;
    }
}

@media (max-width: 767px) {
    .top-features-slider {
        gap: 1.25rem;
        min-height: 40px;
        max-height: 52px;
    }

    .top-features-slider > div {
        margin-right: 1.25rem;
    }

    /* Smaller icons on mobile */
    .top-features-slider .ph-bold {
        font-size: 1.25rem !important;
    }

    /* Smaller text on mobile */
    .top-features-slider .tw-text-base,
    .top-features-slider .fw-medium {
        font-size: 0.8125rem !important;
    }
}

@media (max-width: 575px) {
    .top-features-slider {
        gap: 1rem;
        min-height: 36px;
        max-height: 48px;
    }

    .top-features-slider > div {
        margin-right: 1rem;
        gap: 0.5rem !important;
    }

    .top-features-slider .ph-bold {
        font-size: 1rem !important;
    }

    .top-features-slider .tw-text-base,
    .top-features-slider .fw-medium {
        font-size: 0.75rem !important;
    }

    /* Reduce gap between icon and text */
    .top-features-slider .tw-gap-3 {
        gap: 0.5rem !important;
    }
}

/* ============================================================
   23. TESTIMONIAL HEADING - MOBILE LAYOUT FIX
   ============================================================ */

/* Fix testimonial section heading layout on mobile */
@media (max-width: 991px) {
    /* Make the flex container stack vertically on tablet and mobile */
    .testimonial-header-wrapper {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1.5rem !important;
    }

    /* Remove max-width constraint on mobile */
    .testimonial-heading-col {
        max-width: 100% !important;
        width: 100%;
    }

    .testimonial-text-col {
        width: 100%;
    }

    /* Heading typography adjustments */
    .testimonial-main-heading {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
        line-height: 1.3 !important;
        margin-bottom: 0 !important;
        display: block !important;
    }

    /* Paragraph alignment */
    .testimonial-text-col p {
        max-width: 100% !important;
        margin-top: 0 !important;
    }

    /* Section padding adjustment */
    .testimonial-section {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }
}

@media (max-width: 767px) {
    /* More aggressive mobile optimizations */
    .testimonial-header-wrapper {
        gap: 1.25rem !important;
        margin-bottom: 2rem !important;
    }

    /* Heading size reduction for small screens */
    .testimonial-main-heading {
        font-size: clamp(1.25rem, 5.5vw, 1.75rem) !important;
        line-height: 1.35 !important;
    }

    /* Badge adjustments */
    .testimonial-heading-col .rounded-pill {
        font-size: 0.75rem !important;
        padding: 0.5rem 0.875rem !important;
        margin-bottom: 0.75rem !important;
    }

    /* Paragraph text size */
    .testimonial-text-col p {
        font-size: 0.9375rem !important;
        line-height: 1.6 !important;
        margin-top: 0.5rem !important;
    }

    /* Section padding */
    .testimonial-section {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }

    /* Testimonial cards spacing */
    .testimonial-section .row.gy-4 {
        row-gap: 1.25rem !important;
    }
}

@media (max-width: 575px) {
    /* Extra small screens - most compact */
    .testimonial-section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .testimonial-section .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .testimonial-main-heading {
        font-size: 1.25rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.5rem !important;
    }

    .testimonial-text-col p {
        font-size: 0.875rem !important;
        margin-top: 0.5rem !important;
        line-height: 1.65 !important;
    }

    /* Reduce gap between header sections */
    .testimonial-header-wrapper {
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    /* Badge size */
    .testimonial-heading-col .rounded-pill {
        font-size: 0.6875rem !important;
        padding: 0.375rem 0.75rem !important;
        margin-bottom: 0.625rem !important;
    }

    /* Testimonial card adjustments */
    .testimonial-section .tw-rounded-2xl {
        border-radius: 1rem !important;
        padding: 1.5rem !important;
    }

    .testimonial-section .tw-text-xl {
        font-size: 0.9375rem !important;
        line-height: 1.6 !important;
    }

    .testimonial-section .tw-text-lg {
        font-size: 1rem !important;
    }
}
