/* ============================================
   دیتاپیکر شمسی ونوس - نسخه بهینه برای سیت‌لند
   طراحی مدرن، واکنش‌گرا و هماهنگ با فرم
   ============================================ */

/* ============================================
   کانتینر اصلی
   ============================================ */
.venus-datepicker-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
}

.venus-datepicker-wrap input {
    padding-left: 44px !important;
    cursor: pointer;
    width: 100%;
    background: #f8f9fa !important;
    border: 2px solid #eee !important;
    border-radius: 8px !important;
    color: #1a1a1a !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.3s !important;
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.venus-datepicker-wrap input:focus {
    border-color: #FFC50C !important;
    box-shadow: 0 0 0 4px rgba(255, 197, 12, 0.15) !important;
    outline: none !important;
    background: #fff !important;
}

.venus-datepicker-wrap input::placeholder {
    color: #bbb;
}

/* ============================================
   آیکون تقویم
   ============================================ */
.vdp-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6366f1;
    font-size: 20px;
    z-index: 5;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.venus-datepicker-wrap:hover .vdp-icon {
    opacity: 1;
}

/* ============================================
   پنل دیتاپیکر - طراحی مدرن
   ============================================ */
.vdp-panel {
    display: none;
    position: fixed;
    width: 360px;
    max-width: calc(100vw - 20px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 100000;
    direction: rtl;
    padding: 0;
    margin: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: 'Estedad', 'Vazir', Tahoma, sans-serif !important;
    transform-origin: top center;
    animation: vdpSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes vdpSlideIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.vdp-panel.open {
    display: flex !important;
}

/* ============================================
   هدر
   ============================================ */
.vdp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    background: #fafbfc;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 16px 16px 0 0;
    gap: 4px;
    flex-shrink: 0;
}

.vdp-nav {
    background: transparent;
    border: 1px solid transparent;
    color: #888;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s;
    font-weight: 700;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    font-family: 'Estedad', sans-serif;
}

.vdp-nav:hover {
    background: rgba(255, 197, 12, 0.1);
    color: #FFC50C;
    border-color: rgba(255, 197, 12, 0.2);
}

.vdp-nav:active {
    transform: scale(0.92);
    background: rgba(255, 197, 12, 0.2);
}

.vdp-title {
    flex: 1;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
}

.vdp-month-year {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
}

/* ============================================
   روزهای هفته
   ============================================ */
.vdp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 8px 12px 4px;
    text-align: center;
    flex-shrink: 0;
}

.vdp-weekdays span {
    color: #888;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 0;
}

.vdp-weekdays span:last-child {
    color: #f59e0b;
}

/* ============================================
   روزهای ماه
   ============================================ */
.vdp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 4px 10px 8px;
    flex: 1;
    min-height: 175px;
    max-height: 200px;
    align-content: start;
}

.vdp-day {
    position: relative;
    padding: 6px 0;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s;
    user-select: none;
    -webkit-user-select: none;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Estedad', sans-serif;
}

.vdp-day:not(.vdp-other-month):not(.vdp-disabled):hover {
    background: rgba(255, 197, 12, 0.12);
    color: #FFC50C;
    transform: translateY(-1px);
}

.vdp-day:not(.vdp-other-month):not(.vdp-disabled):active {
    transform: scale(0.92);
}

.vdp-day.vdp-other-month {
    color: #ccc;
    font-weight: 300;
}

.vdp-day.vdp-other-month:hover {
    color: #aaa;
    background: rgba(0, 0, 0, 0.03);
}

.vdp-day.vdp-today {
    color: #6366f1 !important;
    font-weight: 700 !important;
    background: rgba(99, 102, 241, 0.08) !important;
    border: 2px solid #6366f1 !important;
}

.vdp-day.vdp-today::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: #6366f1;
    border-radius: 50%;
}

.vdp-day.vdp-selected {
    background: linear-gradient(135deg, #FFC50C, #f59e0b) !important;
    color: #1a1a1a !important;
    font-weight: 700;
    box-shadow: 0 4px 12px -4px rgba(255, 197, 12, 0.4);
}

.vdp-day.vdp-friday {
    color: #f59e0b;
}

.vdp-day.vdp-holiday {
    color: #ef4444;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.06);
}

.vdp-day.vdp-holiday:not(.vdp-other-month):hover {
    background: rgba(239, 68, 68, 0.12);
}

.vdp-day.vdp-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   فوتر
   ============================================ */
.vdp-footer {
    display: flex;
    gap: 8px;
    padding: 6px 12px 12px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.vdp-footer button {
    flex: 1;
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s;
    font-family: 'Estedad', 'Vazir', Tahoma, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

.vdp-today {
    background: #f8f9fa;
    color: #555;
    border: 1px solid #eee;
}

.vdp-today:hover {
    background: #f0f0f0;
    color: #1a1a1a;
    transform: translateY(-1px);
}

.vdp-today:active {
    transform: scale(0.96);
}

.vdp-close {
    background: #FFC50C;
    color: #1a1a1a;
}

.vdp-close:hover {
    background: #E6B100;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px -4px rgba(255, 197, 12, 0.4);
}

.vdp-close:active {
    transform: scale(0.96);
}

/* ============================================
   راهنما
   ============================================ */
.vdp-legend {
    display: flex;
    gap: 14px;
    padding: 2px 12px 6px;
    justify-content: center;
    flex-shrink: 0;
    border-bottom: 1px solid #f5f5f5;
}

.vdp-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #888;
}

.vdp-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.vdp-dot-holiday {
    background: #ef4444;
}

.vdp-dot-friday {
    background: #f59e0b;
}

.vdp-dot-today {
    background: #6366f1;
}

/* ============================================
   واکنش‌گرایی (Responsive)
   ============================================ */
@media(max-width: 420px) {
    .vdp-panel {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        border-radius: 12px;
    }
    
    .vdp-nav {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .vdp-day {
        height: 28px;
        min-height: 28px;
        max-height: 28px;
        font-size: 13px;
        padding: 4px 0;
    }
    
    .vdp-days {
        min-height: 155px;
        max-height: 175px;
        padding: 2px 6px 4px;
        gap: 1px;
    }
    
    .vdp-header {
        padding: 10px 10px 8px;
    }
    
    .vdp-footer {
        padding: 4px 10px 10px;
    }
    
    .vdp-footer button {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .vdp-month-year {
        font-size: 13px;
    }
    
    .vdp-weekdays {
        padding: 4px 8px 2px;
    }
}

@media(max-width: 380px) {
    .vdp-panel {
        width: calc(100vw - 12px);
        max-width: calc(100vw - 12px);
        border-radius: 10px;
    }
    
    .vdp-day {
        height: 26px;
        min-height: 26px;
        max-height: 26px;
        font-size: 12px;
    }
    
    .vdp-days {
        min-height: 140px;
        max-height: 160px;
    }
    
    .vdp-nav {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
}

/* ============================================
   جلوگیری از انتخاب متن
   ============================================ */
.vdp-panel,
.vdp-panel * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ============================================
   پشتیبانی از دارک مود (اختیاری)
   ============================================ */
@media (prefers-color-scheme: dark) {
    .vdp-panel {
        background: #1a1a2e;
        border-color: rgba(255, 255, 255, 0.06);
    }
    
    .vdp-header {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.06);
    }
    
    .vdp-month-year {
        color: #eee;
    }
    
    .vdp-day:not(.vdp-other-month):not(.vdp-disabled) {
        color: #ddd;
    }
    
    .vdp-day.vdp-other-month {
        color: #555;
    }
    
    .vdp-day.vdp-today {
        background: rgba(99, 102, 241, 0.15) !important;
    }
    
    .vdp-day.vdp-selected {
        background: linear-gradient(135deg, #FFC50C, #f59e0b) !important;
        color: #1a1a1a !important;
    }
    
    .vdp-day.vdp-holiday {
        color: #ef4444;
        background: rgba(239, 68, 68, 0.08);
    }
    
    .vdp-weekdays span {
        color: #888;
    }
    
    .vdp-footer {
        border-color: rgba(255, 255, 255, 0.06);
    }
    
    .vdp-today {
        background: rgba(255, 255, 255, 0.06);
        color: #aaa;
        border-color: rgba(255, 255, 255, 0.06);
    }
    
    .vdp-today:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    .vdp-legend {
        border-color: rgba(255, 255, 255, 0.06);
    }
    
    .vdp-legend-item {
        color: #888;
    }
    
    .vdp-close {
        background: #FFC50C;
        color: #1a1a1a;
    }
}

/* ============================================
   مخفی کردن اسکرول‌بار
   ============================================ */
.vdp-days::-webkit-scrollbar {
    width: 0;
    height: 0;
}
.vdp-days {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* ============================================
   انیمیشن ورود
   ============================================ */
@keyframes vdpFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.vdp-panel.open {
    animation: vdpFadeIn 0.2s ease-out;
}

/* ============================================
   حالت دیسپلی (برای تب‌ها)
   ============================================ */
.vdp-panel.vdp-in-tab {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin-top: 4px;
    animation: vdpFadeIn 0.2s ease-out;
}

/* ============================================
   دسترسی‌پذیری
   ============================================ */
.vdp-nav:focus-visible,
.vdp-today:focus-visible,
.vdp-close:focus-visible,
.vdp-day:focus-visible {
    outline: 2px solid #FFC50C;
    outline-offset: 2px;
}