/**
 * استایل تقویم شمسی کشویی
 */

/* تقویم شمسی */
.shamsi-calendar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.shamsi-calendar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 20px;
    max-width: 320px;
    width: 90%;
    animation: slideUp 0.3s ease;
    position: relative;
    z-index: 1000000 !important;
}

/* هدر تقویم */
.shamsi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.shamsi-month-year {
    font-size: 1.1rem;
    font-weight: 700;
    color: #667eea;
    display: flex;
    align-items: center;
}

.shamsi-select {
    border: 1px solid #cbd5e0;
    background-color: #fff;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: normal;
    color: #4a5568;
    cursor: pointer;
    padding: 2px 24px 2px 8px; /* Extra padding for arrow */
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5568' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.763L10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 6px center; /* RTL support - arrow on left */
    min-width: 70px;
    height: 30px;
    line-height: 1.5;
}

.shamsi-select:hover {
    border-color: #a0aec0;
    background-color: #f7fafc;
}

.shamsi-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.shamsi-select option {
    background: white;
    color: #333;
    padding: 5px;
}

.shamsi-nav {
    display: flex;
    gap: 8px;
}

.shamsi-nav-btn {
    background: #f8f9fa;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.shamsi-nav-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

/* جدول روزها */
.shamsi-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.shamsi-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    padding: 6px 0;
}

.shamsi-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.shamsi-day {
    aspect-ratio: 1;
    border: none;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.shamsi-day:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.shamsi-day.today {
    background: #17a2b8;
    color: white;
    font-weight: 700;
}

.shamsi-day.selected {
    background: #667eea;
    color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.shamsi-day.other-month {
    opacity: 0.3;
    pointer-events: none;
}

/* دکمه‌های عملیات */
.shamsi-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.shamsi-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.shamsi-btn-primary {
    background: #667eea;
    color: white;
}

.shamsi-btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.shamsi-btn-secondary {
    background: #6c757d;
    color: white;
}

.shamsi-btn-secondary:hover {
    background: #5a6268;
}

/* انیمیشن‌ها */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تم تاریک تقویم */
.shamsi-calendar-overlay[data-theme="dark"] .shamsi-calendar {
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.shamsi-calendar-overlay[data-theme="dark"] .shamsi-month-year {
    color: #ffffff;
}

.shamsi-calendar-overlay[data-theme="dark"] .shamsi-weekday {
    color: #b8b8b8;
}

.shamsi-calendar-overlay[data-theme="dark"] .shamsi-day {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.shamsi-calendar-overlay[data-theme="dark"] .shamsi-day:hover {
    background: #667eea;
}

.shamsi-calendar-overlay[data-theme="dark"] .shamsi-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.shamsi-calendar-overlay[data-theme="dark"] .shamsi-actions {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* ریسپانسیو */
@media (max-width: 480px) {
    .shamsi-calendar {
        max-width: 280px;
        padding: 15px;
    }
    
    .shamsi-day {
        font-size: 0.8rem;
    }
}
