/* WP Paywall Plugin - Bootstrap 5 Enhanced Styles */

/*
 * Style Isolation & CSS Reset
 * This block creates a scope to protect plugin styles from theme overrides.
 */
.wp-paywall-isolate {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

.wp-paywall-isolate h1,
.wp-paywall-isolate h2,
.wp-paywall-isolate h3,
.wp-paywall-isolate h4,
.wp-paywall-isolate h5,
.wp-paywall-isolate h6 {
    font-family: inherit;
    font-weight: 600;
    margin: 0 0 0.5em 0;
    color: inherit;
}

.wp-paywall-isolate h1 {
    font-size: 2.5rem;
}

.wp-paywall-isolate h2 {
    font-size: 2rem;
}

.wp-paywall-isolate h3 {
    font-size: 1.75rem;
}

.wp-paywall-isolate h4 {
    font-size: 1.5rem;
}

.wp-paywall-isolate h5 {
    font-size: 1.25rem;
}

.wp-paywall-isolate h6 {
    font-size: 1rem;
}

.wp-paywall-isolate p {
    margin: 0 0 1em 0;
}

.wp-paywall-isolate a {
    color: #007bff;
    text-decoration: none;
}

.wp-paywall-isolate a:hover {
    text-decoration: underline;
}

.wp-paywall-isolate button,
.wp-paywall-isolate .btn {
    font-family: inherit;
    font-size: 1rem !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.25rem !important;
    cursor: pointer;
    border: 1px solid transparent;
}

.wp-paywall-isolate button:hover,
.wp-paywall-isolate .btn:hover {
    opacity: 0.9;
}

/* End of Style Isolation */

/* Preview Content Fade Effect */
.wp-paywall-preview {
    position: relative;
    overflow: hidden;
}

.wp-paywall-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.9));
    pointer-events: none;
}

/* Custom Paywall Container Enhancements */
.wp-paywall-isolate .wp-paywall-container {
    max-width: 600px;
    margin: 2rem auto;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Stripe Elements Styling */
.wp-paywall-isolate #card-element {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 12px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#card-element:focus-within {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#card-element.StripeElement--invalid {
    border-color: #dc3545;
}

/* Loading Spinner Enhancement */
#submit-payment:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Custom Price Display */
.wp-paywall-isolate .price-display {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 700;
    font-size: 28px;
    color: #2271b1;
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
}

.wp-paywall-isolate .price-display .currency {
    font-size: 0.6em;
    font-weight: 600;
    margin-right: 0.25em;
}

.wp-paywall-isolate .price-display .amount {
    font-size: 1em;
}

.wp-paywall-isolate .price-display .interval {
    font-size: 0.5em;
    font-weight: 500;
    margin-left: 0.1em;
    color: #6c757d;
}

.wp-paywall-isolate .discount-info .badge {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
    font-size: 0.7em;
    padding: 0.25em 0.5em;
    font-weight: 600;
    margin-right: 5px;
}

.wp-paywall-isolate .discount-info .regular-price {
    font-size: 0.8em;
    color: #6c757d;
    text-decoration: line-through;
}

/* Admin Status Badges (keeping for backward compatibility) */
.premium-badge {
    background: #2271b1;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.free-badge {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-active {
    color: #28a745;
    font-weight: 600;
}

.status-expired {
    color: #dc3545;
    font-weight: 600;
}

.status-revoked {
    color: #6c757d;
    font-weight: 600;
}

.status-completed {
    color: #28a745;
    font-weight: 600;
}

.status-pending {
    color: #ffc107;
    font-weight: 600;
}

.status-failed {
    color: #dc3545;
    font-weight: 600;
}

/* Bootstrap 5 Modal Enhancements */
.wp-paywall-isolate .modal-dialog {
    max-width: 600px;
}

/* Account Dashboard Modal */
.wp-paywall-isolate .modal-xl .modal-content {
    max-width: 1200px;
}

/* Custom button hover effects for better UX */
.wp-paywall-isolate .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.wp-paywall-isolate .btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

/* Floating Account Button Styling */
.wp-paywall-floating-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    transition: all 0.3s ease;
}

.wp-paywall-floating-button:hover {
    transform: translateY(-2px);
}

.wp-paywall-floating-button.is-dragging {
    transition: none !important;
}

.wp-paywall-account-link {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(45deg, #2271b1, #1e5a8a);
    color: white !important;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: inherit;
    cursor: pointer;
}

.wp-paywall-account-link:hover {
    background: linear-gradient(45deg, #1e5a8a, #2271b1);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(34, 113, 177, 0.4);
    color: white !important;
    text-decoration: none;
}

.wp-paywall-account-link i {
    margin-right: 8px;
    font-size: 1.2em;
}

.wp-paywall-button-text {
    font-size: 0.9em;
    font-weight: 600;
}

/* Responsive floating button */
@media (max-width: 768px) {
    .wp-paywall-floating-button {
        bottom: 15px;
        right: 15px;
    }

    .wp-paywall-account-link {
        padding: 10px 16px;
    }

    .wp-paywall-button-text {
        display: none;
    }

    .wp-paywall-account-link i {
        margin-right: 0;
        font-size: 1.4em;
    }
}

/* Account Dashboard Tables */
.wp-paywall-isolate .wp-paywall-dashboard-table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wp-paywall-dashboard-table th {
    background: linear-gradient(45deg, #2271b1, #1e5a8a);
    color: white;
    font-weight: 600;
    border: none;
}

.wp-paywall-dashboard-table td {
    vertical-align: middle;
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.wp-paywall-dashboard-table tr:hover {
    background-color: rgba(34, 113, 177, 0.05);
}

/* Empty State Styling */
.wp-paywall-isolate .wp-paywall-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
}

.wp-paywall-empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* Tab Navigation Enhancement */
.wp-paywall-isolate .nav-tabs .nav-link {
    border-radius: 8px 8px 0 0;
    border: none;
    background: transparent;
    color: #6c757d;
    font-weight: 500;
    margin-right: 4px;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    background: rgba(34, 113, 177, 0.1);
    color: #2271b1;
}

.nav-tabs .nav-link.active {
    background: #2271b1;
    color: white;
    border: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-xl .modal-content {
        max-width: 100%;
        margin: 10px;
    }

    .wp-paywall-dashboard-table {
        font-size: 0.9em;
    }
}