/* ===================================================================
   RESPONSIVE FIXES FOR GMAIL CLEANUP
   Purpose: Fix horizontal scroll on 13" MacBook and overlapping on 7"
   Safari Compatibility: Added -webkit- prefixes for better Safari support
   =================================================================== */

/* ===================================================================
   SAFARI-SPECIFIC FIXES
   =================================================================== */

/* Force Safari to respect box-sizing */
*,
*::before,
*::after {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* Fix Safari transform issues */
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {

        .index .body,
        .index .header {
            -webkit-transform: translateX(-50%);
            transform: translateX(-50%);
        }

        .index .image {
            -webkit-transform: translateX(-50%);
            transform: translateX(-50%);
        }

        .landing-page-mobile .image-2 {
            -webkit-transform: scale(0.7);
            transform: scale(0.7);
            -webkit-transform-origin: top center;
            transform-origin: top center;
        }
    }
}

/* ===================================================================
   CRITICAL: Override original media queries that hide desktop <1920px
   =================================================================== */

/* Force desktop to show on screens wider than 1024px */
@media screen and (min-width: 1025px) {
    .screen.index {
        display: flex !important;
    }

    .screen.landing-page-mobile {
        display: none !important;
    }
}

/* Force mobile to show only on screens 1024px and below */
@media screen and (max-width: 1024px) {
    .screen.index {
        display: none !important;
    }

    .screen.landing-page-mobile {
        display: flex !important;
    }
}

/* ===================================================================
   1. RESET FIXED WIDTHS - Remove hardcoded desktop widths
   =================================================================== */

/* Desktop version - make it fluid and properly centered */
.index {
    min-width: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    /* Use flexbox centering - this is the parent container */
    display: flex !important;
    justify-content: center !important;
}

.index .body {
    align-items: center;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 3537px;
    position: relative;
    width: 100% !important;
    max-width: 1920px;
    padding: 0;
    box-sizing: border-box;
    /* IMPORTANT: Remove left/transform - use margin auto for centering */
    left: auto !important;
    transform: none !important;
    margin: 0 auto !important;
}

.index .header {
    width: 100%;
    max-width: 1920px;
    padding: 16px 5%;
    box-sizing: border-box;
    /* IMPORTANT: Remove left/transform for header too */
    left: 0 !important;
    transform: none !important;
    margin: 0 auto !important;
}

/* Hero section needs proper centering */
.index .hero-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===================================================================
   2. RESPONSIVE BREAKPOINTS
   =================================================================== */

/* Large Desktop (1920px and up) - Original design */
@media screen and (min-width: 1920px) {
    .index .body {
        width: 1920px !important;
        margin: 0 auto !important;
        left: auto !important;
        transform: none !important;
    }

    .index .header {
        padding: 16px 99px !important;
        width: 1920px !important;
        margin: 0 auto !important;
        left: 0 !important;
        transform: none !important;
    }
}

/* Medium Desktop & Laptop (1280px - 1919px) - Typical 13" MacBook */
@media screen and (max-width: 1919px) and (min-width: 1025px) {

    /* Proper centering with margin: auto */
    .index .body {
        width: 100% !important;
        max-width: 1920px !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        margin: 0 auto !important;
        left: auto !important;
        transform: none !important;
    }

    .index .header {
        padding: 16px 3% !important;
        width: 100% !important;
        max-width: 1920px !important;
        margin: 0 auto !important;
        left: 0 !important;
        transform: none !important;
    }

    /* Adjust hero section image positioning - keep centered within hero */
    .index .image {
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 1267px;
        position: absolute;
    }

    .index .image-1 {
        width: 100%;
        height: auto;
    }

    /* Title positioning - centered within hero */
    .index .titledescription-1 {
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 930px;
    }

    /* Make feature items responsive */
    .index .items {
        width: 100%;
        justify-content: center;
    }

    .index .item {
        width: calc(50% - 15px);
        min-width: 300px;
    }

    /* Adjust sections padding */
    .index .features-1,
    .index .how-it-works,
    .index .your-privacy-is-our-priority,
    .index .ready-to-clean-your-inbox,
    .index .footer {
        padding-left: 3%;
        padding-right: 3%;
    }
}

/* Tablet (768px - 1024px) */
@media screen and (max-width: 1024px) and (min-width: 768px) {

    /* Hide desktop, show mobile */
    .screen.index {
        display: none !important;
    }

    .screen.landing-page-mobile {
        display: flex !important;
        width: 100%;
        overflow-x: hidden;
    }

    /* Mobile layout adjustments */
    .landing-page-mobile {
        min-width: 100%;
        width: 100%;
    }

    .landing-page-mobile .body-1 {
        width: 100%;
        height: auto;
        min-height: auto;
    }

    .landing-page-mobile .hero-section-1 {
        width: 100%;
        height: auto;
        min-height: 700px;
        padding: 0 20px;
        box-sizing: border-box;
    }

    /* Make items single column on tablet */
    .landing-page-mobile .items-1 {
        width: 100%;
    }

    .landing-page-mobile .item-6 {
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
    }

    /* Adjust text sizes */
    .landing-page-mobile .clean-your-gmail-reclaim-your-space-1 {
        font-size: 48px;
    }
}

/* Small Tablet & Large Phone (480px - 767px) */
@media screen and (max-width: 767px) and (min-width: 481px) {
    .screen.index {
        display: none !important;
    }

    .screen.landing-page-mobile {
        display: flex !important;
        width: 100%;
        overflow-x: hidden;
    }

    .landing-page-mobile {
        min-width: 100%;
        width: 100%;
    }

    .landing-page-mobile .body-1 {
        width: 100%;
        height: auto;
        padding: 0;
    }

    /* Fix hero section */
    .landing-page-mobile .hero-section-1 {
        width: 100%;
        height: auto;
        min-height: 600px;
        padding: 0 15px;
        box-sizing: border-box;
    }

    .landing-page-mobile .header-1 {
        width: 100%;
        padding: 16px 15px;
    }

    /* Fix overlapping elements */
    .landing-page-mobile .titledescription-3 {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        margin-top: 80px;
        padding: 0 15px;
        box-sizing: border-box;
    }

    .landing-page-mobile .image-2 {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        margin-top: 30px;
        transform: scale(0.9);
    }

    /* Text adjustments */
    .landing-page-mobile .clean-your-gmail-reclaim-your-space-1 {
        font-size: 36px;
        line-height: 1.2;
    }

    .landing-page-mobile .effortlessly-manage-1 {
        font-size: 16px;
    }

    /* Buttons */
    .landing-page-mobile .buttons-1 {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .landing-page-mobile .cta-button-4,
    .landing-page-mobile .cta-button-5 {
        width: 100%;
        max-width: 300px;
    }

    /* Sections */
    .landing-page-mobile .features-3,
    .landing-page-mobile .how-it-works-2,
    .landing-page-mobile .your-privacy-is-our-priority-2,
    .landing-page-mobile .ready-to-clean-your-inbox-2 {
        width: 100%;
        padding: 60px 15px;
    }

    .landing-page-mobile .items-1 {
        width: 100%;
    }

    .landing-page-mobile .item-6,
    .landing-page-mobile .item-7 {
        width: 100%;
    }

    /* Footer */
    .landing-page-mobile .footer-1 {
        width: 100%;
        padding: 40px 15px;
    }

    .landing-page-mobile .colum-2 {
        width: 100%;
    }
}

/* Very Small Screens (320px - 480px) - 7" tablets and small phones */
@media screen and (max-width: 480px) {
    .screen.index {
        display: none !important;
    }

    .screen.landing-page-mobile {
        display: flex !important;
        width: 100%;
        overflow-x: hidden;
    }

    .landing-page-mobile {
        min-width: 320px;
        width: 100%;
    }

    .landing-page-mobile .body-1 {
        width: 100%;
        height: auto;
        padding: 0;
        overflow-x: hidden;
    }

    /* Fix hero section for very small screens */
    .landing-page-mobile .hero-section-1 {
        width: 100%;
        height: auto;
        min-height: 500px;
        padding: 0 10px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
    }

    .landing-page-mobile .header-1 {
        width: 100%;
        padding: 12px 10px;
        position: relative;
        top: auto;
        left: auto;
    }

    /* Logo adjustments */
    .landing-page-mobile .logotype-2 {
        gap: 8px;
    }

    .landing-page-mobile .logo-1 {
        width: 36px;
        height: 36px;
    }

    .landing-page-mobile .repeat-group-1-1 {
        width: 28px;
        height: 28px;
    }

    .landing-page-mobile .gmail-cleanup-2 {
        font-size: 16px;
    }

    /* Fix overlapping title and images */
    .landing-page-mobile .titledescription-3 {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        margin-top: 60px;
        margin-bottom: 20px;
        padding: 0 10px;
        box-sizing: border-box;
        z-index: 2;
    }

    .landing-page-mobile .clean-your-gmail-reclaim-your-space-1 {
        font-size: 28px;
        line-height: 1.2;
        margin-bottom: 12px;
    }

    .landing-page-mobile .effortlessly-manage-1 {
        font-size: 14px;
        line-height: 1.4;
    }

    /* Buttons - prevent overlap */
    .landing-page-mobile .buttons-1 {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 12px;
        margin-top: 20px;
    }

    .landing-page-mobile .cta-button-4,
    .landing-page-mobile .cta-button-5,
    .landing-page-mobile .cta-button-6,
    .landing-page-mobile .cta-button-7 {
        width: 100%;
        height: 44px;
        padding: 12px 24px;
        font-size: 14px;
    }

    /* Image section - scale down significantly */
    .landing-page-mobile .image-2 {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: auto;
        margin-top: 20px;
        transform: scale(0.7);
        transform-origin: top center;
        z-index: 1;
    }

    .landing-page-mobile .image-3,
    .landing-page-mobile .image-4 {
        width: 100%;
        height: auto;
    }

    /* Fix radio buttons and inbox elements from overlapping */
    .landing-page-mobile .radio-buttons-1 {
        width: 100%;
        max-width: 200px;
        gap: 6px;
    }

    .landing-page-mobile .radio-button-2,
    .landing-page-mobile .radio-button-3,
    .landing-page-mobile .radio-button-4 {
        width: 100%;
        padding: 10px;
        font-size: 10px;
    }

    /* Background elements */
    .landing-page-mobile .bg-elements-1 {
        width: 100%;
        max-width: 100%;
    }

    /* All sections - fix padding */
    .landing-page-mobile .features-3,
    .landing-page-mobile .how-it-works-2,
    .landing-page-mobile .your-privacy-is-our-priority-2,
    .landing-page-mobile .ready-to-clean-your-inbox-2 {
        width: 100%;
        padding: 40px 10px;
        box-sizing: border-box;
    }

    /* Section titles */
    .landing-page-mobile .powerful-features-1,
    .landing-page-mobile .how-it-works-3,
    .landing-page-mobile .your-privacy-is-our-priority-3 {
        font-size: 28px;
    }

    .landing-page-mobile .everything-you-need-1,
    .landing-page-mobile .get-started-in-three-1,
    .landing-page-mobile .we-take-security-ser-1 {
        font-size: 16px;
    }

    /* Items grid */
    .landing-page-mobile .items-1 {
        width: 100%;
        gap: 20px;
    }

    .landing-page-mobile .item-6,
    .landing-page-mobile .item-7 {
        width: 100%;
        padding: 16px;
    }

    .landing-page-mobile .icon-2 {
        width: 60px;
        height: 60px;
    }

    .landing-page-mobile .fitrash-2-3,
    .landing-page-mobile .fibar-chart-2-1,
    .landing-page-mobile .fihard-drive-1,
    .landing-page-mobile .fizap-1 {
        width: 32px;
        height: 32px;
    }

    .landing-page-mobile .bulk-delete-1,
    .landing-page-mobile .smart-filters-1,
    .landing-page-mobile .storage-insights-1,
    .landing-page-mobile .x100-secure-1,
    .landing-page-mobile .lightning-fast-1,
    .landing-page-mobile .works-everywhere-1,
    .landing-page-mobile .connect-your-gmail-1,
    .landing-page-mobile .filter-select-1,
    .landing-page-mobile .clean-up-1 {
        font-size: 20px;
    }

    .landing-page-mobile .delete-thousands-of-1,
    .landing-page-mobile .filter-by-date-size-1,
    .landing-page-mobile .see-which-emails-tak-1,
    .landing-page-mobile .your-data-stays-priv-1,
    .landing-page-mobile .process-thousands-of-1,
    .landing-page-mobile .access-from-any-devi-1,
    .landing-page-mobile .sign-in-securely-wit-1,
    .landing-page-mobile .use-our-powerful-fil-1,
    .landing-page-mobile .delete-selected-emai-1 {
        font-size: 14px;
    }

    /* Footer */
    .landing-page-mobile .footer-1 {
        width: 100%;
        padding: 30px 10px;
    }

    .landing-page-mobile .colum-2 {
        width: 100%;
        padding: 15px 0;
    }

    .landing-page-mobile .product-1,
    .landing-page-mobile .place-1,
    .landing-page-mobile .connect-1 {
        font-size: 16px;
    }

    .landing-page-mobile .features-4,
    .landing-page-mobile .how-it-work-2,
    .landing-page-mobile .privacy-policy-1,
    .landing-page-mobile .terms-of-service-1,
    .landing-page-mobile .support-1,
    .landing-page-mobile .git-hub-1 {
        font-size: 14px;
    }

    /* CTA Section */
    .landing-page-mobile .ready-to-clean-your-inbox-3 {
        font-size: 28px;
    }

    .landing-page-mobile .join-thousands-of-us-1 {
        font-size: 14px;
    }
}

/* Ultra Small Screens (below 320px) */
@media screen and (max-width: 319px) {
    .landing-page-mobile .clean-your-gmail-reclaim-your-space-1 {
        font-size: 24px;
    }

    .landing-page-mobile .image-2 {
        transform: scale(0.6);
    }

    .landing-page-mobile .powerful-features-1,
    .landing-page-mobile .how-it-works-3,
    .landing-page-mobile .your-privacy-is-our-priority-3 {
        font-size: 24px;
    }
}

/* ===================================================================
   3. GENERAL RESPONSIVE UTILITIES
   =================================================================== */

/* Prevent horizontal scroll globally */
html {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on Safari iOS */
}

body {
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    width: 100%;
    -webkit-text-size-adjust: 100%;
    /* Prevent Safari from auto-adjusting font sizes */
}

/* Ensure all images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Fix any absolute positioned elements that might overflow */
.landing-page-mobile * {
    box-sizing: border-box;
}

/* Make sure modals work on all screen sizes */
@media screen and (max-width: 480px) {
    .login-modal {
        width: 95%;
        padding: 30px 20px;
    }

    .login-modal h2 {
        font-size: 24px;
    }

    .login-modal p {
        font-size: 14px;
    }
}