/**
 * Decoder Ads - Frontend Styles
 */

/* Ad Wrapper Styles */
.decoder-ad-wrapper {
    margin: 40px 0;
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.ad{
    text-align: center;
    width: 100%;
}

.desktop-view .ad {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Ad Notice */
.ad-notice {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    line-height: normal;
}

/* Ad Row Layout */
.ad-row {
    display: block;
    max-width: 100%;
    overflow: hidden;
}

/* Ad Container */
.ad-container {
    flex: 1;
    position: relative;
    max-width: 100vw;
    box-sizing: border-box;
}

.ad-feed {
    width: 100%;
    max-width: 100% !important;
    background: #fff;
    box-sizing: border-box;
}

/* Placeholder Content */
.decoder-ad-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


/* Desktop/Mobile View Control */
.desktop-view {
    display: block;
}

.mobile-view {
    display: none;
}

/* Mobile specific styles */
.ad-m {
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-container.ad-m.ad-feed {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Feed ad wrapper */
.decoder-feed-ad-wrapper {
    max-width: 100vw;
    overflow: hidden;
    box-sizing: border-box;
}

/* Top ad wrapper */
.decoder-top-ad-wrapper {
    width: 100%;
    max-width: 100vw;
    display: flex;
    justify-content: center;
    margin: 20px 0;
    overflow: hidden;
    box-sizing: border-box;
}

/* Right ad wrapper - protects positioning */
.ad-right-wrapper {
    position: fixed !important;
    top: 68px !important;
    left: calc(50% + 540px + 30px) !important;
    width: 200px;
    z-index: 1000;
    pointer-events: none;
}

/* Right ad container */
.ad-right-container {
    pointer-events: auto;
    width: 200px;
}

/* Force the actual ad to stay relative and in position */
.ad-right-wrapper #DEC_D_Right {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
}

/* Hide right ad on smaller screens */
@media (max-width: 1800px) {
    .ad-right-wrapper {
        display: none;
    }
}

/* Sticky ad container */
.ad-sticky-container {
    position: relative;
    overflow: hidden;
}

.ad-footer {
    position: fixed;
    display: flex;
    justify-content: center;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.ad-footer__wrap {
    display: inline-block;
    position: relative;
}

#DEC_D_Sticky, #DEC_M_Sticky {
    position: static !important;
}

.ad-footer__close {
    position: absolute;
    width: 28px;
    height: 28px;
    top: -29px;
    right: -1px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='13' height='13' viewBox='341 8 13 13' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%234F4F4F' d='M354 9.31L352.69 8l-5.19 5.19L342.31 8 341 9.31l5.19 5.19-5.19 5.19 1.31 1.31 5.19-5.19 5.19 5.19 1.31-1.31-5.19-5.19z' fill-rule='evenodd'/%3E%3C/svg%3E");
    background-size: 13px 13px;
    background-position: 7px center;
    background-color: rgb(255, 255, 255);
    background-repeat: no-repeat;
    box-shadow: rgba(0, 0, 0, 0.2) 0px -1px 1px 0px;
    border: none;
    border-radius: 6px 6px 0px 0px;
    cursor: pointer;
    padding: 0;
}

/* Mobile ad sticky positioning */
.mobile-view .ad-feed-mobile {
    position: sticky;
    top: 20px;
    z-index: 10;
}

/* Ad padding wrapper - prevents overflow from padding */
.ad-padding-wrapper {
    padding: 20px; /* Desktop: all sides */
    box-sizing: border-box;
    max-width: 100%;
    /* NO overflow: hidden here - would break position: sticky */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .desktop-view {
        display: none !important;
    }

    .mobile-view {
        display: block !important;
    }

    .decoder-top-ad-wrapper {
        margin: 0;
    }

    /* Mobile: only vertical padding to prevent horizontal overflow */
    .ad-padding-wrapper {
        padding: 20px 0;
    }

    /* Mobile: add left padding to ad notice */
    .ad-notice {
        padding-left: 20px;
    }

    .ad-row {
        display: block;
        max-width: 100vw;
        overflow: hidden;
    }

    .decoder-ad-wrapper {
        margin: 30px 0;
        max-width: 100vw;
        overflow: hidden;
    }

    .decoder-feed-ad-wrapper {
        max-width: 100vw;
        overflow: hidden;
    }

    .ad-container {
        width: 100%;
        max-width: 100vw !important;
        box-sizing: border-box;
    }

    .ad-container.ad-m {
        display: flex;
        justify-content: center;
    }

    .ad-feed {
        max-width: 100% !important;
    }

    /* Ensure all ad divs stay within viewport */
    .ad {
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Ensure sticky behavior works on mobile */
    .mobile-view .ad-sticky-container {
        position: relative;
        height: 600px;
        overflow: hidden;
        max-width: 100vw;
    }

    .mobile-view .ad-feed-mobile {
        position: sticky;
        top: 20px;
        z-index: 10;
        max-width: 100%;
    }
}


/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ad-notice {
        color: #aaa;
    }
}


/* KI Pro specific styling - removed border styling */

/* The Decoder specific styling - removed border styling */