/**
 * Event Repeater Field Toggle Styles
 */

/* Hide fields when toggle is disabled */
.codicts-cmlerf-event-name-field.codicts-cmlerf-hidden,
.codicts-cmlerf-event-date-field.codicts-cmlerf-hidden,
.codicts-cmlerf-event-location-field.codicts-cmlerf-hidden,
.codicts-cmlerf-event-url-field.codicts-cmlerf-hidden,
.codicts-cmlerf-event-description-field.codicts-cmlerf-hidden,
.codicts-cmlerf-item-head.codicts-cmlerf-hidden {
    display: none !important;
}

/* Ensure proper spacing between fields */
.codicts-cmlerf-item-head {
    margin-bottom: 15px;
}

/* Ensure toggle works with all fields - using data attributes */
.codicts-events-repeater[data-show-name="false"] .codicts-cmlerf-event-name-field,
.codicts-events-repeater[data-show-name="false"] .codicts-cmlerf-item-head:has(input[name="menu-label"]),
.codicts-events-repeater[data-show-date="false"] .codicts-cmlerf-event-date-field,
.codicts-events-repeater[data-show-date="false"] .codicts-cmlerf-item-head:has(.event-picker),
.codicts-events-repeater[data-show-location="false"] .codicts-cmlerf-event-location-field,
.codicts-events-repeater[data-show-location="false"] .codicts-cmlerf-item-head:has(.rec-er-countries),
.codicts-events-repeater[data-show-url="false"] .codicts-cmlerf-event-url-field,
.codicts-events-repeater[data-show-url="false"] .codicts-cmlerf-item-head:has(input[name="menu-url"]),
.codicts-events-repeater[data-show-description="false"] .codicts-cmlerf-event-description-field,
.codicts-events-repeater[data-show-description="false"] .codicts-cmlerf-item-head:has(textarea[name="menu-description"]) {
    display: none !important;
}

/* Fix for jQuery Repeater plugin */
.codicts-cmlerf-repeater-field-wrapper {
    position: relative;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
}

/* Make sure the toggle works with dynamically added items */
.codicts-cmlerf-repeater-field-wrapper .codicts-cmlerf-item-head {
    transition: all 0.3s ease;
}



/* Additional selectors for better targeting */
.codicts-cmlerf-item-head:has(input[name="menu-label"]) {
    /* Name field styling */
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 10px;
}

.codicts-cmlerf-item-head:has(.event-picker) {
    /* Date field styling */
    padding-top: 10px;
}

.codicts-cmlerf-item-head:has(.rec-er-countries) {
    /* Location field styling */
    padding-top: 10px;
}

.codicts-cmlerf-item-head:has(input[name="menu-url"]) {
    /* URL field styling */
    padding-top: 10px;
}

.codicts-cmlerf-item-head:has(textarea[name="menu-description"]) {
    /* Description field styling */
    padding-top: 10px;
}
