/**
 * Skip Ad Overlay Styles
 * Modal-style overlay that displays an ad when the site first loads
 */

/* ========================================
   Overlay - Dark Backdrop
   ======================================== */
.skip-ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-sizing: border-box;
}

/* ========================================
   Modal Box
   ======================================== */
.skip-ad-overlay-inner {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 1100px;
    height: calc(100vh - 30px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: skipAdSlideIn 0.35s ease-out;
}

@keyframes skipAdSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ========================================
   Header - Logo + Skip Button
   ======================================== */
.skip-ad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 3px solid #e00;
    background-color: #fff;
    flex-shrink: 0;
}

.skip-ad-logo img.skip-ad-site-logo {
    max-height: 45px;
    width: auto;
    display: block;
}

.skip-ad-logo .skip-ad-site-name {
    font-size: 22px;
    font-weight: 700;
    color: #e00;
    text-decoration: none;
    line-height: 1.2;
}

/* ========================================
   Skip Ad Button
   ======================================== */
.skip-ad-btn {
    background-color: #e00;
    color: #fff;
    border: none;
    padding: 9px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease, opacity 0.3s ease, transform 0.15s ease;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.skip-ad-btn:disabled {
    background-color: #999;
    cursor: not-allowed;
    opacity: 0.9;
}

.skip-ad-btn:not(:disabled) {
    animation: skipAdPulse 1.5s ease-in-out infinite;
}

.skip-ad-btn:not(:disabled):hover {
    background-color: #c00;
    transform: scale(1.03);
}

.skip-ad-btn:not(:disabled):active {
    background-color: #a00;
    transform: scale(0.98);
}

@keyframes skipAdPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(238, 0, 0, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(238, 0, 0, 0); }
}

/* ========================================
   Ad Content Area
   ======================================== */
.skip-ad-content {
    overflow: hidden;
    padding: 15px;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Reset any widget styles that interfere with modal layout */
.skip-ad-content .skip-ad-widget {
    width: 100%;
    height: 100%;
    background: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide widget titles inside the modal */
.skip-ad-content .skip-ad-widget-title,
.skip-ad-content .td-block-title,
.skip-ad-content h4.td-block-title {
    display: none !important;
}

/* Make widget images fill the available space without scrolling */
.skip-ad-content img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    object-fit: contain;
}

/* Custom widget image container */
.skip-ad-image-container {
    display: inline-block;
    max-width: 100%;
}

.skip-ad-image-container a {
    display: block;
    text-decoration: none;
}

.skip-ad-image-container img.skip-ad-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    object-fit: contain;
}

/* ========================================
   Fade-out animation
   ======================================== */
.skip-ad-overlay.skip-ad-fade-out {
    animation: skipAdFadeOut 0.35s ease forwards;
}

.skip-ad-overlay.skip-ad-fade-out .skip-ad-overlay-inner {
    animation: skipAdSlideOut 0.35s ease forwards;
}

@keyframes skipAdFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

@keyframes skipAdSlideOut {
    0% { opacity: 1; transform: scale(1) translateY(0); }
    100% { opacity: 0; transform: scale(0.92) translateY(20px); }
}

/* ========================================
   Body class when overlay is active
   ======================================== */
body.skip-ad-active {
    overflow: hidden;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .skip-ad-overlay {
        padding: 15px;
    }

    .skip-ad-overlay-inner {
        max-width: 100%;
        height: calc(100vh - 20px);
        border-radius: 6px;
    }

    .skip-ad-header {
        padding: 10px 15px;
    }

    .skip-ad-logo img.skip-ad-site-logo {
        max-height: 35px;
    }

    .skip-ad-logo .skip-ad-site-name {
        font-size: 17px;
    }

    .skip-ad-btn {
        padding: 7px 14px;
        font-size: 12px;
    }

    .skip-ad-content {
        padding: 15px 12px;
    }
}

@media (max-width: 480px) {
    .skip-ad-overlay {
        padding: 10px;
    }

    .skip-ad-header {
        padding: 8px 12px;
        border-bottom-width: 2px;
    }

    .skip-ad-logo .skip-ad-site-name {
        font-size: 15px;
    }

    .skip-ad-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .skip-ad-content {
        padding: 12px 8px;
    }
}
