/* Untitled UI Date Picker Component Stylesheet */

.untitled-datepicker-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.untitled-datepicker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 0.85rem;
    background-color: #ffffff;
    border: 1px solid #dfe7ee;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    user-select: none;
    text-align: left;
}

.untitled-datepicker-trigger:hover {
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

.untitled-datepicker-trigger.is-open {
    border-color: #615bfa;
    box-shadow: 0 0 0 3px rgba(97, 91, 250, 0.15);
}

.untitled-datepicker-trigger .trigger-icon {
    display: inline-flex;
    align-items: center;
    color: #64748b;
    flex-shrink: 0;
}

.untitled-datepicker-trigger .trigger-text {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.untitled-datepicker-trigger .trigger-placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.untitled-datepicker-popover {
    position: absolute;
    z-index: 99999;
    top: calc(100% + 6px);
    left: 0;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    min-width: 320px;
    max-width: 95vw;
    animation: untitledDatepickerFadeIn 0.15s ease-out forwards;
}

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

.untitled-datepicker-main {
    display: flex;
    gap: 1.25rem;
}

/* Left Sidebar (Presets) */
.untitled-datepicker-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 140px;
    flex-shrink: 0;
    border-right: 1px solid #f1f5f9;
    padding-right: 1rem;
}

.untitled-datepicker-preset {
    display: block;
    width: 100%;
    padding: 0.45rem 0.65rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.12s ease-in-out;
}

.untitled-datepicker-preset:hover {
    color: #0f172a;
    background: #f8fafc;
}

.untitled-datepicker-preset.is-active {
    color: #0f172a;
    background: #f1f5f9;
    font-weight: 600;
}

/* Calendars Container */
.untitled-datepicker-calendars {
    display: flex;
    gap: 1.5rem;
    flex-grow: 1;
}

.untitled-datepicker-month-box {
    width: 252px;
}

.untitled-datepicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.875rem;
    height: 32px;
}

.untitled-datepicker-title-btn {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    background: transparent;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.12s ease-in-out;
}

.untitled-datepicker-title-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.untitled-datepicker-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.12s ease-in-out;
}

.untitled-datepicker-nav-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Days Grid */
.untitled-datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 0.35rem;
    text-align: center;
}

.untitled-datepicker-weekday {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: capitalize;
    padding: 0.25rem 0;
}

.untitled-datepicker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 2px;
}

.untitled-datepicker-day-cell {
    position: relative;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.untitled-datepicker-day-btn {
    position: relative;
    z-index: 2;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out;
}

.untitled-datepicker-day-btn:hover:not(.is-disabled):not(.is-start):not(.is-end) {
    background: #f1f5f9;
    color: #0f172a;
}

.untitled-datepicker-day-btn.is-other-month {
    color: #cbd5e1;
    pointer-events: none;
}

.untitled-datepicker-day-btn.is-today::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 9999px;
    background-color: #615bfa;
}

.untitled-datepicker-day-btn.is-start.is-today::after,
.untitled-datepicker-day-btn.is-end.is-today::after {
    background-color: #ffffff;
}

/* Start, End, Range Styles */
.untitled-datepicker-day-btn.is-start,
.untitled-datepicker-day-btn.is-end {
    background-color: #615bfa !important;
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(97, 91, 250, 0.35);
}

.untitled-datepicker-day-cell.in-range {
    background-color: #f4f3ff;
}

.untitled-datepicker-day-cell.in-range .untitled-datepicker-day-btn {
    color: #3538cd;
    font-weight: 600;
    border-radius: 0;
}

.untitled-datepicker-day-cell.range-start {
    background: linear-gradient(to right, transparent 50%, #f4f3ff 50%);
}

.untitled-datepicker-day-cell.range-end {
    background: linear-gradient(to left, transparent 50%, #f4f3ff 50%);
}

.untitled-datepicker-day-cell.range-single {
    background: transparent !important;
}

.untitled-datepicker-day-cell.in-preview {
    background-color: #f8f7ff;
}

.untitled-datepicker-day-cell.preview-start {
    background: linear-gradient(to right, transparent 50%, #f8f7ff 50%);
}

.untitled-datepicker-day-cell.preview-end {
    background: linear-gradient(to left, transparent 50%, #f8f7ff 50%);
}

/* Quick Month/Year Selection Matrix Overlay */
.untitled-datepicker-matrix-overlay {
    position: absolute;
    inset: 0;
    background: #ffffff;
    z-index: 10;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    border-radius: 1rem;
}

.untitled-datepicker-matrix-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}

.untitled-datepicker-matrix-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    flex-grow: 1;
    overflow-y: auto;
    max-height: 240px;
}

.untitled-datepicker-matrix-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.12s;
}

.untitled-datepicker-matrix-item:hover {
    background: #eef2ff;
    color: #4f46e5;
    border-color: #c7d2fe;
}

.untitled-datepicker-matrix-item.is-selected {
    background: #615bfa;
    color: #ffffff;
    border-color: #615bfa;
    font-weight: 600;
}

/* Bottom Action Bar */
.untitled-datepicker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.875rem;
    border-top: 1px solid #f1f5f9;
}

.untitled-datepicker-inputs-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.untitled-datepicker-input-box {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    min-width: 90px;
    text-align: center;
}

.untitled-datepicker-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.untitled-datepicker-cancel-btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    background: #ffffff;
    border: 1px solid #dfe7ee;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.12s ease-in-out;
}

.untitled-datepicker-cancel-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}

.untitled-datepicker-apply-btn {
    padding: 0.45rem 1.15rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #ffffff;
    background: #615bfa;
    border: 1px solid #615bfa;
    border-radius: 0.5rem;
    cursor: pointer;
    box-shadow: 0 1px 2px 0 rgba(97, 91, 250, 0.3);
    transition: all 0.12s ease-in-out;
}

.untitled-datepicker-apply-btn:hover {
    background: #524be3;
    border-color: #524be3;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .untitled-datepicker-popover {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 95vw;
        max-height: 90vh;
        overflow-y: auto;
    }

    .untitled-datepicker-main {
        flex-direction: column;
    }

    .untitled-datepicker-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid #f1f5f9;
        padding-right: 0;
        padding-bottom: 0.5rem;
    }

    .untitled-datepicker-preset {
        width: auto;
    }

    .untitled-datepicker-calendars {
        flex-direction: column;
        align-items: center;
    }
}
