/* Nikoala Shared Paywall Styles */
/* Consolidated styling for all paywalls: subscriptions, products, post restrictions, category restrictions */

/* Content Preview (for restricted posts) */
.nikoala-content-preview {
    margin-bottom: 40px;
    text-align: left;
    position: relative;
}

.nikoala-content-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 70%, rgba(255,255,255,1) 100%);
    pointer-events: none;
    display: block;
}

.nikoala-content-preview p:last-child {
    margin-bottom: 0;
}

/* Paywall Container */
.nikoala-paywall {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    text-align: center;
}

.nikoala-paywall.content {
    width: 100%;
    background-color: transparent !important;
}

.nikoala-paywall-header {
    margin-bottom: 50px;
}

.nikoala-paywall h2 {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #333;
}

.nikoala-paywall-description {
    font-size: 18px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* Referral Discount Badge */
.nikoala-referral-discount {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    padding: 12px 20px;
    border-radius: 25px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    animation: referralPulse 2s ease-in-out infinite;
}

.nikoala-referral-discount .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #fff;
}

.nikoala-referral-discount .discount-text {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@keyframes referralPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    }
}

/* Plans Section */
.nikoala-paywall-plans {
    margin-bottom: 50px;
}

.nikoala-paywall-plans h3 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 40px 0;
    color: #333;
}

/* Pricing Grid - Used for ALL paywalls (subscriptions and products) */
.nikoala-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* Pricing Cards - Unified card structure */
.nikoala-pricing-card {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.nikoala-pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #e5e5e5;
}

.nikoala-pricing-card.featured {
    border-color: #e5e5e5;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* Pricing Header */
.nikoala-pricing-header {
    padding: 30px 20px;
    position: relative;
    color: #fff;
    text-align: center;
}

.nikoala-pricing-header h4 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nikoala-featured-badge {
    position: absolute;
    top: -1px;
    right: 20px;
    background: #ff6b35;
    color: #fff;
    padding: 5px 15px;
    border-radius: 0 0 8px 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pricing Body */
.nikoala-pricing-body {
    padding: 30px 20px;
}

/* Product Image Support */
.nikoala-product-image {
    margin-bottom: 25px;
}

.nikoala-product-image img {
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

/* Pricing Features */
.nikoala-pricing-features ul {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    text-align: left;
}

.nikoala-pricing-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f8f9fa;
    font-size: 16px;
    color: #495057;
}

.nikoala-pricing-features li:last-child {
    border-bottom: none;
}

.nikoala-pricing-features li .dashicons {
    color: #28a745;
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Product Description (for product cards) */
.nikoala-product-description {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #495057;
}

/* Pricing Action */
.nikoala-pricing-action {
    text-align: center;
}

.nikoala-pricing-action .button {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nikoala-pricing-action .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.nikoala-pricing-action .button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Login Prompt */
.nikoala-paywall-login {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.nikoala-paywall-login p {
    font-size: 18px;
    color: #495057;
    margin: 0 0 20px 0;
}

.nikoala-paywall-login .button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #6c757d;
    color: #fff;
    border: none;
    transition: all 0.3s ease;
}

.nikoala-paywall-login .button:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    color: #fff;
}

.nikoala-paywall-login .button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Contact Fallback */
.nikoala-paywall-contact {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 30px;
    border-radius: 12px;
    color: #856404;
}

.nikoala-paywall-contact p {
    font-size: 16px;
    margin: 0;
    line-height: 1.6;
}

/* Skeleton Loader Styles */
.nikoala-pricing-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.nikoala-pricing-card-skeleton {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.nikoala-pricing-card-skeleton.featured {
    border-color: #e5e5e5;
    box-shadow: 0 5px 20px rgba(0, 124, 186, 0.15);
}

.nikoala-skeleton-header {
    padding: 30px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

.nikoala-skeleton-title {
    height: 24px;
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeletonLoading 1.5s infinite;
    margin: 0 auto;
    width: 60%;
}

.nikoala-skeleton-badge {
    position: absolute;
    top: -1px;
    right: 20px;
    width: 60px;
    height: 22px;
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    border-radius: 0 0 8px 8px;
    animation: skeletonLoading 1.5s infinite;
}

.nikoala-skeleton-body {
    padding: 30px 20px;
}

.nikoala-skeleton-price {
    text-align: center;
    margin-bottom: 30px;
}

.nikoala-skeleton-price-amount {
    height: 32px;
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeletonLoading 1.5s infinite;
    margin: 0 auto 8px;
    width: 70%;
}

.nikoala-skeleton-price-interval {
    height: 16px;
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeletonLoading 1.5s infinite;
    margin: 0 auto;
    width: 40%;
}

.nikoala-skeleton-features {
    margin-bottom: 30px;
}

.nikoala-skeleton-feature {
    height: 16px;
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeletonLoading 1.5s infinite;
    margin-bottom: 16px;
    width: 80%;
}

.nikoala-skeleton-feature:nth-child(2) {
    width: 90%;
}

.nikoala-skeleton-feature:nth-child(3) {
    width: 85%;
}

.nikoala-skeleton-feature:last-child {
    width: 75%;
    margin-bottom: 0;
}

.nikoala-skeleton-button {
    height: 50px;
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    border-radius: 8px;
    animation: skeletonLoading 1.5s infinite;
}

@keyframes skeletonLoading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Pricing with Coupons */
.nikoala-pricing-price {
    text-align: center;
    margin-bottom: 30px;
}

.nikoala-price-original {
    display: block;
    font-size: 20px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 5px;
    font-weight: 400;
}

.nikoala-price-discounted {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 5px;
}

.nikoala-price-amount {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.nikoala-price-interval {
    display: block;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nikoala-price-then {
    display: block;
    font-size: 12px;
    color: #888;
    font-weight: 400;
}

.nikoala-discount-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

/* Pricing Content Display */
.nikoala-pricing-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.nikoala-pricing-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 12px;
}

.nikoala-pricing-error p {
    margin: 0;
    font-size: 16px;
}

/* Enhanced styling for discounted prices */
.nikoala-pricing-card .nikoala-price-original + .nikoala-price-discounted {
    position: relative;
}

/* Referral countdown styles */
.nikoala-referral-countdown {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.nikoala-referral-countdown .dashicons {
    width: 14px;
    height: 14px;
    font-size: 14px;
    flex-shrink: 0;
}

.nikoala-referral-countdown .countdown-text {
    font-weight: 500;
}

.nikoala-referral-countdown .countdown-time {
    font-weight: 600;
}

.nikoala-referral-countdown.urgent {
    background: #fff3e0;
    border-color: #ffcc02;
    color: #e65100;
    animation: countdownUrgent 2s ease-in-out infinite;
}

.nikoala-referral-countdown.urgent .dashicons,
.nikoala-referral-countdown.urgent .countdown-time {
    color: #e65100;
}

.nikoala-referral-countdown.expired {
    background: #ffebee;
    border-color: #ffcdd2;
    color: #c62828;
}

.nikoala-referral-countdown.expired .dashicons,
.nikoala-referral-countdown.expired .countdown-time {
    color: #c62828;
}

@keyframes countdownUrgent {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(230, 81, 0, 0.2);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(230, 81, 0, 0.1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nikoala-paywall {
        margin: 20px auto;
        padding: 0 15px;
    }

    .nikoala-paywall h2 {
        font-size: 28px;
    }

    .nikoala-paywall-description {
        font-size: 16px;
    }

    .nikoala-paywall-plans h3 {
        font-size: 24px;
    }

    .nikoala-pricing-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .nikoala-pricing-header {
        padding: 20px 15px;
    }

    .nikoala-pricing-header h4 {
        font-size: 20px;
    }

    .nikoala-pricing-body {
        padding: 20px 15px;
    }

    .nikoala-paywall-login,
    .nikoala-paywall-contact {
        padding: 20px;
    }

    .nikoala-pricing-skeleton {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .nikoala-skeleton-header {
        padding: 20px 15px;
    }

    .nikoala-skeleton-body {
        padding: 20px 15px;
    }

    .nikoala-pricing-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .nikoala-product-image img {
        max-width: 150px;
        max-height: 150px;
    }
}
