/* ============================================================
   picker.css — FSelect / FDateRangePicker / FDateTimePicker
   ============================================================ */

/* ============================================================
   一、FSelect 自定义下拉选择
   用法：new FPicker.FSelect(nativeSelect, options)
   ============================================================ */
.f-select-wrap {
    position: relative;
    display: inline-block;
}
.f-select-trigger {
    display: flex;
    align-items: center;
    height: var(--f-height, 36px);
    padding: 0 10px 0 12px;
    border: 1px solid #D9D9D9;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary, #1F2329);
    transition: border-color .2s, box-shadow .2s;
    user-select: none;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
}
.f-select-trigger:hover { border-color: #C0C4CC; }
.f-select-trigger.is-open {
    border-color: var(--primary, #4B6EF5);
    box-shadow: 0 0 0 3px rgba(75,110,245,.12);
}
.f-select-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}
.f-select-text.is-placeholder { color: #C0C4CC; }
.f-select-arrow {
    color: #C0C4CC;
    font-size: 11px;
    flex-shrink: 0;
    transition: transform .22s;
}
.f-select-trigger.is-open .f-select-arrow { transform: rotate(-180deg); }

/* 面板 */
.f-select-panel {
    position: fixed;
    background: #fff;
    border: 1px solid #E8EAED;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
    padding: 4px 0;
    z-index: 2000;
    display: none;
    min-width: 120px;
    max-height: 280px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .15s ease, transform .15s ease;
}
.f-select-panel::-webkit-scrollbar { width: 4px; }
.f-select-panel::-webkit-scrollbar-thumb { background: #D0D4DC; border-radius: 2px; }
.f-select-panel.is-show { opacity: 1; transform: translateY(0); }

.f-select-option {
    padding: 9px 36px 9px 14px;
    font-size: 14px;
    color: var(--text-secondary, #606266);
    cursor: pointer;
    transition: background .12s;
    position: relative;
    white-space: nowrap;
}
.f-select-option:hover {
    background: var(--primary-light, #EEF2FF);
    color: var(--primary, #4B6EF5);
}
.f-select-option.is-selected {
    background: var(--primary-light, #EEF2FF);
    color: var(--primary, #4B6EF5);
    font-weight: 500;
}
.f-select-option.is-selected::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 5px;
    height: 9px;
    border-right: 2px solid var(--primary, #4B6EF5);
    border-bottom: 2px solid var(--primary, #4B6EF5);
}


/* ============================================================
   二、日历公共部分（DateRange / DateTime 共用）
   ============================================================ */
.cal-week-head {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 2px;
}
.cal-week-day {
    text-align: center;
    font-size: 12px;
    color: #909399;
    padding: 5px 0;
    font-weight: 500;
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.cal-day {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    height: 34px;
}
.cal-day-inner {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-primary, #1F2329);
    border-radius: 50%;
    transition: all .12s;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}
.cal-day:hover .cal-day-inner {
    background: var(--primary-light, #EEF2FF);
    color: var(--primary, #4B6EF5);
}
.cal-day.is-other .cal-day-inner { color: #C0C4CC; }
.cal-day.is-today .cal-day-inner {
    color: var(--primary, #4B6EF5);
    font-weight: 700;
}
/* 今天小圆点 */
.cal-day.is-today:not(.is-selected) .cal-day-inner::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--primary, #4B6EF5);
}
/* 选中 */
.cal-day.is-selected .cal-day-inner,
.cal-day.is-range-start .cal-day-inner,
.cal-day.is-range-end .cal-day-inner {
    background: var(--primary, #4B6EF5) !important;
    color: #fff !important;
    font-weight: 600;
}
/* 区间底色：水平拉通 */
.cal-day.is-in-range::before,
.cal-day.is-range-start:not(.is-range-end)::after,
.cal-day.is-range-end:not(.is-range-start)::after {
    content: '';
    position: absolute;
    top: 2px; bottom: 2px;
    background: var(--primary-light, #EEF2FF);
    z-index: 0;
}
.cal-day.is-in-range::before { left: 0; right: 0; }
.cal-day.is-range-start:not(.is-range-end)::after { left: 50%; right: 0; }
.cal-day.is-range-end:not(.is-range-start)::after  { left: 0; right: 50%; }


/* ============================================================
   三、FDateRangePicker 面板
   ============================================================ */
.f-date-range-panel {
    position: fixed;
    background: #fff;
    border: 1px solid #E8EAED;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,.10);
    z-index: 2000;
    display: none;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .15s ease, transform .15s ease;
    padding: 14px 16px;
    user-select: none;
}
.f-date-range-panel.is-show { opacity: 1; transform: translateY(0); }

/* 两列日历容器 */
.drp-calendars {
    display: flex;
    gap: 0;
}
.drp-calendar {
    width: 220px;
    flex-shrink: 0;
}
.drp-calendar + .drp-calendar {
    border-left: 1px solid var(--border-light, #F0F2F5);
    padding-left: 16px;
    margin-left: 16px;
}

/* 每列头部导航 */
.drp-cal-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    height: 30px;
}
.drp-nav-btn {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: none;
    font-size: 14px; font-weight: 600;
    color: #909399;
    cursor: pointer;
    border-radius: 4px;
    transition: all .15s;
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
}
.drp-nav-btn:hover { background: var(--primary-light, #EEF2FF); color: var(--primary, #4B6EF5); }
.drp-nav-btn.is-hidden { visibility: hidden; pointer-events: none; }
.drp-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #1F2329);
    text-align: center;
    white-space: nowrap;
}


/* ============================================================
   四、日期范围触发器（.f-drp-trigger）
   ============================================================ */
.f-drp-trigger {
    display: inline-flex;
    align-items: center;
    height: var(--f-height, 36px);
    border: 1px solid #D9D9D9;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    padding: 0 10px;
    gap: 0;
    user-select: none;
    font-size: 13px;
    box-sizing: border-box;
}
.f-drp-trigger:hover { border-color: #C0C4CC; }
.f-drp-trigger.is-focused {
    border-color: var(--primary, #4B6EF5);
    box-shadow: 0 0 0 3px rgba(75,110,245,.12);
}
.f-drp-icon { color: #C0C4CC; font-size: 14px; flex-shrink: 0; margin-right: 7px; }
.f-drp-text {
    min-width: 72px;
    text-align: center;
    color: var(--text-primary, #1F2329);
}
.f-drp-text.is-empty { color: #C0C4CC; }
.f-drp-sep {
    color: #C0C4CC;
    flex-shrink: 0;
    padding: 0 8px;
    font-size: 13px;
}
.f-drp-clear {
    color: #C0C4CC;
    font-size: 13px;
    cursor: pointer;
    margin-left: 6px;
    flex-shrink: 0;
    transition: color .15s;
    display: none;
}
.f-drp-clear:hover { color: var(--danger, #FF4D4F); }
.f-drp-trigger.has-value .f-drp-clear { display: inline-flex; align-items: center; }


/* ============================================================
   五、FDateTimePicker 面板
   ============================================================ */
.f-datetime-panel {
    position: fixed;
    background: #fff;
    border: 1px solid #E8EAED;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,.10);
    z-index: 2000;
    display: none;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .15s ease, transform .15s ease;
    padding: 12px 14px;
    width: 256px;
    user-select: none;
}
.f-datetime-panel.is-show { opacity: 1; transform: translateY(0); }

/* 顶部日期+时间输入 */
.dtp-topbar {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light, #F0F2F5);
}
.dtp-topbar .form-input {
    height: 30px !important;
    font-size: 12px !important;
    padding: 0 8px !important;
    border-radius: 4px;
    border: 1px solid #D9D9D9;
    background: #fff;
    outline: none;
    cursor: text;
}
.dtp-topbar .form-input:focus {
    border-color: var(--primary, #4B6EF5);
    box-shadow: 0 0 0 2px rgba(75,110,245,.1);
}
.dtp-date-in { flex: 1.5; min-width: 0; }
.dtp-time-in { flex: 1; min-width: 0; }

/* 日历导航 */
.dtp-cal-nav {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    height: 28px;
}
.dtp-cal-nav .drp-title { font-size: 13px; }

/* 底部按钮 */
.dtp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-light, #F0F2F5);
    margin-top: 6px;
}
.dtp-footer .btn-now {
    font-size: 13px;
    color: var(--primary, #4B6EF5);
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background .15s;
    font-family: var(--font, sans-serif);
}
.dtp-footer .btn-now:hover { background: var(--primary-light, #EEF2FF); }
.dtp-footer .btn-confirm {
    background: var(--primary, #4B6EF5);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background .2s;
    font-family: var(--font, sans-serif);
}
.dtp-footer .btn-confirm:hover { background: var(--primary-hover, #3B5EE5); }

/* 日期时间输入框触发器包装 */
.f-dti-wrap {
    position: relative;
    display: inline-block;
}
.f-dti-wrap .f-dti-icon {
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    color: #C0C4CC; font-size: 14px;
    pointer-events: none;
    z-index: 1;
}
.f-dti-wrap .form-input {
    padding-left: 32px !important;
    padding-right: 28px !important;
    cursor: pointer;
}
.f-dti-wrap .f-dti-clear {
    position: absolute;
    right: 9px; top: 50%;
    transform: translateY(-50%);
    color: #C0C4CC; font-size: 13px;
    cursor: pointer;
    display: none;
    transition: color .15s;
    z-index: 1;
}
.f-dti-wrap:hover .f-dti-clear { display: block; }
.f-dti-wrap .f-dti-clear:hover { color: var(--danger, #FF4D4F); }
