/**
 * Elementor Compatibility Styles
 * Ensures Elementor elements work seamlessly with TLC PTO theme
 */

/* Fix for dotLottie player animations */
#chat-animation,
dotlottie-player {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 40px !important;
    max-height: 40px !important;
    margin: 0 auto !important;
}

/* Ensure inline SVGs respect Tailwind width/height utilities inside our theme */
.elementor-widget-container svg,
.tlcpto-content svg,
.card svg {
    max-width: none !important;
    width: auto;
    height: auto;
    display: inline-block;
}

/* Hard cap events page icons to expected size */
.event-types svg {
    width: 2rem !important;   /* Tailwind w-8 */
    height: 2rem !important;  /* Tailwind h-8 */
}

/* Ensure CTA buttons inside gradient panel have correct text colors even if globals override */
.tlc-cta.tlc-cta--gradient .cta-primary {
    color: #003870 !important; /* brand navy text */
}

.tlc-cta.tlc-cta--gradient .cta-secondary {
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* Guard: prevent white text on light backgrounds */
.bg-white .text-white,
.bg-gray-50 .text-white,
.bg-gray-100 .text-white {
    color: var(--tlcpto-brand-navy) !important;
}

/* Global fix: ensure text-white is actually white on dark backgrounds */
.bg-brand-navy .text-white,
.bg-brand-blue .text-white,
.bg-gradient-to-r .text-white,
.text-white {
    color: #ffffff !important;
}

/* Extra strong override for gradient backgrounds */
[class*="bg-gradient"] .text-white,
[class*="from-brand-navy"] .text-white,
[class*="to-brand-blue"] .text-white {
    color: #ffffff !important;
}

/* Ensure CTA heading/body colors on gradient containers */
.tlc-cta.tlc-cta--gradient,
.tlc-cta.tlc-cta--gradient h1,
.tlc-cta.tlc-cta--gradient h2,
.tlc-cta.tlc-cta--gradient h3 {
    color: #ffffff !important;
}

.tlc-cta.tlc-cta--gradient p {
    color: #e5f0ff !important; /* slightly brighter than blue-100 for readability */
}

/* Solid background for chat bubble animation (avoid transparency) */
#chat-lottie {
    background-color: #ffffff !important;
    border-radius: 9999px !important; /* full circle */
    overflow: hidden !important;
}

/* Ensure the dotlottie player has a white background */
#chat-animation {
    background-color: #ffffff !important;
    border-radius: 9999px !important; /* ensure circular background */
}

/* Ensure contact popup elements are properly positioned */
#contact-popup {
    z-index: 9999 !important;
}

/* COMMENTED OUT - Mobile chat bubble disabled */
/* #mobile-chat-bubble {
    z-index: 9998 !important;
} */

/* Elementor Editor Compatibility */
.elementor-editor-active {
    /* Ensure our theme elements don't interfere with Elementor editor */
    /* #mobile-chat-bubble, */
    #contact-popup {
        display: none !important;
    }
    
    /* Fix for editor preview container */
    .elementor-preview-container {
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* Ensure editor elements are visible */
    .elementor-editor-element {
        position: relative !important;
        z-index: 10 !important;
    }
}

/* Elementor Container Compatibility */
.elementor-section.elementor-section-stretched {
    left: 0 !important;
    width: 100% !important;
}

/* Elementor Widget Spacing */
.elementor-widget-container {
    margin-bottom: 0;
}

/* Custom Brand Colors for Elementor */
.elementor-widget-container .tlcpto-brand-navy {
    color: var(--tlcpto-brand-navy) !important;
}

.elementor-widget-container .tlcpto-brand-blue {
    color: var(--tlcpto-brand-blue) !important;
}

.elementor-widget-container .tlcpto-brand-gray {
    color: var(--tlcpto-brand-gray) !important;
}

.elementor-widget-container .tlcpto-accent-yellow {
    color: var(--tlcpto-accent-yellow) !important;
}

/* Background Colors */
.elementor-widget-container .tlcpto-bg-navy {
    background-color: var(--tlcpto-brand-navy) !important;
}

.elementor-widget-container .tlcpto-bg-blue {
    background-color: var(--tlcpto-brand-blue) !important;
}

.elementor-widget-container .tlcpto-bg-yellow {
    background-color: var(--tlcpto-accent-yellow) !important;
}

/* Button Styles */
.elementor-button.tlcpto-btn-primary {
    background-color: var(--tlcpto-brand-navy) !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.elementor-button.tlcpto-btn-primary:hover {
    background-color: #002a5a !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 56, 112, 0.3) !important;
}

.elementor-button.tlcpto-btn-secondary {
    background-color: var(--tlcpto-brand-blue) !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.elementor-button.tlcpto-btn-secondary:hover {
    background-color: #4a9fd8 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(89, 188, 235, 0.3) !important;
}

.elementor-button.tlcpto-btn-accent {
    background-color: var(--tlcpto-accent-yellow) !important;
    color: #333 !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.elementor-button.tlcpto-btn-accent:hover {
    background-color: #e6c700 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(255, 221, 0, 0.3) !important;
}

/* Card Styles */
.elementor-widget-container .tlcpto-card {
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    padding: 24px !important;
    transition: all 0.3s ease !important;
}

.elementor-widget-container .tlcpto-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Typography */
.elementor-widget-container .tlcpto-heading {
    font-family: 'Inter', sans-serif !important;
    font-weight: 700 !important;
    color: var(--tlcpto-brand-navy) !important;
}

.elementor-widget-container .tlcpto-subheading {
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    color: var(--tlcpto-brand-blue) !important;
}

.elementor-widget-container .tlcpto-body-text {
    font-family: 'Inter', sans-serif !important;
    font-weight: 400 !important;
    color: var(--tlcpto-brand-gray) !important;
    line-height: 1.6 !important;
}

/* Form Styles */
.elementor-widget-container .tlcpto-form input,
.elementor-widget-container .tlcpto-form textarea,
.elementor-widget-container .tlcpto-form select {
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-family: 'Inter', sans-serif !important;
    transition: all 0.3s ease !important;
}

.elementor-widget-container .tlcpto-form input:focus,
.elementor-widget-container .tlcpto-form textarea:focus,
.elementor-widget-container .tlcpto-form select:focus {
    border-color: var(--tlcpto-brand-blue) !important;
    box-shadow: 0 0 0 3px rgba(89, 188, 235, 0.1) !important;
    outline: none !important;
}

/* Spacing Utilities */
.elementor-widget-container .tlcpto-mt-1 { margin-top: 0.25rem !important; }
.elementor-widget-container .tlcpto-mt-2 { margin-top: 0.5rem !important; }
.elementor-widget-container .tlcpto-mt-4 { margin-top: 1rem !important; }
.elementor-widget-container .tlcpto-mt-8 { margin-top: 2rem !important; }
.elementor-widget-container .tlcpto-mt-12 { margin-top: 3rem !important; }

.elementor-widget-container .tlcpto-mb-1 { margin-bottom: 0.25rem !important; }
.elementor-widget-container .tlcpto-mb-2 { margin-bottom: 0.5rem !important; }
.elementor-widget-container .tlcpto-mb-4 { margin-bottom: 1rem !important; }
.elementor-widget-container .tlcpto-mb-8 { margin-bottom: 2rem !important; }
.elementor-widget-container .tlcpto-mb-12 { margin-bottom: 3rem !important; }

.elementor-widget-container .tlcpto-p-4 { padding: 1rem !important; }
.elementor-widget-container .tlcpto-p-6 { padding: 1.5rem !important; }
.elementor-widget-container .tlcpto-p-8 { padding: 2rem !important; }

/* Responsive Design */
@media (max-width: 768px) {
    .elementor-widget-container .tlcpto-card {
        padding: 16px !important;
    }
    
    .elementor-button.tlcpto-btn-primary,
    .elementor-button.tlcpto-btn-secondary,
    .elementor-button.tlcpto-btn-accent {
        padding: 10px 20px !important;
        font-size: 14px !important;
    }
}

/* Z-Index Compatibility */
.elementor-widget-container .tlcpto-z-content { z-index: var(--z-content) !important; }
.elementor-widget-container .tlcpto-z-modal { z-index: var(--z-modal) !important; }
.elementor-widget-container .tlcpto-z-header { z-index: var(--z-header) !important; }
