/* ============================================
   Download Section Styles
   ============================================ */

.download-section {
    padding: 60px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.download-card {
    width: 1256px;
    height: 562px;
    border-radius: 52px;
    background: url('https://pocketly-public-bucket.s3.ap-south-1.amazonaws.com/b5386099-6a77-42dc-bfc4-1f93420865c4.png') center center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 60px 80px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.download-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Left Content */
.download-content {
    flex: 1;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
}

.download-headline {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    color: #ffffff;
    margin: 0 0 24px 0;
    letter-spacing: -0.5px;
}

.download-subheadline {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    color: #A9CCF1;
    margin: 0 0 24px 0;
    max-width: 550px;
}

.download-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 16px;
}

.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    background: #ffffff;
    color: #1E3A8A;
    border: 1px solid #1E3A8A;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    width: fit-content;
    margin-bottom: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.2), 4px 4px 0px 0px rgba(0, 0, 0, 0.3);
    position: relative;
}

.download-arrow-wrapper {
    display: inline-flex;
    align-items: center;
    position: relative;
    width: 20px;
    height: 20px;
    overflow: hidden;
}

.download-arrow {
    font-size: 20px;
    color: #1E3A8A;
    position: absolute;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.download-arrow:first-child {
    transform: translateX(0);
}

.download-arrow:last-child {
    transform: translateX(-20px);
}

.download-button:hover .download-arrow:first-child {
    transform: translateX(20px);
}

.download-button:hover .download-arrow:last-child {
    transform: translateX(0);
}

.download-button:hover {
    color: #1E3A8A;
}

.download-trust {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    position: relative;
    z-index: 3;
}

.download-trust-avatars {
    display: flex;
    align-items: center;
}

.download-trust-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    object-fit: cover;
    margin-left: -8px;
    background: #ffffff;
}

.download-trust-avatar:first-child {
    margin-left: 0;
}

/* Right Phone Image */
.download-phone-container {
    flex: 0 0 auto;
    width: 550px;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: absolute;
    top: 0;
    right: 80px;
    z-index: 1;
    overflow: hidden;
}

.download-phone-image {
    width: auto;
    height: auto;
    max-height: 960px;
    max-width: 820px;
    object-fit: contain;
    object-position: top;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
    position: relative;
    z-index: 1;
    margin-top: 0;
    margin-left: 60px;
    align-self: flex-start;
}

.download-phone-overlay {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 820px;
    height: auto;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease 0.5s;
    margin-left: 60px;
}

.download-phone-overlay.animate-in {
    opacity: 1;
}

.download-phone-image.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1400px) {
    .download-card {
        width: 90%;
        max-width: 1256px;
        padding: 50px 60px;
    }
    
    .download-phone-container {
        right: 60px;
    }
}

@media (max-width: 1024px) {
    .download-section {
        padding: 60px 20px;
    }
    
    .download-card {
        width: 95%;
        height: auto;
        min-height: auto;
        flex-direction: column;
        padding: 30px 32px 0 32px;
        padding-bottom: 0;
        gap: 0;
        justify-content: flex-start;
        overflow: hidden;
        position: relative;
    }
    
    .download-content {
        max-width: 100%;
        text-align: center;
        align-items: center;
        padding-bottom: 0;
        z-index: 2;
    }
    
    .download-headline {
        font-size: 36px;
        margin-bottom: 16px;
    }
    
    .download-subheadline {
        font-size: 16px;
        max-width: 100%;
        margin-bottom: 28px;
    }
    
    .download-button {
        margin-bottom: 28px;
    }
    
    .download-trust {
        margin-bottom: 0;
        position: relative;
        z-index: 3;
    }
    
    /* Phone below content; larger size, touches bottom, only upper half visible */
    .download-phone-container {
        position: relative !important;
        width: 100% !important;
        max-width: 600px !important;
        margin: 16px auto 0 !important;
        align-items: flex-end;
        justify-content: center;
        height: 320px !important;
        z-index: 1;
        overflow: hidden;
        display: flex;
        flex: none !important;
        top: auto !important;
        right: auto !important;
    }
    
    .download-phone-image {
        max-width: 600px !important;
        max-height: 1100px !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        margin-left: 0 !important;
        margin-top: 0 !important;
        align-self: flex-end;
        display: block;
        object-position: bottom;
        position: relative !important;
    }
    
    .download-phone-overlay {
        max-width: 180px !important;
        width: 180px !important;
        bottom: 0;
        margin-left: 0;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

/* Tablets only (769px–1024px): show only upper half of phone inside card */
@media (min-width: 769px) and (max-width: 1024px) {
    .download-card {
        /* Keep column layout but let phone sit at bottom with overflow clipped */
        overflow: hidden;
    }
    
    .download-phone-container {
        position: relative !important;
        width: 100% !important;
        max-width: 650px !important;
        margin: 8px auto 0 !important; /* bring phone higher in the card */
        align-items: flex-start;
        justify-content: center;
        height: 320px !important; /* controls how much of the phone is visible */
        z-index: 1;
        overflow: hidden;
        display: flex;
        flex: none !important;
        top: auto !important;
        right: auto !important;
    }
    
    .download-phone-image {
        max-width: 650px !important;
        max-height: 1200px !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        margin-left: 0 !important;
        margin-top: 0 !important;
        align-self: flex-start;
        display: block;
        object-position: top;
        position: relative !important;
        transform: none !important; /* prevent scroll animation from pulling full phone into view */
    }
    
    .download-phone-image.animate-in {
        transform: none !important;
    }
    
    /* Make overlay follow same width and alignment as phone on tablets */
    .download-phone-overlay {
        max-width: 320px !important; /* increased from 280px */
        width: 50% !important; /* increased from 40% */
        bottom: 0;
        margin-left: 0;
        left: 50% !important; /* moved 3% more right from 52% */
        transform: translateX(calc(-50% + 30px)) !important; /* 4px right on 1024px screens */
    }
}

@media (max-width: 768px) {
    .download-section {
        padding: 16px 16px; /* reduced vertical padding to shrink overall card block */
    }
    
    .download-card {
        width: 100%;
        padding: 16px 16px 0 16px; /* reduce vertical + horizontal padding to shrink card */
        padding-bottom: 0;
        border-radius: 28px;
        min-height: auto;
        gap: 0;
        flex-direction: column;
        justify-content: flex-start;
        overflow: hidden;
        position: relative;
    }
    
    .download-content {
        width: 100%;
        text-align: center;
        align-items: center;
        padding: 8px 12px 0 12px; /* add breathing room for content on phones */
        z-index: 2;
    }
    
    .download-headline {
        font-size: 28px;
        margin-bottom: 12px;
        line-height: 1.3;
    }
    
    .download-subheadline {
        font-size: 14px;
        margin-bottom: 18px; /* slightly tighter spacing to give more room to phone */
        line-height: 1.5;
        max-width: 100%;
    }
    
    .download-button {
        padding: 12px 24px;
        font-size: 14px;
        margin-bottom: 18px; /* reduce gap above phone */
        width: 100%;
        max-width: 240px;
    }
    
    .download-trust {
        font-size: 12px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        margin-bottom: 0;
        position: relative;
        z-index: 3;
    }
    
    .download-trust-avatar {
        width: 24px;
        height: 24px;
    }
    
    /* Phone below content; show clearly the upper half of the phone, crop lower part below card */
    .download-phone-container {
        position: relative !important;
        width: 100% !important;
        max-width: 600px !important;
        margin: -32px auto 0 !important; /* strongly pull phone closer to content on phones */
        align-items: flex-start; /* anchor phone to top of container */
        justify-content: center;
        height: 260px !important; /* make card a bit longer and show more phone */
        z-index: 1;
        overflow: hidden;
        display: flex;
        flex: none !important;
        top: auto !important;
        right: auto !important;
    }
    
    .download-phone-image {
        max-width: 600px !important;
        max-height: 1100px !important;
        width: 140% !important; /* make phone visually wider than card */
        height: auto !important;
        margin: 0 !important;
        margin-left: 0 !important;
        margin-top: 0 !important; /* keep top of phone at top of container */
        align-self: flex-start;
        display: block;
        object-position: top; /* ensure upper part of phone is what shows */
        position: relative !important;
        transform: scale(1.05); /* slight overall up-scale on tablets/large phones */
        transform-origin: center bottom;
    }
    
    .download-phone-overlay {
        max-width: 220px !important; /* increased by ~10px for mobile */
        width: 220px !important;
        bottom: 0;
        margin-left: 0;
        left: 90% !important;
        transform: translateX(calc(-50% + 80px)) !important; /* shift overlay 8px to the right on phones */
    }
}

@media (max-width: 480px) {
    .download-section {
        padding: 16px 12px; /* further reduce height for small phones */
    }
    
    .download-card {
        padding: 14px 12px 0 12px; /* tighter padding for smaller phones */
        padding-bottom: 0;
        border-radius: 22px;
        min-height: auto;
        gap: 0;
        overflow: hidden;
    }
    
    .download-content {
        padding: 8px 10px 0 10px; /* light padding for small phones */
    }
    
    .download-headline {
        font-size: 24px;
        margin-bottom: 10px;
        line-height: 1.3;
    }
    
    .download-subheadline {
        font-size: 13px;
        margin-bottom: 16px; /* tighten text to leave room for phone */
        line-height: 1.5;
    }
    
    .download-button {
        padding: 11px 20px;
        font-size: 13px;
        margin-bottom: 16px;
        width: 100%;
        max-width: 220px;
    }
    
    .download-trust {
        font-size: 11px;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        margin-bottom: 0;
        position: relative;
        z-index: 3;
    }
    
    .download-trust-avatars {
        justify-content: center;
    }
    
    .download-trust-avatar {
        width: 22px;
        height: 22px;
        border-width: 1.5px;
    }
    
    /* Phone below content; show more of upper half on small phones */
    .download-phone-container {
        position: relative !important;
        width: 100% !important;
        max-width: 650px !important;
        margin: -32px auto 0 !important; /* pull phone up more on small phones */
        align-items: flex-start;
        justify-content: center;
        height: 230px !important; /* increase visible window to show more phone */
        z-index: 1;
        overflow: hidden;
        display: flex;
        flex: none !important;
        top: auto !important;
        right: auto !important;
    }
    
    .download-phone-image {
        max-width: 650px !important;
        max-height: 1200px !important;
        width: 125% !important; /* increase phone width further on small phones */
        height: auto !important;
        margin: 0 !important;
        margin-left: 0 !important;
        margin-top: 0 !important;
        align-self: flex-start;
        display: block;
        object-position: top;
        position: relative !important;
        transform: scale(1.1); /* stronger scale for smaller screens */
        transform-origin: center bottom;
    }
    
    .download-phone-overlay {
        max-width: 210px !important; /* increased by ~10px for very small phones */
        width: 205px !important;
        bottom: 0;
        margin-left: 0;
        left: 50% !important;
        transform: translateX(calc(-50% + 16px)) !important; /* consistent 8px right shift on small phones */
    }
}

@media (max-width: 360px) {
    .download-section {
        padding: 12px 10px; /* minimal padding on the tiniest screens */
    }
    
    .download-card {
        padding: 12px 10px 0 10px; /* minimal padding for tiniest screens */
        padding-bottom: 0;
        border-radius: 18px;
        gap: 0;
        overflow: hidden;
    }
    
    .download-content {
        padding: 6px 8px 0 8px; /* compact padding on tiniest screens */
    }
    
    .download-headline {
        font-size: 20px;
        margin-bottom: 8px;
        line-height: 1.3;
    }
    
    .download-subheadline {
        font-size: 12px;
        margin-bottom: 12px; /* reduce spacing to keep card compact */
        line-height: 1.5;
    }
    
    .download-button {
        padding: 10px 18px;
        font-size: 12px;
        margin-bottom: 14px;
        max-width: 200px;
    }
    
    .download-trust {
        font-size: 10px;
        gap: 4px;
        margin-bottom: 0;
        position: relative;
        z-index: 3;
    }
    
    .download-trust-avatar {
        width: 20px;
        height: 20px;
    }
    
    /* Phone below content; minimal visibility, but upper part is more clearly visible */
    .download-phone-container {
        position: relative !important;
        width: 100% !important;
        max-width: 700px !important;
        margin: -32px auto 0 !important; /* minimal gap so phone sits just under text */
        margin-right: auto !important;
        align-items: flex-start;
        justify-content: center;
        height: 210px !important; /* slightly taller card and more phone visible */
        z-index: 1;
        overflow: hidden;
        display: flex;
        flex: none !important;
        top: auto !important;
        right: auto !important;
    }
    
    .download-phone-image {
        max-width: 700px !important;
        max-height: 1300px !important;
        width: 120% !important; /* largest relative width on the tiniest screens */
        height: auto !important;
        margin: 0 !important;
        margin-left: 0 !important;
        margin-top: 0 !important;
        align-self: flex-start;
        display: block;
        object-position: top;
        position: relative !important;
        transform: scale(1.12); /* slightly more zoom for very small screens */
        transform-origin: center bottom;
    }
    
    .download-phone-overlay {
        max-width: 195px !important; /* increased by ~10px on tiniest screens */
        width: 195px !important;
        bottom: 0;
        margin-left: 0;
        left: 50% !important;
        transform: translateX(calc(-50% + 8px)) !important; /* 8px right shift on tiniest screens */
    }
}

