/* ==========================================
   SMART AD RESPONSIVE STYLES
   ========================================== */

.smart-ad-container {
    position: fixed;
    left: 20px;
    top: 50vh;
    transform: translateY(-50%);
    width: 160px;
    height: 420px;
    z-index: 90;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    background-color: #8B5E3C;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid rgba(255, 241, 118, 0.99);
}

.rental-adaptive-glass-wrapper {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    background: rgba(30, 78, 68, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    padding: 25px 15px;
    z-index: 9;
    display: block;
}

.rental-adaptive-glass-wrapper-blue {
    position: fixed;
    left: 0;
    top: 15vh;
    bottom: 0;
    width: 180px;
    background: rgba(0, 172, 193, 0.25);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-right: 1px solid rgba(0, 172, 193, 1);
    padding: 0 15px;
    display: block;
    z-index: 9;
}

/* Adjust layout alignment of actual banner element inside the glass frame */
.rental-ad-sidebar-container {
    margin-top: 140px;
    /* Lowered spacer setup since parent block already shifted below header bar */
    width: 100%;
    height: auto;

}

.rental-ad-sidebar-container-blue {
    margin-top: 80px;
    width: 100%;
    height: auto;

}

.ad-inner-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.ad-content {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 241, 118, 0.4);
}

.rental-ad-banner {
    width: 100%;
    height: 520px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    display: flex;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 241, 118, 0.4);
}

/* Images configuration */
.ad-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* By default (desktop), hide horizontal image */
.ad-img-horizontal {
    display: none;
}

/* Close button style */
.close-ad-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 102;
    transition: background 0.2s;
}

.close-ad-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Text and Button Overlay */
.ad-text-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 70%, rgba(0, 0, 0, 0) 100%);
    padding: 15px;
    box-sizing: border-box;
    text-align: center;
    z-index: 101;
}

.ad-title {
    margin: 0 0 5px 0;
    color: #FFF176;
    /* Matching your app's yellow accent */
    font-size: 1.1rem;
    font-weight: bold;
}

.ad-desc {
    margin: 0 0 12px 0;
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.2;
}

.ad-action-btn {
    background: #FFF176;
    color: #1E4E44;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s, background-color 0.2s;
}

.ad-action-btn:hover {
    background: #fff;
    transform: scale(1.05);
}

/* State when user closes the ad */
.ad-hidden-state {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(0.9);
}

@keyframes slowZoom {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

.ad-zoom-animation {
    animation: slowZoom 15s ease-in-out infinite;
    transform-origin: center;
}

/* ==========================================
   MOBILE ADAPTATION (Smartphones & Tablets)
   ========================================== */
@media (max-width: 1150px) {
    .smart-ad-container {
        position: relative;
        left: 0;
        top: 0;
        transform: none;
        width: calc(100% - 30px);
        margin: 20px auto 10px auto;
        height: 180px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(139, 94, 60, 0.15);
        z-index: 50;
    }

    .rental-adaptive-glass-wrapper, 
    .rental-adaptive-glass-wrapper-blue {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        width: 80%; 
        height: auto;
        margin: 0 auto 10px auto;
        padding: 10px 0;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }

    .rental-ad-sidebar-container, 
    .rental-ad-sidebar-container-blue {
        max-width: 600px;
        margin: 0 auto;
    }

    /* Swap images for mobile landscape ratio */
    .ad-img-vertical {
        display: none;
    }

    .ad-img-horizontal {
        display: block;
    }

    /* Rearrange text layout horizontally for mobile strip */
    .ad-text-overlay {
        height: 100%;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 45px 0 15px;
        text-align: left;
    }

    .ad-title {
        font-size: 1.2rem;
        margin-bottom: 0;
        color: #FFF176;
    }

    .ad-desc {
        display: none;
    }

    .ad-action-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .close-ad-btn {
        top: 50%;
        transform: translateY(-50%);
        right: 12px;
    }

    /* Mobile close animation state override */
    .smart-ad-container.ad-hidden-state {
        opacity: 0;
        transform: scale(0.95);
        margin-top: 0;
        margin-bottom: 0;
        height: 0;
        transition: all 0.3s ease;
    }
}

