/* 
 * Divi Theme Override Fix for RI Popups and Authentication
 * Fixes input field visibility and z-index layering issues with Divi themes
 * Divi often uses z-index values in the millions, so we need to go higher
 */

/* CRITICAL: Z-Index overrides for Divi theme interference */
body.et_divi_theme .multimodal-ai-auth-overlay,
html body.et_divi_theme .multimodal-ai-auth-overlay,
.et_divi_theme .multimodal-ai-auth-overlay,
#page-container .multimodal-ai-auth-overlay,
#et-main-area .multimodal-ai-auth-overlay {
    z-index: 999999999 !important; /* Higher than any Divi element */
}

body.et_divi_theme .multimodal-ai-modal,
html body.et_divi_theme .multimodal-ai-modal,
.et_divi_theme .multimodal-ai-modal,
#page-container .multimodal-ai-modal,
#et-main-area .multimodal-ai-modal {
    z-index: 999999998 !important; /* Higher than any Divi element */
}

body.et_divi_theme .custom-music-popup,
html body.et_divi_theme .custom-music-popup,
.et_divi_theme .custom-music-popup,
#page-container .custom-music-popup,
#et-main-area .custom-music-popup {
    z-index: 999999998 !important; /* Higher than any Divi element */
}

body.et_divi_theme .multimodal-ai-gallery-overlay,
html body.et_divi_theme .multimodal-ai-gallery-overlay,
.et_divi_theme .multimodal-ai-gallery-overlay,
#page-container .multimodal-ai-gallery-overlay,
#et-main-area .multimodal-ai-gallery-overlay {
    z-index: 999999997 !important; /* Higher than any Divi element */
}

body.et_divi_theme .multimodal-ai-gallery-player,
html body.et_divi_theme .multimodal-ai-gallery-player,
.et_divi_theme .multimodal-ai-gallery-player,
#page-container .multimodal-ai-gallery-player,
#et-main-area .multimodal-ai-gallery-player {
    z-index: 999999999 !important; /* Highest priority - same as auth overlay */
}

body.et_divi_theme #multimodal-ai-image-options,
html body.et_divi_theme #multimodal-ai-image-options,
.et_divi_theme #multimodal-ai-image-options,
#page-container #multimodal-ai-image-options,
#et-main-area #multimodal-ai-image-options {
    z-index: 999999998 !important; /* Higher than any Divi element */
}

body.et_divi_theme #multimodal-ai-video-options,
html body.et_divi_theme #multimodal-ai-video-options,
.et_divi_theme #multimodal-ai-video-options,
#page-container #multimodal-ai-video-options,
#et-main-area #multimodal-ai-video-options {
    z-index: 999999998 !important; /* Higher than any Divi element */
}

/* Additional Divi-specific modal overrides */
body.et_divi_theme .multimodal-ai-modal-content,
html body.et_divi_theme .multimodal-ai-modal-content,
.et_divi_theme .multimodal-ai-modal-content,
#page-container .multimodal-ai-modal-content,
#et-main-area .multimodal-ai-modal-content {
    z-index: 999999998 !important; /* Ensure modal content stays on top */
}

body.et_divi_theme .custom-music-popup-content,
html body.et_divi_theme .custom-music-popup-content,
.et_divi_theme .custom-music-popup-content,
#page-container .custom-music-popup-content,
#et-main-area .custom-music-popup-content {
    z-index: 999999999 !important; /* Highest priority for music modal content */
}

body.et_divi_theme .multimodal-ai-gallery-player-content,
html body.et_divi_theme .multimodal-ai-gallery-player-content,
.et_divi_theme .multimodal-ai-gallery-player-content,
#page-container .multimodal-ai-gallery-player-content,
#et-main-area .multimodal-ai-gallery-player-content {
    z-index: 999999999 !important; /* Highest priority for gallery player content */
}

/* Ultra-specific selectors to override Divi theme input styling */
body.et_divi_theme .multimodal-ai-auth-popup input[type="text"],
body.et_divi_theme .multimodal-ai-auth-popup input[type="email"], 
body.et_divi_theme .multimodal-ai-auth-popup input[type="password"],
html body.et_divi_theme .multimodal-ai-auth-popup input[type="text"],
html body.et_divi_theme .multimodal-ai-auth-popup input[type="email"],
html body.et_divi_theme .multimodal-ai-auth-popup input[type="password"],
.et_divi_theme .multimodal-ai-auth-popup input[type="text"],
.et_divi_theme .multimodal-ai-auth-popup input[type="email"],
.et_divi_theme .multimodal-ai-auth-popup input[type="password"],
#page-container .multimodal-ai-auth-popup input[type="text"],
#page-container .multimodal-ai-auth-popup input[type="email"], 
#page-container .multimodal-ai-auth-popup input[type="password"],
#et-main-area .multimodal-ai-auth-popup input[type="text"],
#et-main-area .multimodal-ai-auth-popup input[type="email"],
#et-main-area .multimodal-ai-auth-popup input[type="password"] {
    /* Light mode colors */
    background-color: #f8f9fa !important;
    color: #2c3e50 !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 6px !important;
    padding: 14px 16px !important;
    font-size: 15px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-align: left !important;
    vertical-align: baseline !important;
    margin: 0 !important;
}

/* Focus state for light mode */
body.et_divi_theme .multimodal-ai-auth-popup input[type="text"]:focus,
body.et_divi_theme .multimodal-ai-auth-popup input[type="email"]:focus,
body.et_divi_theme .multimodal-ai-auth-popup input[type="password"]:focus,
html body.et_divi_theme .multimodal-ai-auth-popup input[type="text"]:focus,
html body.et_divi_theme .multimodal-ai-auth-popup input[type="email"]:focus,
html body.et_divi_theme .multimodal-ai-auth-popup input[type="password"]:focus,
.et_divi_theme .multimodal-ai-auth-popup input[type="text"]:focus,
.et_divi_theme .multimodal-ai-auth-popup input[type="email"]:focus,
.et_divi_theme .multimodal-ai-auth-popup input[type="password"]:focus,
#page-container .multimodal-ai-auth-popup input[type="text"]:focus,
#page-container .multimodal-ai-auth-popup input[type="email"]:focus,
#page-container .multimodal-ai-auth-popup input[type="password"]:focus,
#et-main-area .multimodal-ai-auth-popup input[type="text"]:focus,
#et-main-area .multimodal-ai-auth-popup input[type="email"]:focus,
#et-main-area .multimodal-ai-auth-popup input[type="password"]:focus {
    border-color: #5c6bc0 !important;
    box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.1) !important;
    background-color: #ffffff !important;
    color: #2c3e50 !important;
}

/* Placeholder styling for light mode */
body.et_divi_theme .multimodal-ai-auth-popup input[type="text"]::placeholder,
body.et_divi_theme .multimodal-ai-auth-popup input[type="email"]::placeholder,
body.et_divi_theme .multimodal-ai-auth-popup input[type="password"]::placeholder,
html body.et_divi_theme .multimodal-ai-auth-popup input[type="text"]::placeholder,
html body.et_divi_theme .multimodal-ai-auth-popup input[type="email"]::placeholder,
html body.et_divi_theme .multimodal-ai-auth-popup input[type="password"]::placeholder,
.et_divi_theme .multimodal-ai-auth-popup input[type="text"]::placeholder,
.et_divi_theme .multimodal-ai-auth-popup input[type="email"]::placeholder,
.et_divi_theme .multimodal-ai-auth-popup input[type="password"]::placeholder,
#page-container .multimodal-ai-auth-popup input[type="text"]::placeholder,
#page-container .multimodal-ai-auth-popup input[type="email"]::placeholder,
#page-container .multimodal-ai-auth-popup input[type="password"]::placeholder,
#et-main-area .multimodal-ai-auth-popup input[type="text"]::placeholder,
#et-main-area .multimodal-ai-auth-popup input[type="email"]::placeholder,
#et-main-area .multimodal-ai-auth-popup input[type="password"]::placeholder {
    color: #6c757d !important;
    opacity: 0.8 !important;
    font-weight: 400 !important;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body.et_divi_theme .multimodal-ai-auth-popup input[type="text"],
    body.et_divi_theme .multimodal-ai-auth-popup input[type="email"], 
    body.et_divi_theme .multimodal-ai-auth-popup input[type="password"],
    html body.et_divi_theme .multimodal-ai-auth-popup input[type="text"],
    html body.et_divi_theme .multimodal-ai-auth-popup input[type="email"],
    html body.et_divi_theme .multimodal-ai-auth-popup input[type="password"],
    .et_divi_theme .multimodal-ai-auth-popup input[type="text"],
    .et_divi_theme .multimodal-ai-auth-popup input[type="email"],
    .et_divi_theme .multimodal-ai-auth-popup input[type="password"],
    #page-container .multimodal-ai-auth-popup input[type="text"],
    #page-container .multimodal-ai-auth-popup input[type="email"], 
    #page-container .multimodal-ai-auth-popup input[type="password"],
    #et-main-area .multimodal-ai-auth-popup input[type="text"],
    #et-main-area .multimodal-ai-auth-popup input[type="email"],
    #et-main-area .multimodal-ai-auth-popup input[type="password"] {
        background-color: #2c3e50 !important;
        color: #ecf0f1 !important;
        border: 2px solid #34495e !important;
    }
    
    /* Dark mode focus state */
    body.et_divi_theme .multimodal-ai-auth-popup input[type="text"]:focus,
    body.et_divi_theme .multimodal-ai-auth-popup input[type="email"]:focus,
    body.et_divi_theme .multimodal-ai-auth-popup input[type="password"]:focus,
    html body.et_divi_theme .multimodal-ai-auth-popup input[type="text"]:focus,
    html body.et_divi_theme .multimodal-ai-auth-popup input[type="email"]:focus,
    html body.et_divi_theme .multimodal-ai-auth-popup input[type="password"]:focus,
    .et_divi_theme .multimodal-ai-auth-popup input[type="text"]:focus,
    .et_divi_theme .multimodal-ai-auth-popup input[type="email"]:focus,
    .et_divi_theme .multimodal-ai-auth-popup input[type="password"]:focus,
    #page-container .multimodal-ai-auth-popup input[type="text"]:focus,
    #page-container .multimodal-ai-auth-popup input[type="email"]:focus,
    #page-container .multimodal-ai-auth-popup input[type="password"]:focus,
    #et-main-area .multimodal-ai-auth-popup input[type="text"]:focus,
    #et-main-area .multimodal-ai-auth-popup input[type="email"]:focus,
    #et-main-area .multimodal-ai-auth-popup input[type="password"]:focus {
        border-color: #7676d8 !important;
        box-shadow: 0 0 0 3px rgba(118, 118, 216, 0.2) !important;
        background-color: #34495e !important;
        color: #ecf0f1 !important;
    }
    
    /* Dark mode placeholder */
    body.et_divi_theme .multimodal-ai-auth-popup input[type="text"]::placeholder,
    body.et_divi_theme .multimodal-ai-auth-popup input[type="email"]::placeholder,
    body.et_divi_theme .multimodal-ai-auth-popup input[type="password"]::placeholder,
    html body.et_divi_theme .multimodal-ai-auth-popup input[type="text"]::placeholder,
    html body.et_divi_theme .multimodal-ai-auth-popup input[type="email"]::placeholder,
    html body.et_divi_theme .multimodal-ai-auth-popup input[type="password"]::placeholder,
    .et_divi_theme .multimodal-ai-auth-popup input[type="text"]::placeholder,
    .et_divi_theme .multimodal-ai-auth-popup input[type="email"]::placeholder,
    .et_divi_theme .multimodal-ai-auth-popup input[type="password"]::placeholder,
    #page-container .multimodal-ai-auth-popup input[type="text"]::placeholder,
    #page-container .multimodal-ai-auth-popup input[type="email"]::placeholder,
    #page-container .multimodal-ai-auth-popup input[type="password"]::placeholder,
    #et-main-area .multimodal-ai-auth-popup input[type="text"]::placeholder,
    #et-main-area .multimodal-ai-auth-popup input[type="email"]::placeholder,
    #et-main-area .multimodal-ai-auth-popup input[type="password"]::placeholder {
        color: #bdc3c7 !important;
        opacity: 0.8 !important;
    }
}

/* Additional fallback for any remaining Divi interference */
.multimodal-ai-auth-popup .form-group input {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
    background-clip: padding-box !important;
    border-style: solid !important;
    border-width: 2px !important;
    display: block !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-indent: 0 !important;
    text-shadow: none !important;
    white-space: normal !important;
    word-spacing: normal !important;
} 