/**
 * MSCF Popup Form Styles - 2025 Modern Design
 * Glassmorphism modal with backdrop blur
 */

/* Popup Overlay */
.mscf-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

.mscf-popup-overlay.mscf-popup-active {
    opacity: 1;
    visibility: visible;
}

/* Popup Container */
.mscf-popup-container {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mscf-popup-active .mscf-popup-container {
    transform: scale(1) translateY(0);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mscf-popup-container {
        background: rgba(30, 30, 30, 0.95);
        color: #ffffff;
    }
}

/* Close Button */
.mscf-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.mscf-popup-close:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: rotate(90deg);
}

.mscf-popup-close::before,
.mscf-popup-close::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 2px;
    background: #333;
    transition: background 0.3s ease;
}

.mscf-popup-close:hover::before,
.mscf-popup-close:hover::after {
    background: white;
}

.mscf-popup-close::before {
    transform: rotate(45deg);
}

.mscf-popup-close::after {
    transform: rotate(-45deg);
}

/* Popup Form Styles */
.mscf-popup-container .mscf-schema-form {
    margin: 0;
}

.mscf-popup-container h2 {
    margin: 0 0 24px 0;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Form Fields in Popup */
.mscf-popup-container .mscf-field-wrapper {
    margin-bottom: 20px;
}

.mscf-popup-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

@media (prefers-color-scheme: dark) {
    .mscf-popup-container label {
        color: #e5e7eb;
    }
}

.mscf-popup-container input[type="text"],
.mscf-popup-container input[type="email"],
.mscf-popup-container input[type="tel"],
.mscf-popup-container input[type="number"],
.mscf-popup-container input[type="date"],
.mscf-popup-container select,
.mscf-popup-container textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.mscf-popup-container input:focus,
.mscf-popup-container select:focus,
.mscf-popup-container textarea:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Submit Button in Popup */
.mscf-popup-container button[type="submit"] {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.mscf-popup-container button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.mscf-popup-container button[type="submit"]:active {
    transform: translateY(0);
}

/* Success Message in Popup */
.mscf-popup-container .mscf-success-message {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

/* Error Message in Popup */
.mscf-popup-container .mscf-error-message {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mscf-popup-container {
        padding: 30px 20px;
        border-radius: 16px;
        max-height: 85vh;
    }
    
    .mscf-popup-container h2 {
        font-size: 24px;
    }
    
    .mscf-popup-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
}

/* Scrollbar Styling for Popup */
.mscf-popup-container::-webkit-scrollbar {
    width: 8px;
}

.mscf-popup-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.mscf-popup-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    border-radius: 10px;
}

.mscf-popup-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563EB 100%);
}


/* Checkboxes and radio buttons */
.mscf-popup-container input[type="checkbox"],
.mscf-popup-container input[type="radio"],
.mscf-subscriptions input[type="checkbox"],
.mscf-subscriptions input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.mscf-popup-container label,
.mscf-subscriptions label {
    cursor: pointer !important;
    user-select: none;
}

.mscf-subscriptions {
    margin: 24px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.mscf-subscriptions h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
}

/* Animation for entrance */
@keyframes mscfPopupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Prevent body scroll when popup is open */
body.mscf-popup-open {
    overflow: hidden;
}

