/* =========================================================
   Custom UI Kit — Select + Datepicker
   Drop this file + custom-ui.js into any WoWonder page/form.
   Uses CSS variables so you can re-skin per-theme in one place.
========================================================= */

:root {
    --cui-primary: #366cf3;
    --cui-primary-dark: #2857c9;
    --cui-primary-soft: #eaf0ff;
    --cui-text: #1c2733;
    --cui-text-muted: #7c8a9a;
    --cui-border: #dde3ea;
    --cui-bg: #ffffff;
    --cui-bg-hover: #f4f7fc;
    --cui-radius: 10px;
    --cui-shadow: 0 10px 30px rgba(23, 43, 77, .12);
    --cui-font: inherit;
}

.cui-field {
    position: relative;
    width: 100%;
    font-family: var(--cui-font);
}

/* ---------- shared trigger button (select + date input look) ---------- */
.cui-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    background: var(--cui-bg);
    border: 1.5px solid var(--cui-border);
    border-radius: var(--cui-radius);
    color: var(--cui-text);
    font-size: 14px;
    line-height: 1.3;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.cui-trigger:hover {
    border-color: #c3cedd;
}

.cui-field.cui-open .cui-trigger,
.cui-trigger:focus-visible {
    outline: none;
    border-color: var(--cui-primary);
    box-shadow: 0 0 0 3px var(--cui-primary-soft);
}

.cui-field.cui-disabled .cui-trigger {
    background: #f2f4f7;
    color: var(--cui-text-muted);
    cursor: not-allowed;
}

.cui-trigger-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cui-trigger-label.cui-placeholder {
    color: var(--cui-text-muted);
}

.cui-chevron,
.cui-cal-icon {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: var(--cui-text-muted);
    transition: transform .15s ease;
}

.cui-field.cui-open .cui-chevron {
    transform: rotate(180deg);
}

/* ---------- floating panel shared by both components ---------- */
.cui-panel {
    position: fixed;
    z-index: 1000;
    margin-top: 3px;
    /* top: calc(100% + 6px); */
    /* left: 0; */
    /* min-width: 100%; */
    background: var(--cui-bg);
    border: 1px solid var(--cui-border);
    border-radius: var(--cui-radius);
    box-shadow: var(--cui-shadow);
    padding: 6px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity .12s ease, transform .12s ease;
}

.cui-field.cui-open .cui-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cui-field.cui-drop-up .cui-panel {
    top: auto;
    bottom: calc(100% + 6px);
}

/* ---------- select: search box ---------- */
.cui-search-wrap {
    padding: 4px 4px 6px;
}

.cui-search {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1.5px solid var(--cui-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--cui-text);
}

.cui-search:focus {
    outline: none;
    border-color: var(--cui-primary);
}

/* ---------- select: options list ---------- */
.cui-options {
    max-height: 220px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cui-options::-webkit-scrollbar {
    width: 6px;
}

.cui-options::-webkit-scrollbar-thumb {
    background: var(--cui-border);
    border-radius: 6px;
}

.cui-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 7px;
    font-size: 14px;
    color: var(--cui-text);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cui-option:hover,
.cui-option.cui-active {
    background: var(--cui-bg-hover);
}

.cui-option.cui-selected {
    background: var(--cui-primary-soft);
    color: var(--cui-primary-dark);
    font-weight: 600;
}

.cui-option.cui-disabled {
    color: var(--cui-text-muted);
    cursor: not-allowed;
    opacity: .6;
}

.cui-option-empty {
    padding: 14px 10px;
    text-align: center;
    color: var(--cui-text-muted);
    font-size: 13px;
}

/* ---------- datepicker ---------- */
.cui-cal {
    width: 280px;
    padding: 10px;
}

.cui-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 2px 2px 10px;
}

.cui-cal-nav {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--cui-text);
    cursor: pointer;
    transition: background .15s ease;
}

.cui-cal-nav:hover {
    background: var(--cui-bg-hover);
}

.cui-cal-nav svg {
    width: 16px;
    height: 16px;
}

.cui-cal-title {
    display: flex;
    gap: 4px;
}

.cui-cal-select {
    border: 1.5px solid transparent;
    background: transparent;
    font-weight: 700;
    font-size: 14px;
    color: var(--cui-text);
    border-radius: 6px;
    padding: 4px 6px;
    cursor: pointer;
}

.cui-cal-select:hover {
    background: var(--cui-bg-hover);
}

.cui-cal-select:focus-visible {
    outline: none;
    border-color: var(--cui-primary);
}

.cui-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cui-cal-dow {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--cui-text-muted);
    padding: 4px 0 8px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.cui-cal-day {
    position: relative;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    color: var(--cui-text);
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}

.cui-cal-day:hover {
    background: var(--cui-bg-hover);
}

.cui-cal-day.cui-muted {
    color: var(--cui-text-muted);
    opacity: .55;
}

.cui-cal-day.cui-today::after {
    content: "";
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--cui-primary);
}

.cui-cal-day.cui-selected {
    background: var(--cui-primary);
    color: #fff;
    font-weight: 700;
}

.cui-cal-day.cui-selected::after {
    background: #fff;
}

.cui-cal-day.cui-disabled {
    color: var(--cui-text-muted);
    opacity: .35;
    cursor: not-allowed;
    background: none;
}

.cui-cal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--cui-border);
}

.cui-cal-today-btn {
    border: none;
    background: transparent;
    color: var(--cui-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}

.cui-cal-today-btn:hover {
    background: var(--cui-primary-soft);
}

.cui-cal-clear-btn {
    border: none;
    background: transparent;
    color: var(--cui-text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}

.cui-cal-clear-btn:hover {
    background: var(--cui-bg-hover);
}

@media (max-width:480px) {
    .cui-cal {
        width: 250px;
    }
}

/* ---------- typable input fields (date + time) ---------- */
.cui-input-wrap {
    position: relative;
}


.cui-suffix-icon {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 7px;
    color: var(--cui-text-muted);
    cursor: pointer;
}

.cui-suffix-icon:hover {
    background: var(--cui-bg-hover);
    color: var(--cui-text);
}

.cui-suffix-icon svg {
    width: 16px;
    height: 16px;
}

/* ---------- timepicker ---------- */
.cui-time-panel {
    width: 220px;
    padding: 6px 6px 4px;
}

.cui-time {
    display: flex;
    gap: 4px;
    padding: 2px;
}

.cui-time-col {
    flex: 1;
    max-height: 200px;
    overflow-y: auto;
    scroll-behavior: smooth;
    border-radius: 8px;
}

.cui-time-col::-webkit-scrollbar {
    width: 5px;
}

.cui-time-col::-webkit-scrollbar-thumb {
    background: var(--cui-border);
    border-radius: 6px;
}

.cui-time-item {
    text-align: center;
    padding: 8px 0;
    border-radius: 7px;
    font-size: 14px;
    color: var(--cui-text);
    cursor: pointer;
}

.cui-time-item:hover {
    background: var(--cui-bg-hover);
}

.cui-time-item.cui-selected {
    background: var(--cui-primary);
    color: #fff;
    font-weight: 700;
}


/* Tab UI */

.cui-tabs {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #fff;
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid #f3f5f5;
    overflow-x: auto;
    gap: 10px;
}

.cui-modern-tab {
    position: relative;
    padding: 20px 15px;
    text-decoration: none;
    color: #727272;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.cui-modern-tab.active {
    color: #015ba8;
    font-weight: 600;
}

.cui-modern-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #015ba8;
    border-radius: 10px;
}

/*toolbar ui*/

.title-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* search ui */

.cui-search {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 30px;
    padding: 0 15px;
    width: 320px;
}

.cui-search i.fa-search {
    color: #888;
}

.cui-search input {
    border: none;
    outline: none;
    flex: 1;
    padding: 12px;
    background: transparent;
}

.cui-search .filter-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #555;
    font-size: 18px;
}