.datepicker-container {
    position: relative;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.datepicker-container.rtl {
    direction: rtl;
}

.datepicker-container.ltr {
    direction: ltr;
}

.calendar-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px 6px 0 0;
    height: 15px;
}

.calendar-label {
    font-weight: 600;
    font-size: 14px;
    color: #262626;
    margin: 0;
}

.required-indicator {
    color: #ff4d4f;
    margin-left: 4px;
}

.calendar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.today-button {
    font-size: 13px;
    padding: 4px 12px;
    transition: all 0.3s ease;
    border: unset !important;
}

.today-button:hover {
    color: #2f855a;
}

.calendar-switch {
    min-width: 60px;
}

.calendar-input {
    width: 100%;
    padding: 8px 12px;
    padding-inline-end: 36px;
    font-size: 14px;
    line-height: 1.5715;
    color: #262626;
    background-color: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    cursor: pointer;
    outline: none;
    margin-top: 10px;
}

.calendar-input-wrapper {
    position: relative;
}

.calendar-input-clear {
    position: absolute;
    top: 50%;
    inset-inline-end: 12px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    padding: 0;
    color: #98a2b3;
    cursor: pointer;
    line-height: 1;
}

.calendar-input-clear:hover {
    color: #667085;
}

.calendar-input:hover:not(.disabled) {
    border-color: #2f855a;
}

.calendar-input:focus:not(.disabled) {
    border-color: #2f855a;
    box-shadow: 0 0 0 2px rgba(47, 133, 90, 0.1);
}

.calendar-input.disabled {
    background-color: #fff;
    color: rgba(0, 0, 0, 0.25);
    cursor: not-allowed;
    border: 0;
    color: black;
    margin: 5px 0 0 0;
    padding: 0;
}

.calendar-input.error {
    border-color: #ff4d4f;
}

.calendar-input.error:focus {
    border-color: #ff4d4f;
    box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.1);
}

.validation-message {
    margin-top: 4px;
    font-size: 13px;
    color: #ff4d4f;
    line-height: 1.5;
}

.calendar-popup {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12);
    z-index: 1050;
    padding: 16px;
    min-width: 280px;
    animation: calendar-datepicker-slideDown 0.2s ease-out;
}

@keyframes calendar-datepicker-slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-popup.popup-enter {
    animation: calendar-datepicker-slideDown 0.2s ease-out;
}

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.month-year-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #262626;
}

.month-selector-button,
.year-selector-button {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: inherit;
    font-weight: inherit;
}

.month-selector-button:hover,
.year-selector-button:hover {
    background-color: #f5f5f5;
}

.dropdown-icon {
    transition: transform 0.2s ease;
}

.dropdown-icon.expanded {
    transform: rotate(180deg);
}

.navigation-buttons {
    display: flex;
    gap: 8px;
}

.nav-button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #262626;
}

.nav-button:hover:not(:disabled) {
    background-color: #f5f5f5;
    border-color: #d9d9d9;
}

.nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.calendar-grid {
    width: 100%;
}

.weekday-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.weekday-header {
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: #8c8c8c;
    padding: 4px 0;
}

.weekday-header abbr {
    text-decoration: none;
    cursor: help;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.day-cell {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 100%;
    cursor: pointer;
    border: 1px solid transparent;
    background: none;
    font-size: 14px;
    color: #262626;
    transition: all 0.2s ease;
    position: relative;
}

.day-cell:not(.empty):not(.disabled):hover {
    background-color: #f5f5f5;
    border-color: #d9d9d9;
}

.day-cell.empty {
    cursor: default;
}

.day-cell.selected {
    background-color: #2f855a !important;
    color: #fff !important;
    font-weight: 600;
    border-color: #2f855a !important;
}

.day-cell.today:not(.selected) {
    border: 1px solid #2f855a;
    font-weight: 600;
}

.day-cell.disabled {
    color: #d9d9d9;
    cursor: not-allowed;
    background-color: #fafafa;
}

.day-number {
    display: block;
}

.year-selector-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
}

.year-selector-grid::-webkit-scrollbar {
    width: 6px;
}

.year-selector-grid::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.year-selector-grid::-webkit-scrollbar-thumb {
    background: #bfbfbf;
    border-radius: 3px;
}

.year-selector-grid::-webkit-scrollbar-thumb:hover {
    background: #8c8c8c;
}

.year-cell {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    background: none;
    font-size: 14px;
    color: #262626;
    transition: all 0.2s ease;
}

.year-cell:hover {
    background-color: #f5f5f5;
    border-color: #d9d9d9;
}

.year-cell.current:not(.selected) {
    border: 1px solid #2f855a;
    font-weight: 600;
}

.year-cell.selected {
    background-color: #2f855a !important;
    color: #fff !important;
    font-weight: 600;
    border-color: #2f855a !important;
}

.month-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 4px;
}

.month-cell {
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    background: none;
    font-size: 13px;
    color: #262626;
    transition: all 0.2s ease;
    padding: 8px;
    text-align: center;
}

.month-cell:hover {
    background-color: #f5f5f5;
    border-color: #d9d9d9;
}

.month-cell.current:not(.selected) {
    border: 1px solid #2f855a;
    font-weight: 600;
}

.month-cell.selected {
    background-color: #2f855a !important;
    color: #fff !important;
    font-weight: 600;
    border-color: #2f855a !important;
}

.time-selector {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-label {
    font-weight: 600;
    font-size: 13px;
    color: #262626;
    margin: 0;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-input {
    width: 50px;
    padding: 4px 8px;
    font-size: 14px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    text-align: center;
    transition: all 0.2s ease;
}

.time-input:focus {
    border-color: #2f855a;
    box-shadow: 0 0 0 2px rgba(47, 133, 90, 0.1);
    outline: none;
}

.time-separator {
    font-weight: 600;
    color: #262626;
}

.calendar-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.action-button {
    padding: 6px 16px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #d9d9d9;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.cancel-button {
    background: #fff;
    color: #262626;
}

.cancel-button:hover {
    color: #2f855a;
    border-color: #2f855a;
}

.confirm-button {
    background: #2f855a;
    color: #fff;
    border-color: #2f855a;
}

.confirm-button:hover {
    background: #276a47;
    border-color: #276a47;
}

@media (max-width: 480px) {
    .calendar-popup {
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: calc(100% - 32px);
        max-width: 320px;
    }

    .calendar-header-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .calendar-actions {
        width: 100%;
        justify-content: space-between;
    }
}

.day-cell:focus-visible,
.year-cell:focus-visible,
.month-cell:focus-visible,
.nav-button:focus-visible,
.year-selector-button:focus-visible,
.month-selector-button:focus-visible {
    outline: 2px solid #2f855a;
    outline-offset: 2px;
}

.calendar-input:focus-visible {
    outline: none;
}
