/* Frontend Styles for Dynamic HTML Embed Builder */

.dheb-columns,
.dheb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
    padding: 10px;
}

/* Responsive Columns for Mobile */
@media (max-width: 768px) {
    /* Force stacking on all common container elements */
    #dheb-root, #dheb-root * {
        box-sizing: border-box !important;
        max-width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    #dheb-root div, 
    #dheb-root section, 
    #dheb-root header, 
    #dheb-root footer,
    #dheb-root main,
    #dheb-root article,
    #dheb-root nav,
    #dheb-root aside,
    #dheb-root ul,
    #dheb-root ol,
    .dheb-columns, 
    .dheb-grid,
    .pricing-container,
    .flex-container,
    .container,
    .row,
    [style*="display: flex"],
    [style*="display:flex"],
    [style*="display: grid"],
    [style*="display:grid"] {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        gap: 20px !important;
        height: auto !important;
        min-height: auto !important;
        float: none !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        background-attachment: scroll !important;
        grid-template-columns: 1fr !important;
    }

    /* Ensure ALL direct children of stacking containers take full width */
    #dheb-root div > *,
    #dheb-root section > *,
    #dheb-root header > *,
    #dheb-root footer > *,
    .dheb-columns > *,
    .dheb-grid > *,
    .flex-container > *,
    .container > *,
    .row > *,
    .dheb-column,
    .pricing-card,
    .grid-item,
    li {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 15px !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        float: none !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
    }

    .dheb-columns.dheb-columns-reverse-mobile,
    .dheb-grid.dheb-grid-reverse-mobile {
        flex-direction: column-reverse !important;
    }
    
    .dheb-column,
    .dheb-grid > div,
    .pricing-card,
    .grid-item {
        width: 100% !important;
        min-height: auto !important;
        margin-bottom: 15px !important;
        box-sizing: border-box !important;
        flex: none !important;
        padding: 15px !important;
    }

    /* Ensure images are visible and responsive */
    img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Ensure background images are visible and cover the area */
    [style*="background-image"],
    [style*="background:"],
    [class*="bg-image"],
    [class*="hero"],
    [class*="header"],
    header,
    .header,
    .hero {
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        background-attachment: scroll !important;
        min-height: 300px !important; 
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Video Wrapper Fixes */
.dheb-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    margin: 15px 0;
    background: #000;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    pointer-events: auto !important;
}

.dheb-video-wrapper iframe,
.dheb-video-wrapper video,
.dheb-video-wrapper * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: auto !important; /* CRITICAL: Ensure videos are clickable on frontend */
    z-index: 10 !important;
}

/* Slots Availability Styles */
.dheb-slots-container {
    background: #001a0a; /* Dark green background like screenshot */
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    margin: 20px 0;
    font-family: 'Inter', sans-serif;
    text-align: center;
    border: 1px solid #003311;
}

.dheb-slots-header {
    font-size: 24px;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0 0 5px 0;
    letter-spacing: 1px;
}

.dheb-slots-sub {
    font-size: 12px;
    color: #888;
    margin-bottom: 25px;
}

.dheb-slots-boxes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.dheb-slot-box {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #001a0a; /* Filled with dark green */
    border: 1px solid #00ff66; /* Bright green border */
    border-radius: 4px;
    font-weight: bold;
    color: #00ff66; /* Bright green text */
    font-size: 18px;
}

.dheb-slot-box.is-taken {
    background: #00ff66; /* Solid bright green */
    border-color: #00ff66;
    color: #001a0a; /* Dark text */
}

.dheb-slots-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 14px;
    color: #aaa;
    margin-bottom: 15px;
}

.dheb-slots-progress-wrap {
    background: #003311;
    height: 30px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
    border: 1px solid #004d1a;
}

.dheb-slots-progress-bar {
    background: linear-gradient(90deg, #00ff66, #00cc52);
    height: 100%;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 255, 102, 0.3);
}

.dheb-slots-progress-text {
    color: #001a0a;
    font-weight: bold;
    font-size: 14px;
}

.dheb-slots-footer {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #00ff66;
    font-weight: 600;
}

.dheb-slots-urgency-wrap {
    margin-top: 25px;
    padding: 20px;
    background: rgba(0, 255, 102, 0.05);
    border: 1px dashed #004d1a;
    border-radius: 8px;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.dheb-slots-urgency-dot {
    width: 10px;
    height: 10px;
    background: #00ff66;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
    box-shadow: 0 0 10px #00ff66;
}

.dheb-slots-urgency-text {
    font-size: 14px;
    line-height: 1.5;
    color: #ff9900;
    font-weight: 500;
}

/* FAQ Styles */
.dheb-faq-item {
    transition: all 0.3s ease;
    padding: 0 20px;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
    border-radius: 4px;
    position: relative;
    z-index: 100; /* Ensure it's above other elements */
}

.dheb-faq-item:hover {
    background-color: rgba(65, 105, 225, 0.05) !important; /* Subtle blue hover */
    cursor: pointer;
}

.dheb-faq-question {
    font-weight: 800;
    font-size: 22px;
    padding: 15px 0 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #4169e1; /* Royal Blue like screenshot */
    transition: color 0.3s ease;
    pointer-events: none; /* Let the click fall through to the item */
}

.dheb-faq-item:hover .dheb-faq-question {
    color: #5d83f2; /* Lighter blue on hover */
}

.dheb-faq-answer {
    display: none !important;
    padding: 10px 0 20px 0;
    color: #aaa; /* Grayish text like screenshot */
    line-height: 1.6;
    font-size: 16px;
    transition: color 0.3s ease;
}

.dheb-faq-item.is-open .dheb-faq-answer {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
}

.dheb-faq-item:hover .dheb-faq-answer {
    color: #eee !important;
}

.dheb-faq-icon {
    font-size: 20px;
    font-weight: bold;
    pointer-events: none;
}

@media (max-width: 600px) {
    .dheb-slot-box {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    .dheb-slots-footer {
        flex-direction: column;
        gap: 5px;
    }
}

/* Testimonial Responsive */
@media (max-width: 480px) {
    .dheb-testimonial {
        flex-direction: column !important;
        text-align: center !important;
        padding: 15px !important;
    }
    
    .dheb-testimonial img {
        margin: 0 auto !important;
    }
}
