/* Persian (Jalali) Datepicker Styles - Bafco */
.pdatepicker-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.pdatepicker-popup {
    position: absolute;
    z-index: 999999;
    top: 100%;
    right: 0;
    margin-top: 6px;
    width: 290px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    direction: rtl;
    user-select: none;
    overflow: hidden;
    animation: pdatepicker-fade 0.15s ease-out;
}

[data-theme="dark"] .pdatepicker-popup {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

@keyframes pdatepicker-fade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.pdatepicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

[data-theme="dark"] .pdatepicker-header {
    background: #0f172a;
    border-color: #334155;
}

.pdatepicker-title {
    display: flex;
    gap: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
}

[data-theme="dark"] .pdatepicker-title {
    color: #f8fafc;
}

.pdatepicker-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.pdatepicker-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme="dark"] .pdatepicker-btn:hover {
    background: #334155;
    color: #f8fafc;
}

.pdatepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    padding: 8px 10px 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
}

.pdatepicker-weekdays span.holiday {
    color: #ef4444;
}

.pdatepicker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 6px 10px 10px;
}

.pdatepicker-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    color: #334155;
    transition: all 0.12s ease;
}

[data-theme="dark"] .pdatepicker-cell {
    color: #cbd5e1;
}

.pdatepicker-cell:hover:not(:disabled) {
    background: #fee2e2;
    color: #b91c1c;
}

[data-theme="dark"] .pdatepicker-cell:hover:not(:disabled) {
    background: #3730a3;
    color: #ffffff;
}

.pdatepicker-cell.empty {
    cursor: default;
    pointer-events: none;
}

.pdatepicker-cell.today {
    border: 1px solid #ef4444;
    color: #dc2626;
    font-weight: 700;
}

.pdatepicker-cell.selected {
    background: #dc2626 !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
}

.pdatepicker-cell.holiday {
    color: #ef4444;
}

.pdatepicker-cell:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pdatepicker-footer {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
}

[data-theme="dark"] .pdatepicker-footer {
    background: #0f172a;
    border-color: #334155;
}

.pdatepicker-footer-btn {
    border: none;
    background: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: #dc2626;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.pdatepicker-footer-btn:hover {
    background: #fee2e2;
}

[data-theme="dark"] .pdatepicker-footer-btn:hover {
    background: rgba(220, 38, 38, 0.2);
}

.pdatepicker-footer-btn.clear {
    color: #64748b;
}

.pdatepicker-footer-btn.clear:hover {
    background: #e2e8f0;
}

[data-theme="dark"] .pdatepicker-footer-btn.clear:hover {
    background: #334155;
}

.pdatepicker-input-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 1rem;
}
