/* rf_jalali_datepicker styles (compact and elegant) */
.rf-jalali-picker {
  direction: rtl;
  font-family: Vazirmatn, "Tahoma", "Helvetica", sans-serif;
  position: absolute;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 8px 24px rgba(10,20,30,0.15);
  border-radius: 10px;
  padding: 10px;
  width: 300px;
  max-width: 90vw;
  z-index: 999999;
  animation: rf-jp-fadeIn 0.15s ease-out;
}

@keyframes rf-jp-fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.rf-jp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f0;
}

.rf-jp-header .rf-jp-title {
  font-weight: 600;
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  flex: 1;
  justify-content: center;
}

.rf-jp-year-container,
.rf-jp-month-container {
  position: relative;
  display: inline-block;
}

.rf-jp-header select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #e6eef6;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 70px;
  max-height: 32px;
}

.rf-jp-header select.rf-jp-year-select {
  max-height: 150px;
  overflow-y: auto;
}

.rf-jp-header select.rf-jp-year-select option {
  padding: 4px 6px;
  font-size: 11px;
}

.rf-jp-header select:hover {
  border-color: #c7e0fd;
}

.rf-jp-header select:focus {
  outline: none;
  border-color: #2196f3;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.rf-jp-header button {
  border: none;
  background: #f8f9fa;
  font-size: 16px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 5px;
  transition: all 0.2s ease;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
}

.rf-jp-header button:hover {
  background: #e9ecef;
  color: #2196f3;
}

.rf-jp-header button:active {
  background: #dee2e6;
  transform: scale(0.95);
}

.rf-jp-calendar-container {
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 6px;
  scrollbar-width: thin;
  scrollbar-color: #c7e0fd #f8f9fa;
}

.rf-jp-calendar-container::-webkit-scrollbar {
  width: 4px;
}

.rf-jp-calendar-container::-webkit-scrollbar-track {
  background: #f8f9fa;
  border-radius: 2px;
}

.rf-jp-calendar-container::-webkit-scrollbar-thumb {
  background: #c7e0fd;
  border-radius: 2px;
}

.rf-jp-calendar-container::-webkit-scrollbar-thumb:hover {
  background: #a0c8ff;
}

.rf-jp-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 12px;
}

.rf-jp-table thead {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  box-shadow: 0 1px 0 #f0f0f0;
}

.rf-jp-table thead th {
  font-weight: 700;
  padding: 8px 2px;
  color: #0b3b5a;
  font-size: 11px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.rf-jp-table td {
  padding: 8px 4px;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.15s ease;
  position: relative;
  border: 1px solid transparent;
  height: 28px;
}

.rf-jp-table td.rf-jp-empty {
  background: transparent;
  cursor: default;
  border: none;
}

.rf-jp-table td.rf-jp-day {
  user-select: none;
  font-weight: 500;
  color: #333;
  background: #fff;
}

.rf-jp-table td.rf-jp-day:hover {
  background: #e3f2fd;
  color: #1976d2;
  transform: scale(1.03);
  border-color: #bbdefb;
}

.rf-jp-table td.rf-jp-day:active {
  transform: scale(0.97);
}

.rf-jp-table td.rf-jp-day:focus {
  outline: none;
  background: #2196f3;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.3);
}

/* Today highlight */
.rf-jp-table td.rf-jp-today {
  background: #fff3e0;
  color: #f57c00;
  font-weight: 600;
  border: 1px solid #ffb74d;
}

.rf-jp-table td.rf-jp-today:hover {
  background: #ffe0b2;
  color: #e65100;
}

/* Selected day */
.rf-jp-table td.rf-jp-selected {
  background: #2196f3;
  color: #fff;
  font-weight: 600;
}

/* Disabled days */
.rf-jp-table td.rf-jp-disabled {
  color: #ccc;
  cursor: not-allowed;
  background: #f9f9f9;
}

.rf-jp-table td.rf-jp-disabled:hover {
  background: #f9f9f9;
  color: #ccc;
  transform: none;
}

/* Responsive design */
@media (max-width: 480px) {
  .rf-jalali-picker {
    width: 280px;
    padding: 8px;
  }
  
  .rf-jp-header {
    gap: 6px;
  }
  
  .rf-jp-header select {
    padding: 5px 6px;
    font-size: 11px;
    min-width: 60px;
  }
  
  .rf-jp-header button {
    padding: 5px 6px;
    min-width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  .rf-jp-table td {
    padding: 6px 3px;
    font-size: 11px;
    height: 26px;
  }
  
  .rf-jp-calendar-container {
    max-height: 220px;
  }
}

/* Custom scrollbar for year select */
.rf-jp-year-select::-webkit-scrollbar {
  width: 6px;
}

.rf-jp-year-select::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.rf-jp-year-select::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.rf-jp-year-select::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .rf-jalali-picker {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }
  
  .rf-jp-header select {
    background: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
  }
  
  .rf-jp-table thead th {
    background: #4a5568;
    color: #e2e8f0;
  }
  
  .rf-jp-table td.rf-jp-day {
    color: #e2e8f0;
    background: #2d3748;
  }
}