/* ══════════════════════════════════════════════════════════════════
   MATMETRIQ CUSTOM UI COMPONENTS — THEMED DROPDOWNS & DATEPICKERS
   ══════════════════════════════════════════════════════════════════ */

/* ── Custom Select Component ── */
.mat-ui-select-wrap {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    user-select: none;
}

.mat-ui-select-wrap.open {
    z-index: 1000;
}

.mat-ui-select-btn {
    width: 100%;
    padding: 10px 14px;
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    outline: none;
    font-size: 0.92rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.mat-ui-select-btn:hover {
    border-color: rgba(255, 133, 51, 0.4);
    background: #1c2430;
}

.mat-ui-select-wrap.open .mat-ui-select-btn {
    border-color: #ff8533;
    box-shadow: 0 0 0 3px rgba(255, 133, 51, 0.2);
    background: #1c2430;
}

.mat-ui-select-btn .arrow-icon {
    color: #ff8533;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.mat-ui-select-wrap.open .mat-ui-select-btn .arrow-icon {
    transform: rotate(180deg);
}

.mat-ui-select-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #161b22;
    border: 1px solid rgba(255, 133, 51, 0.35);
    border-radius: 8px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.85), 0 0 20px rgba(255, 133, 51, 0.1);
    z-index: 99999;
    max-height: 220px;
    overflow-y: auto;
    box-sizing: border-box;
}

.mat-ui-select-wrap.open .mat-ui-select-menu {
    display: block;
    animation: matSelectFadeIn 0.15s ease-out;
}

@keyframes matSelectFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.mat-ui-select-search {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    background: #161b22;
    z-index: 2;
}

.mat-ui-select-search input {
    width: 100%;
    padding: 6px 10px;
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
}

.mat-ui-select-search input:focus {
    border-color: #ff8533;
}

.mat-ui-select-option {
    padding: 10px 14px;
    color: #c9d1d9;
    font-size: 0.88rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
}

.mat-ui-select-option:hover {
    background: rgba(255, 133, 51, 0.18);
    color: #ff8533;
}

.mat-ui-select-option.selected {
    background: rgba(255, 133, 51, 0.12);
    color: #ff8533;
    font-weight: 700;
}

.mat-ui-select-option .check-icon {
    color: #ff8533;
    font-size: 0.8rem;
    display: none;
}

.mat-ui-select-option.selected .check-icon {
    display: inline-block;
}

/* ── Custom Datepicker Component ── */
.mat-ui-datepicker-wrap {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    user-select: none;
}

.mat-ui-datepicker-input {
    width: 100%;
    padding: 10px 38px 10px 14px;
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.92rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.mat-ui-datepicker-input:hover {
    border-color: rgba(255, 133, 51, 0.4);
    background: #1c2430;
}

.mat-ui-datepicker-wrap.open .mat-ui-datepicker-input {
    border-color: #ff8533;
    box-shadow: 0 0 0 3px rgba(255, 133, 51, 0.2);
    background: #1c2430;
}

.mat-ui-datepicker-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #ff8533;
    font-size: 0.95rem;
    pointer-events: none;
}

.mat-ui-calendar-popup {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 310px;
    background: #0d1117;
    border: 1px solid rgba(255, 133, 51, 0.35);
    border-radius: 14px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85), 0 0 25px rgba(255, 133, 51, 0.15);
    padding: 14px;
    z-index: 99999;
    font-family: 'Outfit', sans-serif;
    box-sizing: border-box;
}

.mat-ui-datepicker-wrap.open .mat-ui-calendar-popup {
    display: block;
    animation: matSelectFadeIn 0.15s ease-out;
}

.mat-ui-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.mat-ui-cal-nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ff8533;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.mat-ui-cal-nav-btn:hover {
    background: rgba(255, 133, 51, 0.2);
}

.mat-ui-cal-dropdown-btn {
    background: #161b22;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    outline: none;
    transition: all 0.2s;
}

.mat-ui-cal-dropdown-btn:hover {
    border-color: rgba(255, 133, 51, 0.4);
}

.mat-ui-cal-dropdown-list {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 110px;
    max-height: 190px;
    overflow-y: auto;
    background: #161b22;
    border: 1px solid rgba(255, 133, 51, 0.35);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.85);
    z-index: 100000;
}

.mat-ui-cal-item {
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.15s;
    color: #c9d1d9;
}

.mat-ui-cal-item:hover {
    background: rgba(255, 133, 51, 0.18);
    color: #ff8533;
}

.mat-ui-cal-item.active {
    background: rgba(255, 133, 51, 0.12);
    color: #ff8533;
    font-weight: 700;
}

.mat-ui-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    margin-bottom: 6px;
}

.mat-ui-cal-weekday {
    color: #8b949e;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.mat-ui-cal-day {
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    color: #c9d1d9;
    border: 1px solid transparent;
}

.mat-ui-cal-day:hover {
    background: rgba(255, 133, 51, 0.2);
    color: #ff8533;
    border-color: rgba(255, 133, 51, 0.4);
}

.mat-ui-cal-day.selected {
    background: linear-gradient(135deg, #ff8533 0%, #ea580c 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 3px 10px rgba(255, 133, 51, 0.4) !important;
    border: none !important;
}

.mat-ui-cal-day.today {
    border-color: #ff8533;
    color: #ff8533;
}

.mat-ui-cal-day.disabled {
    color: #30363d !important;
    cursor: not-allowed !important;
    opacity: 0.4 !important;
    background: transparent !important;
}

/* ── Custom Scrollbars ── */
.mat-ui-select-menu::-webkit-scrollbar,
.mat-ui-cal-dropdown-list::-webkit-scrollbar {
    width: 5px;
}
.mat-ui-select-menu::-webkit-scrollbar-track,
.mat-ui-cal-dropdown-list::-webkit-scrollbar-track {
    background: #0d1117;
    border-radius: 4px;
}
.mat-ui-select-menu::-webkit-scrollbar-thumb,
.mat-ui-cal-dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(255, 133, 51, 0.4);
    border-radius: 4px;
}
.mat-ui-select-menu::-webkit-scrollbar-thumb:hover,
.mat-ui-cal-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: #ff8533;
}
