/* Dreamedia Call-to-Purchase Modal Styles */

/* Modal Overlay - Force highest z-index */
.dreamedia-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 2147483647 !important; /* Maximum z-index value */
    display: none;
    isolation: isolate; /* Create new stacking context */
}

.dreamedia-modal-overlay {
    position: fixed !important; /* Changed from absolute to fixed */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    z-index: 2147483647 !important; /* Maximum z-index value */
}

/* Modal Content */
.dreamedia-modal-content {
    position: fixed !important; /* Changed from absolute to fixed */
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: #ffffff !important;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 1000px; /* Increased from 900px */
    width: 95%; /* Increased from 90% */
    max-height: 85vh; /* Increased from 80vh */
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
    z-index: 2147483647 !important; /* Maximum z-index value */
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Modal Header */
.dreamedia-modal-header {
    position: relative;
    padding: 20px 20px 0;
    text-align: right;
}

.dreamedia-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dreamedia-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Modal Body */
.dreamedia-modal-body {
    padding: 0 20px 30px;
}

/* Main Header Above Columns */
.dreamedia-modal-main-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 0 20px;
}

.dreamedia-modal-main-header h2 {
    font-size: 32px;
    color: #333;
    margin: 0;
    line-height: 1.3;
    font-weight: 700;
}

.dreamedia-modal-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* Column Headers - Consistent positioning */
.column-header {
    font-size: 1.5em;
    color: #333;
    margin: 0 0 30px 0;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    min-height: 3.6em; /* Ensures consistent height across columns */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Left Column - Redesigned Call Section */
.dreamedia-call-section {
    text-align: center;
    padding: 0 20px;
}

/* Redesigned Avatar - Centered Square with Rounded Corners */
.expert-avatar-redesigned {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    object-fit: cover;
    margin: 0 auto 20px;
    display: block;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}



/* Redesigned Phone Button - Site Green Color */
.phone-number-redesigned {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #5db737; /* Specific site green */
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(93, 183, 55, 0.3);
}

.phone-number-redesigned:hover {
    background: #4a9b2b; /* Darker shade for hover */
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(93, 183, 55, 0.4);
}

.phone-number-redesigned .phone-icon {
    font-size: 16px;
}

/* Product Display Section */
.modal-product-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    margin-top: 20px;
}

.modal-product-image {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto 15px;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-product-name {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    text-align: center;
}

/* Right Column - Contact Form */

/* Formidable Form Styling */
.dreamedia-contact-form .frm_forms {
    margin: 0;
}

.dreamedia-contact-form .frm_form_fields {
    padding: 0;
}

.dreamedia-contact-form .frm_form_field {
    margin-bottom: 20px;
}

.dreamedia-contact-form .frm_form_field label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.dreamedia-contact-form .frm_form_field input,
.dreamedia-contact-form .frm_form_field textarea,
.dreamedia-contact-form .frm_form_field select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.dreamedia-contact-form .frm_form_field input:focus,
.dreamedia-contact-form .frm_form_field textarea:focus,
.dreamedia-contact-form .frm_form_field select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.dreamedia-contact-form .frm_submit {
    text-align: center;
}

.dreamedia-contact-form .frm_submit input {
    background: #007cba;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    width: auto;
}

.dreamedia-contact-form .frm_submit input:hover {
    background: #005a87;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dreamedia-modal-content {
        width: 95%;
        margin: 20px;
        max-height: 90vh;
    }
    
    .dreamedia-modal-columns {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .dreamedia-modal-main-header h2 {
        font-size: 26px;
    }
    
    .expert-avatar-redesigned {
        width: 100px;
        height: 100px;
        border-radius: 12px;
    }
    
    .column-header {
        font-size: 1.3em;
        min-height: 3em;
    }
    
    .phone-number-redesigned {
        font-size: 16px;
        padding: 12px 20px;
    }
    
    .modal-product-image {
        max-width: 150px;
    }
    
    .dreamedia-modal-header {
        padding: 15px 15px 0;
    }
    
    .dreamedia-modal-body {
        padding: 0 15px 20px;
    }
}

@media (max-width: 480px) {
    .dreamedia-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        transform: translate(-50%, -50%);
    }
    
    .dreamedia-modal-main-header h2 {
        font-size: 22px;
    }
    
    .expert-avatar-redesigned {
        width: 80px;
        height: 80px;
        border-radius: 10px;
    }
    
    .phone-number-redesigned {
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .modal-product-image {
        max-width: 120px;
    }
}

/* Success State */
.dreamedia-modal.success .dreamedia-modal-content {
    max-width: 500px;
}

.dreamedia-modal-success {
    text-align: center;
    padding: 40px 20px;
}

.dreamedia-modal-success h2 {
    color: #28a745;
    margin-bottom: 15px;
}

.dreamedia-modal-success p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

/* Z-Index Overrides for All Navigation Menus and Themes */
body .dreamedia-modal,
html .dreamedia-modal,
.et_pb_section .dreamedia-modal,
.et_builder_inner_content .dreamedia-modal,
#et-main-area .dreamedia-modal,
.et-l .dreamedia-modal,
.et_pb_row .dreamedia-modal {
    z-index: 2147483647 !important; /* Maximum possible z-index */
    position: fixed !important;
}

/* Force modal elements to the top of stacking order */
body .dreamedia-modal-overlay,
body .dreamedia-modal-content {
    z-index: 2147483647 !important;
    position: fixed !important;
}

/* Create new stacking context to isolate from parent z-indexes */
.dreamedia-modal {
    transform: translateZ(0); /* Force hardware acceleration and new layer */
}
