/**
 * Settings Modal Styles
 *
 * Styles for settings modal
 * Loaded on: Pages with settings modal
 */

/* Settings Modal Styles */
.ipb_settings_form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Settings Modal Specific Styles */
#ipb_settings_modal .ipb_settings_section {
    margin-bottom: 10px;
    padding: 8px 12px;
}

/* Settings Modal Specific Styles - Higher Specificity */
#ipb_settings_modal .ipb_modal_body {
    padding: 12px 20px !important;
}

#ipb_settings_modal .ipb_modal_header {
    padding: 10px 20px !important;
}

#ipb_settings_modal .ipb_modal_footer {
    padding: 10px 20px !important;
}

#ipb_settings_modal .ipb_settings_section:last-child {
    margin-bottom: 0;
}

#ipb_settings_modal .ipb_settings_section h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

#ipb_settings_modal .ipb_setting_group {
    margin-bottom: 6px;
}

#ipb_settings_modal .ipb_setting_group:last-child {
    margin-bottom: 0;
}

#ipb_settings_modal .ipb_setting_group label {
    font-size: 13px;
    color: #555;
    margin-right: 8px;
}

#ipb_settings_modal .ipb_setting_group select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: white;
}

#ipb_settings_modal .ipb_setting_group select:focus {
    outline: none;
    border-color: #4f46e5;
}

/* Inline settings (label and select on same line) */
#ipb_settings_modal .ipb_inline_setting {
    display: flex;
    align-items: center;
    gap: 8px;
}

#ipb_settings_modal .ipb_inline_setting label {
    margin-bottom: 0;
    white-space: nowrap;
}

#ipb_settings_modal .ipb_inline_setting select {
    flex: 0 0 auto;
}

/* Checkbox groups (inline checkboxes) */
#ipb_settings_modal .ipb_checkbox_group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 20px;
    align-items: center;
}

/* Column Visibility - Flexbox with max 2 rows */
#ipb_settings_modal .ipb_column_visibility_group {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
    align-items: center !important;
    row-gap: 10px !important;
    column-gap: 20px !important;
    margin: 0 !important;
}

#ipb_settings_modal .ipb_column_visibility_group .ipb_checkbox_label {
    flex: 0 1 calc((100% - 60px) / 4) !important;
    min-width: 140px !important;
    max-width: calc((100% - 60px) / 4) !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    width: auto !important;
}

/* Ensure max 2 rows on desktop/tablet */
@media (min-width: 769px) {
    #ipb_settings_modal .ipb_column_visibility_group .ipb_checkbox_label {
        flex: 0 1 calc((100% - 60px) / 4) !important;
        min-width: 140px !important;
        max-width: calc((100% - 60px) / 4) !important;
    }
}

/* Allow more flexible wrapping on small screens */
@media (max-width: 768px) {
    #ipb_settings_modal .ipb_column_visibility_group .ipb_checkbox_label {
        flex: 0 1 calc((100% - 20px) / 2) !important;
        min-width: 120px !important;
        max-width: calc((100% - 20px) / 2) !important;
    }
}

#ipb_settings_modal .ipb_checkbox_label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin: 0;
}

#ipb_settings_modal .ipb_checkbox_label input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: #4f46e5;
}

#ipb_settings_modal .ipb_checkbox_label span {
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}

/* Hide default modal library close button - we use custom one in header */
#ipb_settings_modal.modal a.close-modal {
    display: none !important;
}
