/**
 * Jalali (Shamsi) Datepicker Modern Luxury Theme
 * Designed for Iranian University & Academic Systems
 */

.jdp-container {
    position: absolute;
    z-index: 99999;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.16), 0 6px 12px -4px rgba(15, 23, 42, 0.08);
    padding: 14px 16px;
    width: 310px;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    direction: rtl;
    text-align: right;
    user-select: none;
    box-sizing: border-box;
    display: none;
    animation: jdpFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.jdp-container * {
    box-sizing: border-box;
}

@keyframes jdpFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header & Controls */
.jdp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.jdp-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    padding: 0;
    line-height: 1;
}

.jdp-nav-btn:hover {
    background: #1e40af;
    color: #ffffff;
    border-color: #1e40af;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.25);
}

.jdp-selectors {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.jdp-select {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    color: #1e293b;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    max-height: 32px;
}

.jdp-select:focus {
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
    background-color: #ffffff;
}

.jdp-month-select {
    flex: 1.1;
}

.jdp-year-select {
    flex: 0.9;
    direction: ltr;
    text-align: center;
}

/* Weekdays */
.jdp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 6px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 6px;
}

.jdp-weekday {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    padding: 2px 0;
}

.jdp-weekday.jdp-friday {
    color: #dc2626;
}

/* Days Grid */
.jdp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    text-align: center;
}

.jdp-day {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.86rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    color: #1e293b;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.jdp-day:hover:not(.jdp-empty):not(.jdp-selected) {
    background-color: #eff6ff;
    color: #1e40af;
    font-weight: 700;
    border-color: #bfdbfe;
}

.jdp-day.jdp-empty {
    cursor: default;
    pointer-events: none;
}

.jdp-day.jdp-friday {
    color: #dc2626;
}

.jdp-day.jdp-today {
    border-color: #2563eb;
    color: #2563eb;
    font-weight: 700;
    background-color: rgba(37, 99, 235, 0.04);
}

.jdp-day.jdp-selected {
    background-color: #1e40af !important;
    color: #ffffff !important;
    font-weight: 700;
    border-color: #1e40af !important;
    box-shadow: 0 3px 8px rgba(30, 64, 175, 0.35);
}

/* Footer & Action Buttons */
.jdp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.jdp-btn-action {
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.jdp-btn-today {
    color: #1e40af;
}

.jdp-btn-today:hover {
    background-color: #eff6ff;
}

.jdp-btn-clear {
    color: #dc2626;
}

.jdp-btn-clear:hover {
    background-color: #fef2f2;
}

.jdp-btn-close {
    color: #64748b;
    background-color: #f1f5f9;
}

.jdp-btn-close:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

/* Input group integration */
.input-group > .jalali-datepicker {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > [data-jdp-toggle] {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

