/**
 * ASQ Content Gate Styles - CSS Classes Version for Elementor
 * Prevents flash of incorrect content
 */

/* CRITICAL: Hide all gated buttons by default to prevent flash */
.asq-btn-preview,
.asq-btn-join,
.asq-btn-view {
    display: none !important;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show buttons with fade-in effect when JavaScript enables them */
.asq-btn-preview.asq-visible,
.asq-btn-join.asq-visible,
.asq-btn-view.asq-visible {
    display: inline-block !important;
    opacity: 1;
}

/* For Elementor Button Widget - ensure proper display */
.elementor-button.asq-btn-preview.asq-visible,
.elementor-button.asq-btn-join.asq-visible,
.elementor-button.asq-btn-view.asq-visible {
    display: inline-flex !important; /* Elementor uses flex */
}

/* Loading state for the entire page while checking membership */
body.asq-checking-membership .asq-btn-preview,
body.asq-checking-membership .asq-btn-join,
body.asq-checking-membership .asq-btn-view {
    pointer-events: none;
}

/* Optional: Loading spinner container */
.asq-loading-indicator {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0065b3;
    border-radius: 50%;
    animation: asq-spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes asq-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Member badge styling (optional) */
.asq-member-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ensure Elementor buttons maintain their styling */
.elementor-button.asq-btn-preview,
.elementor-button.asq-btn-join,
.elementor-button.asq-btn-view {
    /* Preserve Elementor's button styling */
    align-items: center;
    justify-content: center;
}

/* ============================================
   MEMBERSHIP MODAL STYLES
   ============================================ */

/* Modal Overlay */
.asq-membership-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
}

.asq-membership-modal-overlay.asq-modal-active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Modal Container */
.asq-membership-modal {
    background: #ffffff;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.asq-membership-modal-overlay.asq-modal-active .asq-membership-modal {
    transform: scale(1);
}

/* Modal Header */
.asq-modal-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #2c3e50;
    padding: 28px 30px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid #dee2e6;
}

.asq-modal-icon {
    width: 50px;
    height: 50px;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
}

.asq-modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    color: #2c3e50;
}

/* Close Button */
.asq-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.asq-modal-close:hover {
    background: #e9ecef;
    color: #495057;
}

/* Modal Body */
.asq-modal-body {
    padding: 32px 30px;
}

.asq-modal-message {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin: 0 0 28px 0;
    text-align: center;
}

/* Modal Actions */
.asq-modal-actions {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.asq-modal-btn {
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.asq-modal-btn-primary {
    background: linear-gradient(135deg, #ffffff 0%, #cab8dd 100%);
    color: #000000 !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    text-decoration: none !important;
}

.asq-modal-btn-primary:hover {
    color: #0b6bb5 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
}

.asq-modal-btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.asq-modal-btn-secondary:hover {
    background: #e9ecef;
    color: #495057;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .asq-membership-modal {
        width: 95%;
        margin: 10px;
    }
    
    .asq-modal-header {
        padding: 20px;
    }
    
    .asq-modal-icon {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
    
    .asq-modal-title {
        font-size: 18px;
    }
    
    .asq-modal-body {
        padding: 24px 20px;
    }
    
    .asq-modal-message {
        font-size: 15px;
    }
    
    .asq-modal-btn {
        padding: 12px 24px;
        font-size: 15px;
    }
}

/* Animation for modal entrance */
@keyframes asq-modal-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}