/**
 * Easy Appointments - New Vacation UI styles.
 * Loaded after the shared manage.css (.ea-mnui-*) design system used by
 * Locations/Services/Workers/Connections. Only adds the handful of
 * widgets unique to this screen: tag pills for the table's Employees/
 * Dates columns, the date-add row + removable date chips, the full-day
 * toggle, row action icon buttons, and field-error visibility - defined
 * defensively here in case manage.css doesn't already cover them, so
 * this page renders correctly on its own either way.
 */

/* ---------- Field error visibility ---------- */

.ea-mnui-field-error {
    display: none;
    margin-top: 4px;
    font-size: 12px;
    color: #d63638;
}

.ea-mnui-field.has-error .ea-mnui-field-error {
    display: block;
}

#ea-admin-app .ea-mnui-field.has-error input,
#ea-admin-app .ea-mnui-field.has-error select,
#ea-admin-app .ea-mnui-field.has-error textarea {
    border-color: #d63638;
}

/* ---------- Table tag pills (Employees / Dates columns) ---------- */

.ea-mnui-tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ea-mnui-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: #eef4ff;
    color: #1d4ed8;
    border: 1px solid #d6e4ff;
    white-space: nowrap;
}

.ea-mnui-tag-muted {
    background: #f6f7fb;
    color: #6b7280;
    border-color: #e5e7eb;
}

/* ---------- Row action icon buttons ---------- */

.ea-mnui-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    margin-right: 4px;
    color: #6b7280;
    padding: 0;
    line-height: 1;
    vertical-align: middle;
    box-sizing: border-box;
}

.ea-mnui-icon-btn svg {
    display: block;
    width: 14px;
    height: 14px;
    margin: auto;
    flex-shrink: 0;
}

.ea-mnui-icon-btn:hover {
    background: #f6f7fb;
    color: #111827;
}

.ea-mnui-icon-btn .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
    line-height: 1;
}

.ea-mnui-icon-btn.ea-mnui-danger:hover {
    background: #fef3f2;
    border-color: #fecdca;
    color: #d63638;
}

/* ---------- Employee chips inside the drawer ---------- */

.ea-mnui-chip-group-scroll {
    max-height: 160px;
    overflow-y: auto;
    padding: 2px;
}

.ea-mnui-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    margin: 3px 6px 3px 0;
}

.ea-mnui-chip input[type="checkbox"] {
    margin: 0;
}

.ea-mnui-chip.is-checked {
    background: #eef4ff;
    border-color: #2563eb;
    color: #1d4ed8;
}

/* ---------- Date add row + date chips ---------- */

.ea-mnui-date-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.ea-mnui-date-add-row .ea-mnui-date-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    background: #fff;
}

.ea-mnui-vacation-dates {
    min-height: 0;
}

.ea-mnui-date-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 12px;
    border-radius: 999px;
    border: 1px solid #d6e4ff;
    background: #eef4ff;
    color: #1d4ed8;
    font-size: 12px;
    margin: 3px 6px 3px 0;
}

.ea-mnui-date-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #1d4ed8;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.ea-mnui-date-chip-remove:hover {
    background: rgba(29, 78, 216, 0.12);
}

/* ---------- Full day toggle ---------- */

.ea-mnui-fullday-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    margin: 6px 0 12px;
}

/* ---------- Select2 styling for Vacation UI ---------- */

.ea-mnui-drawer .select2-container,
.ea-mnui-wrap .select2-container {
    width: 100% !important;
}

.ea-mnui-drawer .select2-container--default .select2-selection--multiple,
.ea-mnui-wrap .select2-container--default .select2-selection--multiple {
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    min-height: 38px !important;
    padding: 3px 8px !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.ea-mnui-drawer .select2-container--default.select2-container--focus .select2-selection--multiple,
.ea-mnui-drawer .select2-container--default.select2-container--open .select2-selection--multiple,
.ea-mnui-wrap .select2-container--default.select2-container--focus .select2-selection--multiple,
.ea-mnui-wrap .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
    outline: none !important;
}

.ea-mnui-field.has-error .select2-container--default .select2-selection--multiple {
    border-color: #d63638 !important;
}

.ea-mnui-drawer .select2-container--default .select2-selection--multiple .select2-selection__rendered,
.ea-mnui-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

.ea-mnui-drawer .select2-container--default .select2-selection--multiple .select2-selection__choice,
.ea-mnui-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #eef4ff !important;
    border: 1px solid #d6e4ff !important;
    border-radius: 6px !important;
    color: #1d4ed8 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    padding: 3px 8px !important;
    margin: 2px 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    line-height: 1.4 !important;
    position: relative !important;
}

.ea-mnui-drawer .select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
.ea-mnui-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    height: auto !important;
    color: #1d4ed8 !important;
    border: none !important;
    background: transparent !important;
    margin: 0 2px 0 0 !important;
    padding: 0 !important;
    font-weight: bold !important;
    cursor: pointer !important;
    font-size: 14px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.ea-mnui-drawer .select2-container--default .select2-selection--multiple .select2-selection__choice__remove span,
.ea-mnui-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice__remove span {
    display: inline-block !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ea-mnui-drawer .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
.ea-mnui-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #b91c1c !important;
    background: transparent !important;
}

.ea-mnui-drawer .select2-container--default .select2-selection--multiple .select2-selection__choice__display,
.ea-mnui-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice__display {
    display: inline-block !important;
    padding: 0 !important;
    margin: 0 !important;
    color: #1d4ed8 !important;
}

.ea-mnui-drawer .select2-container--default .select2-search--inline,
.ea-mnui-wrap .select2-container--default .select2-search--inline {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 1 auto !important;
}

.ea-mnui-drawer .select2-container--default .select2-search--inline .select2-search__field,
.ea-mnui-wrap .select2-container--default .select2-search--inline .select2-search__field {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    height: 28px !important;
    line-height: 28px !important;
    padding: 0 4px !important;
    margin: 0 !important;
    font-size: 13px !important;
    font-family: inherit !important;
    color: #111827 !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.select2-dropdown {
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden !important;
    z-index: 100060 !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #2563eb !important;
    color: #ffffff !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
}
