/**
 * Madara Patreon Chapters Lock - Public Styles
 *
 * @package Madara_Patreon_Chapters_Lock
 */

/* ==========================================================================
   Locked Chapter Container
   ========================================================================== */

.mpc-locked-chapter {
    position: relative;
    min-height: 400px;
    margin: 20px 0;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* ==========================================================================
   Blurred Preview
   ========================================================================== */

.mpc-blurred-preview {
    position: relative;
    max-height: 600px;
    overflow: hidden;
}

.mpc-blurred-preview .mpc-preview-image {
    position: relative;
}

.mpc-blurred-preview .mpc-preview-image img {
    width: 100%;
    height: auto;
    display: block;
    /* Blur is applied via inline styles from PHP */
    transform: scale(1.05); /* Prevent blur edge artifacts */
    transition: filter 0.3s ease;
}

/* Gradient fade at bottom of preview */
.mpc-blur-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(26, 26, 46, 0.5) 30%,
        rgba(26, 26, 46, 0.9) 70%,
        rgba(26, 26, 46, 1) 100%
    );
    pointer-events: none;
}

/* ==========================================================================
   Lock Overlay
   ========================================================================== */

.mpc-lock-overlay {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

/* When preview exists, overlay on top */
.mpc-blurred-preview + .mpc-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 40px 20px;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(5px);
}

.mpc-lock-content {
    max-width: 480px;
    padding: 40px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Lock Icon
   ========================================================================== */

.mpc-lock-icon {
    margin-bottom: 24px;
    color: #f96854; /* Patreon brand color */
    opacity: 0.9;
}

.mpc-lock-icon svg {
    width: 80px;
    height: 80px;
    animation: mpc-pulse 2s ease-in-out infinite;
}

@keyframes mpc-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

/* ==========================================================================
   Typography
   ========================================================================== */

.mpc-lock-title {
    margin: 0 0 16px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.mpc-lock-message {
    margin-bottom: 24px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1.6;
}

.mpc-lock-message p {
    margin: 0 0 12px 0;
}

.mpc-lock-message p:last-child {
    margin-bottom: 0;
}

.mpc-tier-requirement {
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 8px;
    background: rgba(249, 104, 84, 0.15);
    border: 1px solid rgba(249, 104, 84, 0.3);
    color: #ffffff;
    font-weight: 500;
}

.mpc-current-pledge {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

.mpc-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    font-style: italic;
}

/* ==========================================================================
   CTA Button
   ========================================================================== */

.mpc-cta-wrapper {
    margin-bottom: 24px;
}

.mpc-cta-button {
    display: inline-block;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    background: linear-gradient(135deg, #f96854 0%, #e8533c 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(249, 104, 84, 0.4);
}

.mpc-cta-button:hover,
.mpc-cta-button:focus {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 104, 84, 0.5);
}

.mpc-cta-button:active {
    transform: translateY(0);
}

.mpc-secondary-link {
    display: block;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.mpc-secondary-link:hover {
    color: #ffffff;
}

/* ==========================================================================
   Patreon Badge
   ========================================================================== */

.mpc-patreon-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

.mpc-patreon-badge svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Declined Status
   ========================================================================== */

.mpc-locked-chapter[data-reason="declined"] .mpc-lock-icon {
    color: #dc3545;
}

.mpc-locked-chapter[data-reason="declined"] .mpc-tier-requirement {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.3);
}

/* ==========================================================================
   Chapter List Indicators (Optional Enhancement)
   ========================================================================== */

.mpc-chapter-locked-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.75rem;
    color: #f96854;
    background: rgba(249, 104, 84, 0.1);
    border-radius: 4px;
    margin-left: 8px;
}

.mpc-chapter-locked-indicator svg {
    width: 12px;
    height: 12px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .mpc-locked-chapter {
        min-height: 350px;
        margin: 15px 0;
    }

    .mpc-lock-content {
        padding: 30px 20px;
        margin: 0 10px;
    }

    .mpc-lock-icon svg {
        width: 60px;
        height: 60px;
    }

    .mpc-lock-title {
        font-size: 1.25rem;
    }

    .mpc-lock-message {
        font-size: 0.9375rem;
    }

    .mpc-cta-button {
        padding: 12px 24px;
        font-size: 0.9375rem;
        width: 100%;
    }

    .mpc-blurred-preview {
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .mpc-lock-content {
        padding: 24px 16px;
    }

    .mpc-lock-title {
        font-size: 1.125rem;
    }

    .mpc-tier-requirement {
        padding: 10px 12px;
        font-size: 0.875rem;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: light) {
    .mpc-locked-chapter {
        background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    }

    .mpc-blur-fade {
        background: linear-gradient(
            to bottom,
            transparent 0%,
            rgba(245, 245, 245, 0.5) 30%,
            rgba(245, 245, 245, 0.9) 70%,
            rgba(245, 245, 245, 1) 100%
        );
    }

    .mpc-blurred-preview + .mpc-lock-overlay {
        background: rgba(245, 245, 245, 0.9);
    }

    .mpc-lock-content {
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(0, 0, 0, 0.1);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    }

    .mpc-lock-title {
        color: #1a1a2e;
    }

    .mpc-lock-message {
        color: rgba(26, 26, 46, 0.8);
    }

    .mpc-tier-requirement {
        background: rgba(249, 104, 84, 0.1);
        color: #1a1a2e;
    }

    .mpc-current-pledge,
    .mpc-hint {
        color: rgba(26, 26, 46, 0.6);
    }

    .mpc-secondary-link {
        color: rgba(26, 26, 46, 0.6);
    }

    .mpc-secondary-link:hover {
        color: #1a1a2e;
    }

    .mpc-patreon-badge {
        color: rgba(26, 26, 46, 0.4);
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .mpc-locked-chapter {
        display: none;
    }
}

/* ==========================================================================
   Animation for locked wrapper (used with JS)
   ========================================================================== */

.mpc-locked-chapter-wrapper {
    animation: mpc-fadeIn 0.3s ease-out;
}

@keyframes mpc-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
