/**
 * Custom styles for Bootstrap Datepicker
 */

/* Datepicker container */
.datepicker-dropdown {
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
    margin-top: 0.25rem;
    z-index: 9999 !important; /* Ensure it appears above everything */
    background-color: #fff;
    position: absolute !important; /* Force absolute positioning */
    display: block !important; /* Ensure it's visible */
}

/* Datepicker header */
.datepicker-days .table-condensed thead tr:first-child {
    background-color: var(--bs-primary, #0d6efd);
    color: white;
    border-radius: 0.375rem 0.375rem 0 0;
}

.datepicker-days .table-condensed thead tr:first-child th {
    border-radius: 0.375rem 0.375rem 0 0;
    padding: 0.75rem;
    text-align: center;
    font-weight: 500;
}

/* Month and year selectors */
.datepicker-switch {
    font-weight: 600;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Navigation buttons */
.datepicker .prev, .datepicker .next {
    font-size: 1.5em;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
}

.datepicker .prev:hover, .datepicker .next:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Day names header */
.datepicker .dow {
    font-weight: 600;
    color: var(--bs-gray-600);
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 0.5px;
}

/* Calendar days */
.datepicker table tr td.day {
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    line-height: 2.5rem;
    padding: 0;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Today's date */
.datepicker table tr td.today {
    background-color: var(--bs-light, #f8f9fa) !important;
    color: var(--bs-primary, #0d6efd) !important;
    font-weight: bold;
    position: relative;
}

.datepicker table tr td.today:before {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 6px 6px 0;
    border-color: transparent var(--bs-primary, #0d6efd) transparent transparent;
}

/* Selected date */
.datepicker table tr td.active,
.datepicker table tr td.active:hover,
.datepicker table tr td.active.disabled,
.datepicker table tr td.active.disabled:hover {
    background-color: var(--bs-primary, #0d6efd) !important;
    color: white !important;
    text-shadow: none;
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.4);
    font-weight: bold;
}

/* Hover state */
.datepicker table tr td.day:hover {
    background-color: var(--bs-primary-bg-subtle, #cfe2ff);
    cursor: pointer;
}

/* Months and years view */
.datepicker .datepicker-months .month,
.datepicker .datepicker-years .year,
.datepicker .datepicker-decades .decade,
.datepicker .datepicker-centuries .century {
    border-radius: 0.375rem;
    padding: 0.5rem;
    margin: 0.25rem;
    transition: all 0.2s;
}

/* Input group styling */
.input-group.date {
    position: relative;
}

.input-group.date .input-group-text {
    background-color: var(--bs-light, #f8f9fa);
    border-color: #ced4da;
    cursor: pointer;
    transition: all 0.2s;
}

.input-group.date .input-group-text:hover {
    background-color: var(--bs-primary-bg-subtle, #cfe2ff);
    color: var(--bs-primary, #0d6efd);
}

/* Clear button */
.datepicker .datepicker-clear-btn {
    background-color: var(--bs-light);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* Today button */
.datepicker .datepicker-today-btn {
    background-color: var(--bs-primary-bg-subtle, #cfe2ff);
    color: var(--bs-primary, #0d6efd);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Focus state for the input */
.input-group.date .form-control:focus {
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Valid state */
.input-group.date .form-control.is-valid {
    background-image: none;
    padding-right: 0.75rem;
}

/* Error state */
.input-group.date .form-control.is-invalid {
    background-image: none;
    padding-right: 0.75rem;
}
