/**
 * MUI-styled DatePicker CSS
 * Makes native date inputs look like Material UI DatePicker
 */

/* Wrapper styling */
.mui-datepicker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    cursor: text;
}

/* Native date input styled as MUI */
.mui-date-input {
    width: 100%;
    padding: 16.5px 14px;
    padding-right: 48px;
    border: none;
    background: transparent;
    font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
    font-size: 1rem;
    line-height: 1.4375em;
    color: rgba(0, 0, 0, 0.87);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Hide default calendar icon */
.mui-date-input::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Focus state - update border color */
.mui-datepicker-wrapper:focus-within .MuiPickersOutlinedInput-notchedOutline {
    border-color: #1976d2;
    border-width: 2px;
}

/* Hover state */
.mui-datepicker-wrapper:hover .MuiPickersOutlinedInput-notchedOutline {
    border-color: rgba(0, 0, 0, 0.87);
}

/* Calendar button positioning */
.mui-datepicker-wrapper .mui-calendar-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.mui-datepicker-wrapper .mui-calendar-btn button {
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.mui-datepicker-wrapper .mui-calendar-btn button:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* Fieldset border styling */
.mui-datepicker-wrapper .MuiPickersOutlinedInput-notchedOutline {
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 0 8px;
    border: 1px solid rgba(0, 0, 0, 0.23);
    border-radius: 4px;
    pointer-events: none;
    overflow: hidden;
    min-width: 0%;
}

/* Legend for floating label effect */
.mui-datepicker-wrapper .MuiPickersOutlinedInput-notchedOutline legend {
    float: unset;
    width: auto;
    overflow: hidden;
    display: block;
    padding: 0;
    height: 11px;
    font-size: 0.75em;
    visibility: hidden;
    max-width: 100%;
    transition: max-width 100ms cubic-bezier(0.0, 0, 0.2, 1) 50ms;
    white-space: nowrap;
}

.mui-datepicker-wrapper .MuiPickersOutlinedInput-notchedOutline legend span {
    padding-left: 5px;
    padding-right: 5px;
    display: inline-block;
    opacity: 0;
    visibility: visible;
}

/* MUI Select dropdown styling for account select */
.MuiSelect-root .MuiSelect-nativeInput {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    border: none;
    z-index: 1;
}

.MuiSelect-root .MuiSelect-select {
    padding: 16.5px 32px 16.5px 14px;
    min-height: 1.4375em;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
}

/* Light theme overrides */
.mui-date-input {
    background-color: #FFFFFF !important;
    color: #1F2937 !important;
    color-scheme: light !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mui-date-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Animation for calendar popup */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Custom MUI datepicker display value formatting (MM/DD/YYYY style) */
.mui-datepicker-display {
    display: flex;
    align-items: center;
    gap: 0;
    font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.87);
}

.mui-datepicker-display .date-part {
    display: inline;
}

.mui-datepicker-display .date-separator {
    color: rgba(0, 0, 0, 0.6);
}

