/**
 * Free Course Custom Form Popup Styles
 * Dexeus Campus Plugin
 */

/* Popup Overlay */
.dexeus-form-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.dexeus-form-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Popup Container */
.dexeus-form-popup {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    margin: auto;
}

.dexeus-form-popup-overlay.active .dexeus-form-popup {
    transform: scale(1);
}

/* Popup Header */
.dexeus-popup-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 10;
    border-radius: 8px 8px 0 0;
}

.dexeus-popup-title {
    margin: 0;
    padding-right: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dexeus-popup-title-label {
    font-size: 13px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.dexeus-popup-title-product {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.dexeus-popup-close {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    font-size: 28px;
    line-height: 1;
    color: #333 !important;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.dexeus-popup-close:hover,
.dexeus-popup-close:focus {
    opacity: 0.7;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Popup Content */
.dexeus-popup-content {
    padding: 30px 25px;
}

/* Enrollment Button */
.dexeus-open-form-popup {
    font-size: 17px !important;
    font-weight: 400 !important;
    color: #fff !important;
    background-color: var(--e-global-color-primary) !important;
    padding: 15px 20px 15px 20px !important;
}

.dexeus-open-form-popup::before,
.dexeus-open-form-popup::after {
    display: none !important;
    content: none !important;
}

/* Loading State */
.dexeus-open-form-popup.loading {
    pointer-events: none !important;
    opacity: 0.7 !important;
    font-size: 17px !important;
    /* Override WooCommerce loading styles */
    position: relative !important;
    z-index: auto !important;
    width: auto !important;
    height: auto !important;
    background-image: none !important;
    background-color: var(--e-global-color-primary) !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: auto !important;
    top: auto !important;
    left: auto !important;
}

.dexeus-open-form-popup.loading::before,
.dexeus-open-form-popup.loading::after {
    display: none !important;
    content: none !important;
}

/* Error Notice */
.dexeus-error-notice {
    padding: 15px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    color: #991b1b;
    margin: 15px 0;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .dexeus-form-popup-overlay {
        padding: 10px;
        align-items: flex-start;
    }

    .dexeus-form-popup {
        max-height: none;
        min-height: 100%;
        margin: 0;
        border-radius: 0;
    }

    .dexeus-popup-header {
        padding: 12px 15px;
        border-radius: 0;
    }

    .dexeus-popup-title {
        padding-right: 12px;
    }

    .dexeus-popup-title-label {
        font-size: 11px;
    }

    .dexeus-popup-title-product {
        font-size: 14px;
    }

    .dexeus-popup-close {
        font-size: 28px;
        width: 28px;
        height: 28px;
    }

    .dexeus-popup-content {
        padding: 20px 15px;
    }
}

/* Elementor Form Styling inside Popup */
.dexeus-popup-content .elementor-form {
    margin: 0;
}

.dexeus-popup-content .elementor-field-group {
    margin-bottom: 15px;
}

.dexeus-popup-content .elementor-button {
    width: 100%;
    max-width: none;
}

/* Ensure popup appears above everything */
.dexeus-form-popup-overlay {
    z-index: 999999 !important;
}

/* Fix for Elementor widgets inside popup */
.dexeus-popup-content .elementor-widget-container {
    margin: 0;
}

/* Smooth scrolling for popup content */
.dexeus-form-popup {
    -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar for popup */
.dexeus-form-popup::-webkit-scrollbar {
    width: 8px;
}

.dexeus-form-popup::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 8px 8px 0;
}

.dexeus-form-popup::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.dexeus-form-popup::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Prevent body scroll when popup is open */
body.dexeus-popup-open {
    overflow: hidden;
}

/* Success Message */
.dexeus-enrollment-success {
    text-align: center;
    padding: 60px 40px;
}

.dexeus-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    background-color: #10b981;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    line-height: 1;
}

.dexeus-success-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.dexeus-success-message {
    font-size: 16px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Responsive Success Message */
@media screen and (max-width: 768px) {
    .dexeus-enrollment-success {
        padding: 40px 20px;
    }

    .dexeus-success-icon {
        width: 60px;
        height: 60px;
        font-size: 36px;
        margin-bottom: 20px;
    }

    .dexeus-success-title {
        font-size: 20px;
    }

    .dexeus-success-message {
        font-size: 14px;
    }
}
