/* Form Calendar CSS - Based on calendar.css but adapted for form templates
   Supports multiple date picker instances with unique IDs */

:root {
  --amexPrimaryColor: #006FCF;
}

/* Form Date Picker Container */
.formTemplate__datepicker-container {
    position: relative;
    font-family: "ICPangeaText";
    width: 100%;
    margin-bottom: 1.5rem; 
}

/* Form Date Picker Title */
.formTemplate__datepicker-title {
    margin-bottom: 1rem; 
}

.formTemplate__datepicker-title .fieldTitle {
    font-size: 0.875rem;    /* Small size - 14px */
    color: #6c757d;
    margin: 0 0 0.75rem 0; 
    line-height: 1.3;
    font-weight: 400;
}

/* Form Date Picker Wrapper */
.formTemplate__datepicker {
    position: relative;
    width: 100%;
}

/* Optional Text - When positioned below input */
.formTemplate__datepicker .optional-text {
    font-size: 12px;
    color: #6c757d;
    position: absolute;
    bottom: 2px;
    height: 28px;
}

/* Input Container */
.input-container {
    position: relative;
    width: 100%;
    height: 50px; 
}

/* Date Input Field - Styled like formInputFieldTemplate with floating label */
.formTemplate__datepicker-input {
    border: none;
    border-bottom: 1px solid #757575;
    background-color: transparent;
    border-radius: 0px !important;
    width: 100%;
    font-size: 16px;
    font-weight: 400;
    line-height: 26.1px;
    text-align: right;
    bottom: 33px;
    position: absolute;
    padding-right: 2.5rem;
    box-sizing: border-box;
    font-family: "ICPangeaText";
    cursor: text;
    user-select: text;
    pointer-events: auto;
    z-index: 1;
}

.formTemplate__datepicker-input:focus {
    outline: none;
}

/* Placeholder styling */
.formTemplate__datepicker-input::placeholder {
    color: #757575;
    font-size: 16px;
    font-weight: 400;
    font-family: "ICPangeaText";
}

/* Date Picker Icon */
.datePickerIcon {
    position: absolute;
    right: 12px;
    top: 1%;
    transform: translateY(-50%);
    cursor: pointer;
    width: 20px;
    height: 20px;
    opacity: 1;
    filter: brightness(0);
    transition: opacity 0.3s ease;
    z-index: 10;
    pointer-events: auto;
}

@media (min-width: 768px) {
    .datePickerIcon:hover {
        opacity: 0.8;
    }
}

/* RTL Support */
[dir="rtl"] .datePickerIcon {
    right: auto;
    left: 12px;
}

/* Calendar Modal */
.calendar-modal {
    display: none;
    position: absolute;
    background: white;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    border-radius: 0; 
    height: 470px;
    font-family: "ICPangeaText";
}

/* Calendar Header */
.calendar-header {
    display: flex;
    align-items: center;
    padding: 0px;
    background: #F7F8F9;
    border-bottom: none;
    flex-direction: column;
    height: 84px;
    justify-content: flex-start;
    gap: 8px;
    width: 330px;
    border-radius: 0; 
}

/* Date Picker Head */
.datePickerHead {
    width: 322px;
    border-radius: 0; 
    display: flex;
    align-items: center;
    font-size: 20px;
    padding: 14px;
    position: relative;
    justify-content: center;
}

/* Close Icon */
.closeIcon {
    right: 19px;
    position: absolute;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    transition: color 0.2s ease;
}

@media (min-width: 768px) {
    .closeIcon:hover {
        color: #333;
    }
}

/* Amex Close Icon */
.closeIcon--amex {
    color: var(--amexPrimaryColor);
}

@media (min-width: 768px) {
    .closeIcon--amex:hover {
        color: #0056a3; /* Darker shade of Amex blue */
    }
}

/* RTL Support for Close Icon */
[dir="rtl"] .closeIcon {
    right: auto;
    left: 30px;
}

/* Date Picker Date Controls */
.datePickeDate {
    display: flex;
    justify-content: space-between;
    width: 322px;
    height: 0px;
    align-items: center;
}

/* Calendar Year Dropdown and Month Navigation */
.calendar-header select,
.calendar-header button,
.monthPickerContainer {
    padding: 5px;
    margin: 0 5px;
    font-size: 18px;
    border: none;
    background-color: transparent;
    font-family: "ICPangeaText";
}

/* Specific styling for year dropdown */
.calendar-header select {
    color: #000000;
}

.calendar-header.amex select {
    color: var(--amexPrimaryColor);
}


.monthPickerContainer {
    display: flex;
    align-items: center;
}

.calendar-header .month-navigator {
    display: flex;
    align-items: center;
    font-weight: normal;
}

/* Month Navigation Buttons */
button[id*="prevMonth"], 
button[id*="nextMonth"] {
    cursor: pointer;
    color: #000000;
    background: none;
    border: none;
    font-size: 24px;
    padding: 8px 15px;
    transition: background-color 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    button[id*="prevMonth"]:hover, 
    button[id*="nextMonth"]:hover {
        background-color: rgba(0, 0, 0, 0.1);
        border-radius: 4px;
    }
}

/* Amex Month Navigation Buttons */
.month-nav--amex {
    color: var(--amexPrimaryColor) !important;
}

@media (min-width: 768px) {
    .month-nav--amex:hover {
        color: #0056a3 !important; /* Darker shade of Amex blue */
        background-color: rgba(0, 111, 207, 0.1) !important; /* Light Amex blue background */
    }
}

/* Calendar Days Grid */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 2px;
    padding: 10px;
    height: 308px; /* Fixed height for consistent modal size */
}

.calendar-days div {
    width: 42px;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    font-family: "ICPangeaText";
}

@media (min-width:768px){
    /* Day Hover Effect */
    .calendar-days div:hover:not(.disabled, .calendar-day-name) {
        width: 38px;
        height: 34px;
        border-radius: 10px;
        font-weight: 600;
        border: 2px solid #3F3FEA;
        background-color: #ECECFD;
    }
}

/* Ensure today maintains its frame when hovered (no background unless selected) */
@media (min-width: 768px) {
    .calendar-days div.today:hover:not(.selected-datepicker) {
        background-color: transparent;
        border: 2px solid #3F3FEA;
    }
}
@media (min-width:768px){
    /* Selected dates keep their styling on hover */
    .calendar-days div.selected-datepicker:hover {
        background-color: #ECECFD;
        border: 2px solid #3F3FEA;
    }
    
}

/* Calendar Day Names (Weekdays) */
.calendar-day-name {
    font-weight: bold;
    cursor: default !important;
    color: #666;
}

/* Today Highlight - frame only, no background */
.today {
    width: 38px !important;
    height: 34px !important;
    border-radius: 10px;
    border: 2px solid #3F3FEA;
    background-color: transparent;
    font-weight: 600;
}

/* Amex Today Highlight */
.calendar-modal--amex .today {
    border: 2px solid var(--amexPrimaryColor);
}

/* Selected Date */
.selected-datepicker {
    width: 38px !important;
    height: 34px !important;
    border-radius: 10px;
    font-weight: 600;
    border: 2px solid #3F3FEA;
    background-color: #ECECFD;
}

/* Amex Selected Date Styling */
.calendar-modal--amex .selected-datepicker {
    border: 2px solid var(--amexPrimaryColor);
    background-color: rgba(0, 111, 207, 0.1); /* Light Amex blue background */
}

/* Amex Selected Date Hover */
@media (min-width: 768px) {
    .calendar-modal--amex .selected-datepicker:hover {
        background-color: rgba(0, 111, 207, 0.2); /* Slightly darker Amex blue background on hover */
        border: 2px solid var(--amexPrimaryColor);
    }
}

@media (min-width:768px){
    /* Amex Day Hover Effect */
    .calendar-modal--amex .calendar-days div:hover:not(.disabled, .calendar-day-name) {
        border: 2px solid var(--amexPrimaryColor);
        background-color: rgba(0, 111, 207, 0.1);
    }
    
    /* Amex Today Highlight on Hover (when not selected) */
    .calendar-modal--amex .calendar-days div.today:hover:not(.selected-datepicker) {
        background-color: transparent;
        border: 2px solid var(--amexPrimaryColor);
    }
}


/* When today is also selected, selected styling takes precedence */
.today.selected-datepicker {
    background-color: #ECECFD;
    border: 2px solid #3F3FEA;
}

/* Amex styling when today is also selected */
.calendar-modal--amex .today.selected-datepicker {
    background-color: rgba(0, 111, 207, 0.1);
    border: 2px solid var(--amexPrimaryColor);
}

/* Disabled Dates */
.disabled {
    color: #ccc !important;
    cursor: default !important;
}

@media (min-width: 768px) {
    .disabled:hover {
        background: none !important;
        border: none !important;
        width: 42px !important;
        height: 38px !important;
    }
}

/* Select2 Dropdown Styling */
.select2-container--default .select2-selection--single {
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 38px;
    line-height: 38px;
    background-color: #fff;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    right: 10px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #333 transparent transparent transparent;
    border-style: solid;
    border-width: 5px 4px 0 4px;
    height: 0;
    left: 50%;
    margin-left: -4px;
    margin-top: -2px;
    position: absolute;
    top: 50%;
    width: 0;
}

/* Fallback styling for native select if Select2 fails to load */
#calendarYear {
    appearance: none; /* Force custom styling on all devices including iOS */
    -webkit-appearance: none; /* Webkit specific (Safari, Chrome) */
    -moz-appearance: none; /* Firefox specific */
    background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6,9 12,15 18,9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 80px;
    /* Additional iOS fixes */
    background-color: white;
    cursor: pointer;
}

.result__option {
    z-index: 1002;
}

.result__option ul {
    margin: 0;
    padding: 5px 0;
}

.result__option ul::-webkit-scrollbar {
    border-radius: 10px;
    width: 4px;
}

.result__option ul::-webkit-scrollbar-thumb {
    background-color: #C6C6C6;
    border-radius: 10px;
}

/* Overlay Background */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
}

/* Calendar Confirm Button */
.calendar-button {
    display: block;
    width: 300px;
    height: 40px;
    border-radius: 4px;
    background-color: #000;
    color: #f0f0f0;
    margin: auto auto 32px;
    bottom: 0;
    position: absolute;
    right: 50%;
    transform: translateX(50%);
    cursor: pointer;
    font-family: "ICPangeaText";
    letter-spacing: 0.6px;
    border: none;
    transition: background-color 0.2s ease;
}

@media (min-width: 768px) {
    .calendar-button:hover {
        background-color: #333;
    }
}

/* Amex Calendar Button */
.calendar-button--amex {
    background-color: var(--amexPrimaryColor);
}

@media (min-width: 768px) {
    .calendar-button--amex:hover {
        background-color: #0056a3; /* Darker shade of Amex blue */
    }
}

/* Form Validation Message */
.formTemplate__validation-message {
    display: none;
    margin-top: 0.5rem; 
    padding: 0.5rem 0.75rem; 
    font-size: 0.875rem;
    color: #dc3545;
}

.formTemplate__validation-message.show {
    display: block;
}

/* Error and Optional Text styling - matching input field pattern */
.input-container .error {
    color: red;
    font-size: 14px;
    position: absolute;
    height: 0;
    visibility: hidden;
    bottom: 30px;
    right: 0;
    font-family: "ICPangeaText";
}

.input-container .optionalText {
    color: #757575;
    font-size: 12px;
    position: absolute;
    height: 0;
    visibility: visible;
    bottom: 30px;
    right: 0;
    font-family: "ICPangeaText";
}

/* Error State */
.formTemplate__datepicker.error .formTemplate__datepicker-input,
.formTemplate__datepicker-input.error {
    border: 2px solid #dc3545;
    background-color: #fff5f5;
}

.formTemplate__datepicker.error .formTemplate__datepicker-input:focus,
.formTemplate__datepicker-input.error:focus {
    border: 2px solid #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

/* Animation for validation message */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 50px;
    }
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .calendar-modal {
        position: fixed;
        left: unset;
        top: unset;
        transform: unset;
        border-radius: 16px 16px 0 0;
        width: 100%;
        bottom: 0;
        height: auto;
        min-height: 500px; /* Ensure minimum height to accommodate content */
        padding-bottom: 80px; /* Add space at bottom for OK button */
    }

    .calendar-header {
        width: 100%; /* Full width for mobile */
        margin: 0; /* Remove any margin */
        border-radius: 16px 16px 0 0; /* Rounded top corners for mobile */
        height: auto; /* Allow height to adjust based on content */
        min-height: 90px; /* Ensure minimum height for proper spacing */
    }

    .calendar-header select,
    .calendar-header button,
    .monthPickerContainer {
        padding: 5px 0; /* Add vertical padding for better spacing */
        margin: 5px 0; /* Add vertical margin between elements */
        font-size: 16px;
        gap: 8px;
    }
    
    /* Maintain larger navigation arrows on mobile */
    button[id*="prevMonth"], 
    button[id*="nextMonth"] {
        font-size: 22px;
        padding: 6px 12px;
        min-width: 40px;
        min-height: 40px;
    }

    .datePickerHead {
        width: 100%; /* Full width for mobile */
        margin: 0; /* Remove margin */
        padding: 14px 20px; /* Adjust padding for mobile */
        font-size: 18px;
        border-radius: 16px 16px 0 0; /* Rounded top corners for mobile */
        box-sizing: border-box; /* Include padding in width calculation */
    }

    .datePickeDate {
        width: 100%; /* Full width for mobile */
        padding: 0 20px; /* Add horizontal padding for content spacing */
        box-sizing: border-box; /* Include padding in width calculation */
    }

    /* Mobile calendar button positioning */
    .calendar-button {
        position: relative; /* Change from absolute to relative */
        width: calc(100% - 40px); /* Full width minus padding */
        margin: 20px auto 20px; /* Top and bottom margin, centered */
        transform: none; /* Remove transform */
        right: auto; /* Reset right positioning */
    }

    .formTemplate__datepicker-container {
        margin-bottom: 1.25rem;
    }
    
    .formTemplate__datepicker-input {
        font-size: 16px; /* Prevents zoom on iOS */           
    }
    
    /* Mobile-specific Select2 and dropdown arrow styling */
    .select2-container--default .select2-selection--single {
        height: 40px;
        line-height: 40px;
        font-size: 16px;
    }
    
    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 38px;
        right: 8px;
        color: #000000;
    }
    
    .select2-container--default .select2-selection--single .select2-selection__arrow b {
        border-width: 6px 5px 0 5px;
        margin-left: -5px;
        margin-top: -3px;
        color: #000000;
    }
    
    /* Mobile fallback for native select arrow */
    #calendarYear {
        appearance: none; /* Force custom styling on mobile */
        -webkit-appearance: none; /* iOS Safari specific */
        -moz-appearance: none; /* Firefox mobile */
        font-size: 16px;
        height: 40px;
        background-size: 20px;
        background-position: right 10px center;
        padding-right: 36px;
        min-width: 100px;
        background-color: white; /* Ensure background is visible */
        cursor: pointer;
    }

    /* Mobile calendar days grid - maintain fixed height */
    .calendar-days {
        height: 280px; /* Slightly smaller height for mobile */
        grid-template-rows: repeat(7, 1fr);
        padding: 8px; /* Reduce padding for mobile */
    }
}

@media screen and (max-width: 480px) {
    .formTemplate__datepicker-input {
        padding: 1rem;       
    }
    
    .formTemplate__validation-message {
        font-size: 0.8125rem;
        padding: 0.625rem;
    }

    /* Smaller mobile calendar days grid - maintain fixed height */
    .calendar-days {
        height: 250px; /* Even smaller height for very small screens */
        padding: 6px; /* Further reduce padding */
    }

    .calendar-days div {
        width: 38px;
        height: 34px;
        font-size: 14px;
    }

    /* No hover effects on mobile - removed for better touch experience */

    .today,
    .selected-datepicker {
        width: 34px !important;
        height: 30px !important;
    }

    /* Amex mobile today and selected styling */
    .calendar-modal--amex .today {
        border: 2px solid var(--amexPrimaryColor);
    }

    .calendar-modal--amex .selected-datepicker {
        border: 2px solid var(--amexPrimaryColor);
        background-color: rgba(0, 111, 207, 0.1);
    }

    /* Amex mobile styling when today is also selected */
    .calendar-modal--amex .today.selected-datepicker {
        background-color: rgba(0, 111, 207, 0.1);
        border: 2px solid var(--amexPrimaryColor);
    }
}

/* RTL Support for Hebrew */
[dir="rtl"] .formTemplate__datepicker-container {
    text-align: right;
}

[dir="rtl"] .formTemplate__datepicker-input {
    text-align: right;
    direction: rtl;
    padding-right: 0;
    padding-left: 2.5rem;
    padding-bottom: inherit;
}

[dir="rtl"] .calendar-days {
    direction: rtl;
}


/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .formTemplate__datepicker-input {
        border: 3px solid #000;
    }
    
    .formTemplate__datepicker-input:focus {
        border: 3px solid #007bff;
        box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.25);
    }

}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .formTemplate__datepicker-input {
        transition: none;
    }
    
    .formTemplate__validation-message {
        animation: none;
    }
    
    .datePickerIcon {
        transition: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* Input Field Dark Mode */
    .formTemplate__datepicker-input {
        background-color: transparent;
        border-color: #4a5568;
        color: #000000;
    } 
    
    .formTemplate__datepicker-input::placeholder {
        color: #a0aec0;
    }
    
    /* Calendar Modal Dark Mode */
    .calendar-modal {
        background-color: #2d3748;
        border-color: #4a5568;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
    
    /* Calendar Header Dark Mode */
    .calendar-header {
        background-color: #4a5568;
        color: #f7fafc;
        border-bottom-color: #718096;
    }
    
    .datePickerHead {
        background-color: #4a5568;
        color: #f7fafc;
    }
    
    /* Close Icon Dark Mode */
    .closeIcon {
        color: #a0aec0;
    }
    
    .closeIcon:hover {
        color: #f7fafc;
    }
    
    .closeIcon--amex {
        color: var(--amexPrimaryColor);
    }
    
    .closeIcon--amex:hover {
        color: #63b3ed;
    }
    
    /* Year Dropdown and Month Controls Dark Mode */
    .calendar-header select,
    .calendar-header button,
    .monthPickerContainer {
        background-color: transparent;
        color: #f7fafc;
        border-color: #718096;
    }
    
    .calendar-header select:focus {
        border-color: #63b3ed;
        box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.15);
    }
    
    /* Month Navigation Dark Mode */
    button[id*="prevMonth"], 
    button[id*="nextMonth"] {
        color: #f7fafc;
        background-color: transparent;
    }
    
    button[id*="prevMonth"]:hover, 
    button[id*="nextMonth"]:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #f7fafc;
    }
    
    .month-nav--amex {
        color: var(--amexPrimaryColor) !important;
    }
    
    .month-nav--amex:hover {
        color: #63b3ed !important;
        background-color: rgba(0, 111, 207, 0.2) !important;
    }
    
    /* Calendar Days Grid Dark Mode */
    .calendar-days {
        background-color: #2d3748;
    }
    
    .calendar-days div {
        color: #f7fafc;
    }
    
    /* Calendar Day Names Dark Mode */
    .calendar-day-name {
        color: #a0aec0;
    }
    
    /* Day Hover Effect Dark Mode */
    .calendar-days div:hover:not(.disabled, .calendar-day-name) {
        background-color: #4a5568;
        border-color: #63b3ed;
        color: #f7fafc;
    }
    
    /* Today Highlight Dark Mode */
    .today {
        border-color: #63b3ed;
        background-color: transparent;
        color: #f7fafc;
    }
    
    .calendar-modal--amex .today {
        border-color: var(--amexPrimaryColor);
    }
    
    .calendar-days div.today:hover:not(.selected-datepicker) {
        background-color: transparent;
        border-color: #63b3ed;
    }
    
    .calendar-modal--amex .calendar-days div.today:hover:not(.selected-datepicker) {
        border-color: var(--amexPrimaryColor);
    }
    
    /* Selected Date Dark Mode */
    .selected-datepicker {
        border-color: #63b3ed;
        background-color: rgba(99, 179, 237, 0.2);
        color: #f7fafc;
    }
    
    .calendar-modal--amex .selected-datepicker {
        border-color: var(--amexPrimaryColor);
        background-color: rgba(0, 111, 207, 0.2);
    }
    
    .selected-datepicker:hover {
        background-color: rgba(99, 179, 237, 0.3);
        border-color: #63b3ed;
    }
    
    .calendar-modal--amex .selected-datepicker:hover {
        background-color: rgba(0, 111, 207, 0.3);
        border-color: var(--amexPrimaryColor);
    }
    
    /* Combined Today + Selected Dark Mode */
    .today.selected-datepicker {
        background-color: rgba(99, 179, 237, 0.2);
        border-color: #63b3ed;
    }
    
    .calendar-modal--amex .today.selected-datepicker {
        background-color: rgba(0, 111, 207, 0.2);
        border-color: var(--amexPrimaryColor);
    }
    
    /* Disabled Dates Dark Mode */
    .disabled {
        color: #718096 !important;
    }
    
    /* Calendar Button Dark Mode */
    .calendar-button {
        background-color: #4a5568;
        color: #f7fafc;
        border-color: #718096;
    }
    
    .calendar-button:hover {
        background-color: #718096;
        color: #f7fafc;
    }
    
    .calendar-button--amex {
        background-color: var(--amexPrimaryColor);
        color: #f7fafc;
    }
    
    .calendar-button--amex:hover {
        background-color: #0056a3;
    }
    
    /* Validation Message Dark Mode */
    .formTemplate__validation-message {
        color: #fc8181;
        background-color: rgba(254, 178, 178, 0.1);
    }
    
    /* Error State Dark Mode */
    .formTemplate__datepicker.error .formTemplate__datepicker-input,
    .formTemplate__datepicker-input.error {
        border-color: #fc8181;
        background-color: rgba(254, 178, 178, 0.1);
        color: #f7fafc;
    }
    
    .formTemplate__datepicker.error .formTemplate__datepicker-input:focus,
    .formTemplate__datepicker-input.error:focus {
        border-color: #fc8181;
        box-shadow: 0 0 0 3px rgba(252, 129, 129, 0.15);
    }
    
    /* Date Picker Icon Dark Mode */
    .datePickerIcon {        
        opacity: 0.8;
    }
    
    .datePickerIcon:hover {
        opacity: 1;
    }
    
    /* Title and Label Dark Mode */
    .formTemplate__datepicker-title .fieldTitle {
        color: #757575;
    }
    
    /* Optional Text Dark Mode */
    .formTemplate__datepicker .optional-text,
    .input-container .optionalText {
        color: #757575;
    }
    
    /* Error Text Dark Mode */
    .input-container .error {
        color: #fc8181;
    }
    
    /* Overlay Dark Mode */
    .overlay {
        background: rgba(0, 0, 0, 0.85);
    }
    
    /* Select2 Dropdown Dark Mode (if used) */
    .select2-container--default .select2-selection--single {
        background-color: #4a5568;
        border-color: #718096;
        color: #f7fafc;
    }
    
    .select2-container--default .select2-selection--single .select2-selection__arrow b {
        border-color: #a0aec0 transparent transparent transparent;
    }
    
    /* Fallback select Dark Mode */
    #calendarYear {
        background-color: #4a5568;
        border-color: #718096;
        color: #f7fafc;
        background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6,9 12,15 18,9'></polyline></svg>");
    }
    
    /* Mobile Specific Dark Mode Adjustments */
    @media screen and (max-width: 768px) {
        .calendar-modal {
            background-color: #2d3748;
            border-top: 1px solid #4a5568;
        }
        
        .calendar-header {
            background-color: #4a5568;
            border-bottom: 1px solid #718096;
        }
        
        .datePickerHead {
            background-color: #4a5568;
        }
        
        /* Mobile calendar button in dark mode */
        .calendar-button {
            background-color: #4a5568;
            border: 1px solid #718096;
        }
        
        .calendar-button:hover {
            background-color: #718096;
        }
        
        .calendar-button--amex {
            background-color: var(--amexPrimaryColor);
            border: 1px solid var(--amexPrimaryColor);
        }
        
        .calendar-button--amex:hover {
            background-color: #0056a3;
            border: 1px solid #0056a3;
        }
    }
    
    /* Mobile Amex Dark Mode Day Effects */
    @media screen and (max-width: 480px) {
        .calendar-modal--amex .calendar-days div:hover:not(.disabled, .calendar-day-name) {
            border: 2px solid var(--amexPrimaryColor);
            background-color: rgba(0, 111, 207, 0.2);
        }
        
        .calendar-modal--amex .today {
            border: 2px solid var(--amexPrimaryColor);
            background-color: transparent;
        }
        
        .calendar-modal--amex .selected-datepicker {
            border: 2px solid var(--amexPrimaryColor);
            background-color: rgba(0, 111, 207, 0.2);
        }
        
        .calendar-modal--amex .today.selected-datepicker {
            background-color: rgba(0, 111, 207, 0.2);
            border: 2px solid var(--amexPrimaryColor);
        }
    }
}