/**
 * Tactical Legacy Flatpickr Custom Styles
 * Matches the Tactical Legacy color scheme
 */

.flatpickr-calendar {
    background: #FFFFFF;
    border: 1px solid #4A5D52;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(11, 31, 42, 0.25);
    font-family: 'Open Sans', 'Segoe UI', Tahoma, sans-serif;
}

.flatpickr-months {
    background: linear-gradient(135deg, #0B1F2A 0%, #4A5D52 100%);
    border-radius: 8px 8px 0 0;
}

.flatpickr-month {
    color: #FFFFFF;
    fill: #FFFFFF;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    font-weight: 600;
    border: none;
}

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

.flatpickr-current-month input.cur-year {
    color: #FFFFFF;
    font-weight: 600;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    color: #C8A96A;
    fill: #C8A96A;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    color: #FFFFFF;
    fill: #FFFFFF;
}

.flatpickr-weekdays {
    background: #F2F4F6;
}

.flatpickr-weekday {
    color: #0B1F2A;
    font-weight: 600;
    font-size: 90%;
}

.flatpickr-days {
    border: 1px solid #E0E0E0;
    border-width: 1px 0;
}

.flatpickr-day {
    color: #0B1F2A;
    border-radius: 6px;
    font-weight: 500;
}

.flatpickr-day:hover:not(.flatpickr-disabled) {
    background: #F2F4F6;
    border-color: #C8A96A;
    cursor: pointer;
}

/* Available dates - highlighted in orange */
.flatpickr-day.available {
    background: #FFE4C4 !important;
    border-color: #C8A96A !important;
    color: #0B1F2A;
    font-weight: 600;
    cursor: pointer !important;
    position: relative;
}

.flatpickr-day.available:hover {
    background: #C8A96A !important;
    color: #FFFFFF !important;
    cursor: pointer !important;
}

.flatpickr-day.available::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #C8A96A;
    border-radius: 50%;
}

.flatpickr-day.available:hover::after {
    background: #FFFFFF;
}

.flatpickr-day.selected {
    background: #4A5D52 !important;
    border-color: #4A5D52 !important;
    color: #FFFFFF !important;
    font-weight: 700;
}

.flatpickr-day.selected:hover {
    background: #0B1F2A !important;
    border-color: #0B1F2A !important;
}

.flatpickr-day.today {
    border-color: #C8A96A;
    background: rgba(200, 169, 106, 0.1);
}

.flatpickr-day.today:hover {
    border-color: #C8A96A;
    background: rgba(200, 169, 106, 0.2);
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #CCCCCC;
    cursor: not-allowed !important;
    background: transparent;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #AAAAAA;
}

.flatpickr-time {
    border-top: 1px solid #E0E0E0;
}

.flatpickr-time input {
    color: #0B1F2A;
    font-weight: 600;
}

.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
    color: #0B1F2A;
}

/* Calendar container wrapper */
.tls-calendar-wrapper {
    position: relative;
}

.tls-calendar-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Open Sans', 'Segoe UI', Tahoma, sans-serif;
    transition: all 0.3s ease;
    background: #FFFFFF;
    cursor: pointer;
}

.tls-calendar-input:hover {
    border-color: #C8A96A;
}

.tls-calendar-input:focus {
    outline: none;
    border-color: #4A5D52;
    box-shadow: 0 0 0 3px rgba(200, 169, 106, 0.2);
}

.tls-calendar-input::placeholder {
    color: #999999;
}

/* Loading indicator for calendar */
.tls-calendar-loading {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #E0E0E0;
    border-top-color: #C8A96A;
    border-radius: 50%;
    animation: tls-spin 0.8s linear infinite;
}

@keyframes tls-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Calendar icon */
.tls-calendar-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: #4A5D52;
    pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .flatpickr-calendar {
        font-size: 14px;
    }
    
    .flatpickr-day {
        max-width: 38px;
        height: 38px;
        line-height: 38px;
    }
}


/* FIXED: Additional styles for inline calendar display */
.tls-calendar-wrapper {
    position: relative;
    margin-bottom: 20px;
}

/* Hide the input field when using inline calendar */
.tls-calendar-wrapper .tls-calendar-input {
    display: none;
}

/* Ensure inline calendar is visible and properly styled */
.flatpickr-calendar.inline {
    display: block !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(11, 31, 42, 0.15);
}

/* Make sure the calendar is centered */
.tls-calendar-wrapper .flatpickr-calendar {
    width: 100%;
    max-width: 100%;
}

/* Ensure days are clickable */
.flatpickr-day {
    cursor: pointer !important;
}

.flatpickr-day.flatpickr-disabled {
    cursor: not-allowed !important;
    opacity: 0.3;
}

/* Make available dates more prominent and clickable */
.flatpickr-day.available {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Ensure the calendar container has proper z-index */
.flatpickr-calendar {
    z-index: 999;
}
