.fp-datepicker {
    direction: rtl;
    font-family: 'YekanBakhFaNum2', 'YekanBakh', Tahoma, sans-serif;
    position: fixed;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
    padding: 15px;
    z-index: 99999999;
    width: max-content;
    min-width: 300px;
    user-select: none;
    box-sizing: border-box;
}

.fp-datepicker * {
    box-sizing: border-box;
}

.fp-datepicker.fp-dp-gregorian {
    direction: ltr;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.fp-dp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px;
}

.fp-dp-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.fp-dp-year,
.fp-dp-month {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    font-weight: bold;
}

.fp-dp-year:hover,
.fp-dp-month:hover {
    background-color: #f0f0f0;
}

.fp-dp-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    color: #333;
    transition: background-color 0.2s ease;
    font-family: inherit;
}

.fp-dp-nav-btn:hover {
    background-color: #f0f0f0;
}

.fp-dp-calendar-wrap {
    position: relative;
}

.fp-dp-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    min-width: 280px;
}

.fp-dp-weekday {
    font-weight: bold;
    font-size: 11px;
    color: #666;
    padding: 4px 2px;
    text-align: center;
}

.fp-dp-day {
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 5px 2px;
    min-height: 40px;
    border: 1px solid transparent;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    color: #1e293b;
}

.fp-dp-day:hover:not(.fp-dp-disabled):not(.fp-dp-empty) {
    background: #f0f0f0;
}

.fp-dp-day.fp-dp-empty {
    cursor: default;
    background: transparent;
}

.fp-dp-day.fp-dp-disabled {
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.55;
}

.fp-dp-day.fp-dp-today {
    border-color: #0284c7;
    background: #f0f9ff;
}

.fp-dp-day.fp-dp-selected {
    background: #007bff !important;
    color: #ffffff !important;
    font-weight: bold;
}

.fp-dp-day-num {
    font-size: 13px;
    line-height: 1.2;
}

.fp-dp-day.fp-dp-selected .fp-dp-day-num {
    color: #ffffff;
}

.fp-dp-day-price {
    font-size: 9px;
    line-height: 1.1;
    margin-top: 2px;
    color: #0f766e;
    font-weight: 600;
    white-space: nowrap;
}

.fp-dp-day-price.fp-dp-cheapest {
    color: #15803d;
    font-weight: 700;
}

.fp-dp-day.fp-dp-selected .fp-dp-day-price {
    color: #dbeafe;
}

.fp-dp-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.fp-dp-footer-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.fp-dp-price-note {
    font-size: 10px;
    color: #64748b;
}

.fp-dp-toggle-btn {
    background: #007bff;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: background-color 0.2s ease;
}

.fp-dp-toggle-btn:hover {
    background: #0056b3;
}

.fp-dp-today-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #28a745;
    color: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: background-color 0.2s ease;
}

.fp-dp-today-btn:hover {
    background: #218838;
}

.fp-dp-close-btn {
    background: #dc3545;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: background-color 0.2s ease;
}

.fp-dp-close-btn:hover {
    background: #c82333;
}

/* Year & Month Overlays */
.fp-dp-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    padding: 12px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    color: #1e293b;
    border-radius: 10px;
}

.fp-dp-year-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.fp-dp-year-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    flex: 1;
}

.fp-dp-month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    flex: 1;
}

.fp-dp-grid-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 7px 4px;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.fp-dp-grid-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.fp-dp-grid-item.selected {
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
    font-weight: bold;
}

.fp-dp-overlay-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
}

.fp-dp-overlay-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #0f172a;
}

.fp-dp-overlay-close {
    margin-top: 8px;
    align-self: center;
}

/* Mobile fullscreen view */
@media (max-width: 768px) {
    .fp-datepicker.fp-dp-mobile {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        padding: 20px !important;
        overflow: auto !important;
        z-index: 99999999 !important;
    }

    .fp-datepicker.fp-dp-mobile .fp-dp-calendar {
        width: 100%;
        min-width: 0;
        gap: 6px;
    }

    .fp-datepicker.fp-dp-mobile .fp-dp-day {
        min-height: 50px;
        padding: 6px 2px;
        font-size: 14px;
    }

    .fp-datepicker.fp-dp-mobile .fp-dp-day-num {
        font-size: 15px;
    }

    .fp-datepicker.fp-dp-mobile .fp-dp-day-price {
        font-size: 10px;
    }

    .fp-datepicker.fp-dp-mobile .fp-dp-header {
        margin-bottom: 14px;
    }

    .fp-datepicker.fp-dp-mobile .fp-dp-title {
        font-size: 16px;
    }

    .fp-datepicker.fp-dp-mobile .fp-dp-footer {
        margin-top: 16px;
        padding-top: 12px;
    }

    .fp-datepicker.fp-dp-mobile .fp-dp-toggle-btn,
    .fp-datepicker.fp-dp-mobile .fp-dp-today-btn,
    .fp-datepicker.fp-dp-mobile .fp-dp-close-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* Dark theme support */
[data-theme="dark"] .fp-datepicker,
.dark .fp-datepicker,
[data-bs-theme="dark"] .fp-datepicker {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .fp-dp-title,
[data-theme="dark"] .fp-dp-nav-btn,
.dark .fp-dp-title,
.dark .fp-dp-nav-btn,
[data-bs-theme="dark"] .fp-dp-title,
[data-bs-theme="dark"] .fp-dp-nav-btn {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .fp-dp-year:hover,
[data-theme="dark"] .fp-dp-month:hover,
[data-theme="dark"] .fp-dp-nav-btn:hover,
.dark .fp-dp-year:hover,
.dark .fp-dp-month:hover,
.dark .fp-dp-nav-btn:hover,
[data-bs-theme="dark"] .fp-dp-year:hover,
[data-bs-theme="dark"] .fp-dp-month:hover,
[data-bs-theme="dark"] .fp-dp-nav-btn:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .fp-dp-weekday,
.dark .fp-dp-weekday,
[data-bs-theme="dark"] .fp-dp-weekday {
    color: #94a3b8 !important;
}

[data-theme="dark"] .fp-dp-day,
.dark .fp-dp-day,
[data-bs-theme="dark"] .fp-dp-day {
    color: #e2e8f0 !important;
    background: #0f172a !important;
}

[data-theme="dark"] .fp-dp-day:hover:not(.fp-dp-disabled):not(.fp-dp-empty),
.dark .fp-dp-day:hover:not(.fp-dp-disabled):not(.fp-dp-empty),
[data-bs-theme="dark"] .fp-dp-day:hover:not(.fp-dp-disabled):not(.fp-dp-empty) {
    background: #334155 !important;
}

[data-theme="dark"] .fp-dp-day.fp-dp-disabled,
.dark .fp-dp-day.fp-dp-disabled,
[data-bs-theme="dark"] .fp-dp-day.fp-dp-disabled {
    color: #475569 !important;
}

[data-theme="dark"] .fp-dp-day.fp-dp-today,
.dark .fp-dp-day.fp-dp-today,
[data-bs-theme="dark"] .fp-dp-day.fp-dp-today {
    background: #0d9488 !important;
    border-color: #0d9488 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .fp-dp-day.fp-dp-selected,
.dark .fp-dp-day.fp-dp-selected,
[data-bs-theme="dark"] .fp-dp-day.fp-dp-selected {
    background: #0284c7 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .fp-dp-footer,
.dark .fp-dp-footer,
[data-bs-theme="dark"] .fp-dp-footer {
    border-top-color: #334155 !important;
}

[data-theme="dark"] .fp-dp-overlay,
.dark .fp-dp-overlay,
[data-bs-theme="dark"] .fp-dp-overlay {
    background: #0f172a !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .fp-dp-grid-item,
[data-theme="dark"] .fp-dp-overlay-btn,
.dark .fp-dp-grid-item,
.dark .fp-dp-overlay-btn,
[data-bs-theme="dark"] .fp-dp-grid-item,
[data-bs-theme="dark"] .fp-dp-overlay-btn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .fp-dp-grid-item:hover,
[data-theme="dark"] .fp-dp-overlay-btn:hover,
.dark .fp-dp-grid-item:hover,
.dark .fp-dp-overlay-btn:hover,
[data-bs-theme="dark"] .fp-dp-grid-item:hover,
[data-bs-theme="dark"] .fp-dp-overlay-btn:hover {
    background: #334155 !important;
    color: #ffffff !important;
}
