/* Custom Flatpickr Theme - Glass Design with Sage/Ocean colors */

.flatpickr-calendar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(93, 128, 98, 0.2);
    border-radius: 1rem;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.15);
    font-family: 'Lexend', sans-serif;
    width: 320px;
}

.flatpickr-calendar.animate.open {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header (Month navigation) */
.flatpickr-months {
    background: linear-gradient(135deg, #5d8062 0%, #0c8aeb 100%);
    border-radius: 1rem 1rem 0 0;
    padding: 1rem;
}

.flatpickr-month {
    color: white;
    fill: white;
    height: auto;
}

.flatpickr-current-month {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    padding: 0;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    height: auto;
    line-height: normal;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: rgba(255, 255, 255, 0.3);
}

.flatpickr-current-month .numInputWrapper {
    width: 7ch;
}

.flatpickr-current-month input.cur-year {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
}

.flatpickr-current-month input.cur-year:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Custom year selector dropdown */
.flatpickr-year-select {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    font-family: 'Lexend', sans-serif;
    font-size: inherit;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 1.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.3rem center;
    background-repeat: no-repeat;
    background-size: 1.2em 1.2em;
    height: auto;
    line-height: normal;
    margin-left: 0.5rem;
}

.flatpickr-year-select:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.flatpickr-year-select:focus {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.flatpickr-year-select option {
    background: #5d8062;
    color: white;
    padding: 0.5rem;
}

/* Hide year increment/decrement arrows when using dropdown */
.flatpickr-current-month .arrowUp,
.flatpickr-current-month .arrowDown {
    display: none !important;
}

/* Navigation arrows */
.flatpickr-prev-month,
.flatpickr-next-month {
    color: white;
    fill: white;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.flatpickr-prev-month svg,
.flatpickr-next-month svg {
    width: 14px;
    height: 14px;
}

/* Weekdays */
.flatpickr-weekdays {
    background: transparent;
    padding: 1rem 0.5rem 0.5rem;
}

.flatpickr-weekday {
    color: #5d8062;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Days */
.flatpickr-days {
    padding: 0.5rem;
}

.flatpickr-day {
    color: #2f4233;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin: 2px;
    height: 36px;
    line-height: 36px;
}

.flatpickr-day:hover {
    background: rgba(93, 128, 98, 0.1);
    border-color: transparent;
    color: #5d8062;
    transform: scale(1.05);
}

/* Today */
.flatpickr-day.today {
    border: 2px solid #5d8062;
    background: rgba(93, 128, 98, 0.05);
    color: #5d8062;
    font-weight: 600;
}

.flatpickr-day.today:hover {
    background: rgba(93, 128, 98, 0.15);
    border-color: #5d8062;
}

/* Selected */
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: linear-gradient(135deg, #5d8062 0%, #0c8aeb 100%);
    border-color: transparent;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(93, 128, 98, 0.3);
    transform: scale(1.05);
}

/* Other month days */
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #a1baa3;
}

.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    background: rgba(93, 128, 98, 0.05);
    color: #5d8062;
}

/* Disabled days */
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #d1dbd2;
    background: transparent;
    cursor: not-allowed;
    transform: none;
}

/* Input with calendar icon */
.date-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.date-input-wrapper .calendar-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #5d8062;
    pointer-events: none;
    font-size: 20px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.date-input-wrapper input:focus ~ .calendar-icon {
    opacity: 1;
}

/* Make sure input has padding for icon */
.date-input-wrapper input {
    padding-right: 40px;
}

/* Time picker (if needed) */
.flatpickr-time {
    background: rgba(246, 248, 246, 0.5);
    border-top: 1px solid rgba(93, 128, 98, 0.1);
    padding: 1rem;
    border-radius: 0 0 1rem 1rem;
}

.flatpickr-time input {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(93, 128, 98, 0.2);
    border-radius: 0.5rem;
    color: #2f4233;
    font-weight: 500;
}

.flatpickr-time input:hover {
    background: rgba(255, 255, 255, 0.9);
}

.flatpickr-time .flatpickr-time-separator {
    color: #5d8062;
}

/* Animation for opening */
.flatpickr-calendar.arrowTop:before {
    border-bottom-color: rgba(93, 128, 98, 0.2);
}

.flatpickr-calendar.arrowTop:after {
    border-bottom-color: rgba(255, 255, 255, 0.95);
}
