/* Begin styles for any form with a Custom Composite field in it */
.tabledrag-toggle-weight-wrapper {
    display: none;
}

.webform-multiple-table table[id^="edit-"] {
    border: none;
}

.webform-multiple-table table[id^="edit-"] thead,
.webform-multiple-table table[id^="edit-"] td.webform-multiple-table--handle {
    display: none;
}

.webform-multiple-table table[id^="edit-"] tbody tr {
    border: none;
    display: block;
    border-bottom: 2px solid #0b0c0c;
    padding-bottom: 30px;
    padding-top: 20px;
}

.webform-multiple-table table[id^="edit-"] tbody tr:first-child {
    border-top: 2px solid #0b0c0c;
}

.webform-multiple-table table[id^="edit-"] tbody tr:nth-child(even) {
    background-color: #fff;
}

.webform-multiple-table table[id^="edit-"] tbody tr td {
    display: block;
    border: none;
}

/* Fix for datelist fields - allow them to display horizontally */
.webform-multiple-table table[id^="edit-"] tbody tr td .js-webform-datelist {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.webform-multiple-table table[id^="edit-"] tbody tr td .js-webform-datelist .form-item {
    margin-bottom: 0;
    margin-right: 0;
}

.webform-multiple-table table[id^="edit-"] tbody tr td .js-webform-datelist input,
.webform-multiple-table table[id^="edit-"] tbody tr td .js-webform-datelist select {
    min-width: auto;
    width: auto;
}

/* Alternative selector if the above doesn't work */
.webform-multiple-table table[id^="edit-"] tbody tr td [data-drupal-selector*="date-of-assessment"],
.webform-multiple-table table[id^="edit-"] tbody tr td [data-drupal-selector*="birth-date"] {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.webform-multiple-table table[id^="edit-"] tbody tr td [data-drupal-selector*="date-of-assessment"] .form-item,
.webform-multiple-table table[id^="edit-"] tbody tr td [data-drupal-selector*="birth-date"] .form-item {
    margin-bottom: 0;
    margin-right: 0;
}

.webform-multiple-table td input[type="image"] {
    height: 46px;
    width: auto;
    min-width: initial;
    max-width: initial;
    margin: 0;
    margin-top: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
}

.webform-multiple-table td input[type="image"]:active {
    top: 2px
}

.webform-multiple-table td input[type="image"][id*="-operations-add"] {
    background-color: #f3f2f1;
}

.webform-multiple-table td input[type="image"][id*="-operations-add"]:hover {
    background-color: #dbdad9;
}

.webform-multiple-table td input[type="image"][id*="-operations-add"]:focus {
    border-color: #fd0;
    outline: 3px solid transparent;
}

.webform-multiple-table td input[type="image"][id*="-operations-add"]:focus:not(:active):not(:hover) {
    border-color: #fd0;
    color: #0b0c0c;
    background-color: #fd0;
}

.webform-multiple-table td input[type="image"][id*="-operations-remove"] {
    color: #fff;
    background-color: #d4351c;
}

.webform-multiple-table td input[type="image"][id*="-operations-remove"]:hover {
    background-color: #aa2a16;
}

.webform-multiple-table td input[type="image"][id*="-operations-remove"]:focus {
    border-color: #fd0;
    outline: 3px solid #fd0;
}

.webform-multiple-table td input[type="image"][id*="-operations-remove"]:focus:not(:active):not(:hover) {
    border-color: #fd0;
    background-color: #aa2a16;
}

.webform-multiple-table td input[type="image"] + input[type="image"] {
    margin-left: 1em;
}

.webform-multiple-table td.webform-multiple-table--operations input {
    opacity: 1;
}

.webform-multiple-add {
    padding-top: 10px;
}

.webform-preview .webform-element-type-webform-custom-composite .item-list .item-list__content .item-list__items ul li {
    padding-bottom: 15px;
    padding-top: 15px;
    border-bottom: 1px solid #bfc1c3;
}

.webform-preview .webform-element-type-webform-custom-composite .item-list .item-list__content .item-list__items ul li:first-child {
    padding-top: 0;
}

.webform-preview .webform-element-type-webform-custom-composite .item-list .item-list__content .item-list__items ul li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

@media (max-width: 768px) {
    .webform-multiple-table-responsive td.webform-multiple-table--operations {
        display: block;
        position: static;
    }
    
    .webform-multiple-table table[id^="edit-"] tbody tr td {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .webform-multiple-table td input[type="image"] + input[type="image"] {
        margin-left: 0em;
    }
    
    /* Keep datelist horizontal even on mobile if there's space */
    .webform-multiple-table table[id^="edit-"] tbody tr td .js-webform-datelist,
    .webform-multiple-table table[id^="edit-"] tbody tr td [data-drupal-selector*="date-of-assessment"],
    .webform-multiple-table table[id^="edit-"] tbody tr td [data-drupal-selector*="birth-date"] {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
}

/* End styles for any form with a Custom Composite field in it */