/**
 * Divi integration styles for WP Indak Way plugin
 */

/* Divi Builder Integration */
.et_pb_wp_indak_way_module {
    background: var(--wp-indak-way-background-color, #ffffff);
    border: 1px solid var(--wp-indak-way-border-color, #e5e5e5);
    border-radius: var(--wp-indak-way-border-radius, 4px);
    padding: 20px;
    margin: 10px 0;
}

/* Divi theme compatibility */
.et_pb_section .wp-indak-way-component,
.et_pb_row .wp-indak-way-component,
.et_pb_column .wp-indak-way-component {
    font-family: inherit;
}

/* Override Divi's default styles for our components */
.et_pb_section .wp-indak-way-disable-comments-notice,
.et_pb_row .wp-indak-way-disable-comments-notice,
.et_pb_column .wp-indak-way-disable-comments-notice {
    font-size: 14px;
    line-height: 1.5;
    margin: 20px 0;
    padding: 15px 20px;
}

.et_pb_section .wp-indak-way-search-replace-form,
.et_pb_row .wp-indak-way-search-replace-form,
.et_pb_column .wp-indak-way-search-replace-form {
    margin: 20px 0;
    padding: 25px;
}

/* Divi button compatibility */
.et_pb_section .wp-indak-way-button,
.et_pb_row .wp-indak-way-button,
.et_pb_column .wp-indak-way-button {
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: var(--wp-indak-way-border-radius, 4px);
    transition: var(--wp-indak-way-transition, all 0.3s ease);
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}

/* Ensure our styles take precedence over Divi's aggressive button styles */
.et_pb_section .wp-indak-way-button:hover,
.et_pb_row .wp-indak-way-button:hover,
.et_pb_column .wp-indak-way-button:hover,
.et_pb_section .wp-indak-way-button:focus,
.et_pb_row .wp-indak-way-button:focus,
.et_pb_column .wp-indak-way-button:focus {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

/* Divi's full-width sections */
.et_pb_fullwidth_section .wp-indak-way-component {
    max-width: 1080px;
    margin: 0 auto;
}

/* Divi specialty sections */
.et_pb_specialty_column .wp-indak-way-component {
    width: 100%;
}

/* Divi's column layouts */
.et_pb_column_1_2 .wp-indak-way-search-replace-form,
.et_pb_column_1_3 .wp-indak-way-search-replace-form,
.et_pb_column_1_4 .wp-indak-way-search-replace-form {
    padding: 20px 15px;
}

.et_pb_column_1_4 .wp-indak-way-button {
    font-size: 12px;
    padding: 8px 12px;
}

/* Divi Builder backend styles */
.et-fb .wp-indak-way-component {
    pointer-events: none;
    position: relative;
}

.et-fb .wp-indak-way-component::after {
    content: "WP Indak Way Component";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
}

/* Divi theme's responsive breakpoints */
@media (max-width: 980px) {
    .et_pb_section .wp-indak-way-search-replace-form,
    .et_pb_row .wp-indak-way-search-replace-form {
        padding: 20px;
    }
    
    .et_pb_section .wp-indak-way-button,
    .et_pb_row .wp-indak-way-button {
        display: block;
        width: 100%;
        text-align: center;
        margin: 10px 0;
    }
}

@media (max-width: 767px) {
    .et_pb_section .wp-indak-way-search-replace-form,
    .et_pb_row .wp-indak-way-search-replace-form,
    .et_pb_section .wp-indak-way-card,
    .et_pb_row .wp-indak-way-card {
        padding: 15px;
        margin: 15px 0;
    }
    
    .et_pb_section .wp-indak-way-disable-comments-notice,
    .et_pb_row .wp-indak-way-disable-comments-notice {
        padding: 12px 15px;
        font-size: 13px;
    }
}

/* Divi's dark mode support */
.et_pb_section.et_pb_section_dark .wp-indak-way-component,
.et_pb_row.et_pb_row_dark .wp-indak-way-component {
    --wp-indak-way-background-color: #2a2a2a;
    --wp-indak-way-text-color: #ffffff;
    --wp-indak-way-border-color: #444444;
    --wp-indak-way-disable-comments-notice-bg: #333333;
    --wp-indak-way-disable-comments-notice-color: #cccccc;
    --wp-indak-way-search-replace-form-bg: #333333;
}

/* Divi's parallax sections */
.et_pb_section_parallax .wp-indak-way-component {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(2px);
}

.et_pb_section_parallax.et_pb_section_dark .wp-indak-way-component {
    background: rgba(42, 42, 42, 0.95);
}

/* Divi's video background sections */
.et_pb_section_video .wp-indak-way-component {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(2px);
}

.et_pb_section_video.et_pb_section_dark .wp-indak-way-component {
    background: rgba(42, 42, 42, 0.95);
}

/* Ensure compatibility with Divi's animation classes */
.et_pb_section .wp-indak-way-component.et_animated,
.et_pb_row .wp-indak-way-component.et_animated,
.et_pb_column .wp-indak-way-component.et_animated {
    opacity: 1;
    transform: none;
}

/* Divi's overflow settings compatibility */
.et_pb_section_overflow_hidden .wp-indak-way-component,
.et_pb_row_overflow_hidden .wp-indak-way-component {
    overflow: visible;
}

/* Custom Divi module styles (for when we create custom Divi modules) */
.et_pb_wp_indak_way_disable_comments {
    padding: 0;
}

.et_pb_wp_indak_way_disable_comments .wp-indak-way-disable-comments-notice {
    margin: 0;
}

.et_pb_wp_indak_way_search_replace {
    padding: 0;
}

.et_pb_wp_indak_way_search_replace .wp-indak-way-search-replace-form {
    margin: 0;
}

/* Divi's admin bar compatibility */
body.admin-bar .wp-indak-way-component {
    /* Ensure proper spacing when admin bar is present */
}

/* Divi's customizer compatibility */
.customize-partial-edit-shortcut .wp-indak-way-component {
    position: relative;
}

/* RTL support for Divi */
[dir="rtl"] .et_pb_section .wp-indak-way-button,
[dir="rtl"] .et_pb_row .wp-indak-way-button {
    text-align: center;
}

[dir="rtl"] .et_pb_section .wp-indak-way-disable-comments-notice,
[dir="rtl"] .et_pb_row .wp-indak-way-disable-comments-notice {
    text-align: center;
}

/* Print compatibility with Divi */
@media print {
    .et_pb_section .wp-indak-way-component,
    .et_pb_row .wp-indak-way-component {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
}