/* DateRangePicker Essential Styles */

/* Global font family for consistent typography */
.date-range-picker {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 10px;
}

/* Standardized popover content styling */
.date-range-picker .popover-content {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  background: white;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 9999;
  width: 440px;
  max-width: 80vw;
}

/* Preset Panel Styles */
.date-range-picker .preset-panel {
  background: #f9fafb;
  border-right: 1px solid #e5e7eb;
  max-height: 60vh;
  overflow-y: auto;
  padding: 12px 8px 8px 8px;
  width: 256px;
}

.date-range-picker .preset-button {
  transition: all 0.2s ease-in-out;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  padding: 8px 12px;
  margin-bottom: 4px;
  color: #374151;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.date-range-picker .preset-button:hover {
  background-color: #f3f4f6;
  transform: translateY(-1px);
}

.date-range-picker .preset-button.selected {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.date-range-picker .preset-button.selected:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* Calendar Panel Styles */
.date-range-picker .calendar-panel {
  background: white;
  padding: 12px;
  min-width: 200px;
  display: flex;
  justify-content: center;
}

/* Calendar Instructions Text */
.date-range-picker .calendar-panel p {
  font-size: 14px;
  color: #6b7280;
  text-align: center;
  margin-bottom: 12px;
}

/* Enhanced Calendar Styling */
.date-range-picker .calendar-panel .rdp {
  --rdp-cell-size: 32px;
  --rdp-accent-color: #3b82f6;
  --rdp-background-color: #f3f4f6;
  --rdp-accent-color-dark: #1d4ed8;
  --rdp-background-color-dark: #e5e7eb;
  --rdp-outline: 2px solid var(--rdp-accent-color);
  --rdp-outline-selected: 2px solid var(--rdp-accent-color);
  margin: 0;
  padding: 8px;
  font-family: inherit;
  font-size: 14px;
}

.date-range-picker .calendar-panel .rdp-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
}

.date-range-picker .calendar-panel .rdp-head_cell {
  font-weight: 600;
  color: #374151;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 4px;
  text-align: center;
}

.date-range-picker .calendar-panel .rdp-button {
  width: var(--rdp-cell-size);
  height: var(--rdp-cell-size);
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #374151;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1px;
}

.date-range-picker .calendar-panel .rdp-button:hover {
  background-color: var(--rdp-background-color);
  border-color: var(--rdp-accent-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.date-range-picker .calendar-panel .rdp-button:focus {
  outline: none;
  border-color: var(--rdp-accent-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.date-range-picker .calendar-panel .rdp-button[aria-selected="true"] {
  background-color: var(--rdp-accent-color);
  color: white;
  border-color: var(--rdp-accent-color);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.date-range-picker .calendar-panel .rdp-button[aria-selected="true"]:hover {
  background-color: var(--rdp-accent-color-dark);
  border-color: var(--rdp-accent-color-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.date-range-picker .calendar-panel .rdp-button[disabled] {
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.5;
}

.date-range-picker .calendar-panel .rdp-button[disabled]:hover {
  background-color: transparent;
  border-color: transparent;
  transform: none;
  box-shadow: none;
}

/* Calendar Modifiers for Date Range Selection */
.date-range-picker .calendar-panel .rdp-button[data-inrange="true"] {
  background-color: #e0e7ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.date-range-picker .calendar-panel .rdp-button[data-start="true"] {
  background-color: #6366f1;
  color: white;
  border-color: #6366f1;
  font-weight: 600;
}

.date-range-picker .calendar-panel .rdp-button[data-end="true"] {
  background-color: #6366f1;
  color: white;
  border-color: #6366f1;
  font-weight: 600;
}

.date-range-picker .calendar-panel .rdp-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}

.date-range-picker .calendar-panel .rdp-nav_button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.date-range-picker .calendar-panel .rdp-nav_button:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
  transform: translateY(-1px);
}

.date-range-picker .calendar-panel .rdp-nav_button:focus {
  outline: none;
  border-color: var(--rdp-accent-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.date-range-picker .calendar-panel .rdp-caption {
  font-weight: 600;
  font-size: 16px;
  color: #111827;
  text-align: center;
  margin: 0;
  padding: 8px 0;
  font-family: inherit;
}

.date-range-picker .calendar-panel .rdp-tbody {
  border-radius: 8px;
  overflow: hidden;
}

.date-range-picker .calendar-panel .rdp-tbody tr:first-child td:first-child {
  border-top-left-radius: 8px;
}

.date-range-picker .calendar-panel .rdp-tbody tr:first-child td:last-child {
  border-top-right-radius: 8px;
}

.date-range-picker .calendar-panel .rdp-tbody tr:last-child td:first-child {
  border-bottom-left-radius: 8px;
}

.date-range-picker .calendar-panel .rdp-tbody tr:last-child td:last-child {
  border-bottom-right-radius: 8px;
}

/* Trigger Button Styles */
.date-range-picker .trigger-button {
  border: 1px solid #d1d5db;
  background: white;
  transition: all 0.2s ease;
}

.date-range-picker .trigger-button:hover {
  border-color: #9ca3af;
  background-color: #f9fafb;
}

.date-range-picker .trigger-button:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Icon Styles */
.date-range-picker .calendar-icon {
  color: #6b7280;
}

.date-range-picker .chevron-icon {
  color: #9ca3af;
  transition: transform 0.2s ease;
}

.date-range-picker .popover-open .chevron-icon {
  transform: rotate(180deg);
}

/* Basic Mobile Responsiveness */
@media (max-width: 768px) {
  .date-range-picker .popover-content {
    width: 95vw;
    max-width: 95vw;
    margin-top: 12px;
    max-height: 70vh;
  }
  
  .date-range-picker .preset-panel {
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    max-height: 50vh;
  }
  
  .date-range-picker .calendar-panel {
    padding-top: 16px;
  }
}

/* Animation Classes */
.date-range-picker .fade-in {
  animation: fadeIn 0.2s ease-in-out;
}

.date-range-picker .slide-up {
  animation: slideUp 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(10px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

