/*
 * MemberPress Paywall Custom Styling
 * Adds beautiful fade-out effect and styled paywall boxes
 * Logo for registration/account pages is handled via JavaScript in functions.php
 */

/* Fix scrolling issue - ensure body can scroll when paywall is present */
body:has(.mepr-unauthorized-message),
body:has(.mepr_unauthorized_message) {
    overflow: visible !important;
    overflow-y: auto !important;
    height: auto !important;
}

/* Remove box-shadow from paywall container and fix padding */
.mepr-paywall-container {
    box-shadow: none !important;
    padding: 0 !important;
}

/* Fix min-height on active paywall container */
.mepr-paywall-container.active {
    min-height: auto !important;
}

/* Article excerpt preview with gradient */
.article-excerpt {
    position: relative;
    max-height: 300px;
    overflow: hidden;
    margin-bottom: 0;
    padding-bottom: 0;
    font-size: 18px;
    line-height: 1.8;
    color: #fbfbf4;
}

.article-excerpt::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom,
        rgba(35, 35, 35, 0) 0%,
        rgba(35, 35, 35, 0.3) 20%,
        rgba(35, 35, 35, 0.6) 40%,
        rgba(35, 35, 35, 0.9) 70%,
        rgba(35, 35, 35, 1) 100%
    );
    pointer-events: none;
    z-index: 10;
}

/* Ensure paywall appears right after excerpt */
.article-excerpt + .mepr-unauthorized-message,
.article-excerpt + .mepr_unauthorized_message {
    margin-top: 0;
}

/* Container for restricted content with fade effect */
.mepr-unauthorized-excerpt,
.mepr_unauthorized_excerpt {
    position: relative;
    max-height: 400px;
    overflow: hidden;
    margin-bottom: 0;
}

/* Fade out gradient overlay */
.mepr-unauthorized-excerpt::after,
.mepr_unauthorized_excerpt::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 250px;
    background: linear-gradient(to bottom,
        rgba(35, 35, 35, 0) 0%,
        rgba(35, 35, 35, 0.4) 30%,
        rgba(35, 35, 35, 0.8) 60%,
        rgba(35, 35, 35, 1) 100%
    );
    pointer-events: none;
}

/* Dark theme support for fade effect */
body.theme-preset-active .mepr-unauthorized-excerpt::after,
body.theme-preset-active .mepr_unauthorized_excerpt::after {
    background: linear-gradient(to bottom,
        rgba(35, 35, 35, 0) 0%,
        rgba(35, 35, 35, 0.4) 30%,
        rgba(35, 35, 35, 0.8) 60%,
        rgba(35, 35, 35, 1) 100%
    );
}

/* Paywall box/blocker styling */
.mepr-unauthorized-message,
.mepr_unauthorized_message,
div.paywall-box,
div[class*="paywall"] {
    background: #232323;
    border: none;
    border-radius: 0;
    padding: 60px 40px;
    margin: 0 auto;
    box-shadow: none;
    text-align: center;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

/* Alternative styling - clean and professional */
.mepr-unauthorized-message.clean-style,
.mepr_unauthorized_message.clean-style {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    color: #333333;
    box-shadow: none;
}

/* Subtle pattern overlay - disabled for clean black background */
.mepr-unauthorized-message::before,
.mepr_unauthorized_message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    pointer-events: none;
}

/* Headings in paywall */
.mepr-unauthorized-message h2,
.mepr-unauthorized-message h3,
.mepr_unauthorized_message h2,
.mepr_unauthorized_message h3 {
    color: #ffffff;
    margin: 0 auto;
    margin-bottom: 30px;
    font-size: 48px;
    font-weight: 400;
    line-height: 1.2;
    border: none;
    padding: 0;
    position: relative;
    z-index: 1;
}

.mepr-unauthorized-message.clean-style h2,
.mepr-unauthorized-message.clean-style h3 {
    color: #333333;
}

/* Paragraph text in paywall */
.mepr-unauthorized-message p,
.mepr_unauthorized_message p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 18px;
    line-height: 1.6;
    margin: 0 auto;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.mepr-unauthorized-message.clean-style p {
    color: #666666;
}

/* Buttons in paywall */
.mepr-unauthorized-message a,
.mepr-unauthorized-message button,
.mepr_unauthorized_message a,
.mepr_unauthorized_message button,
.mepr-login-link,
.mepr-register-link {
    display: inline-block;
    margin: 8px auto;
    margin-bottom: 20px;
    padding: 0.875em 2.5em;
    background: #0000ff;
    color: #ffffff;
    font-family: "neue-haas-grotesk-display", "Helvetica Neue", Helvetica, sans-serif !important;
    font-size: 1em;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.mepr-unauthorized-message a:hover,
.mepr-unauthorized-message button:hover,
.mepr_unauthorized_message a:hover,
.mepr_unauthorized_message button:hover {
    background: #fbfbf4;
    color: #232323;
}

/* Secondary button style / Sign in link */
.mepr-unauthorized-message a.secondary,
.mepr_unauthorized_message a.secondary,
.mepr-unauthorized-message .mepr-login-link,
.mepr_unauthorized_message .mepr-login-link {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: none;
    padding: 10px 20px;
    font-family: "neue-haas-grotesk-display", "Helvetica Neue", Helvetica, sans-serif !important;
    font-size: 16px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.mepr-unauthorized-message a.secondary:hover,
.mepr_unauthorized_message a.secondary:hover,
.mepr-unauthorized-message .mepr-login-link:hover,
.mepr_unauthorized_message .mepr-login-link:hover {
    background: transparent;
    color: #ffffff;
    text-decoration: underline;
    transform: none;
    box-shadow: none;
}

/* Icon styling if using Font Awesome */
.mepr-unauthorized-message i.fa,
.mepr_unauthorized_message i.fa,
.mepr-unauthorized-message .fas,
.mepr_unauthorized_message .fas {
    margin-right: 8px;
    font-size: 20px;
}

/* Lock icon styling - disabled for clean aesthetic */
.mepr-unauthorized-message::after {
    content: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mepr-unauthorized-message,
    .mepr_unauthorized_message {
        padding: 40px 5px;
        margin: 0;
    }

    .mepr-unauthorized-message h2,
    .mepr-unauthorized-message h3,
    .mepr_unauthorized_message h2,
    .mepr_unauthorized_message h3 {
        font-size: 32px;
        margin-bottom: 20px;
    }

    .mepr-unauthorized-message p,
    .mepr_unauthorized_message p {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .mepr-unauthorized-message a,
    .mepr-unauthorized-message button,
    .mepr_unauthorized_message a,
    .mepr_unauthorized_message button {
        display: block;
        margin: 10px auto;
        width: 100%;
        max-width: 300px;
    }
}

/* Animation for paywall box */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mepr-unauthorized-message,
.mepr_unauthorized_message {
    animation: fadeInUp 0.6s ease-out;
}

/* Alternative gradient options (comment/uncomment to switch) */
/*
.mepr-unauthorized-message,
.mepr_unauthorized_message {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
*/

/*
.mepr-unauthorized-message,
.mepr_unauthorized_message {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
*/

/*
.mepr-unauthorized-message,
.mepr_unauthorized_message {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}
*/
