/* ===============================
   Custom Date Picker Styling
   =============================== */

/* Date Filter Dropdown */
.date-filter-dropdown {
  position: relative;
  min-width: 180px;
}

.date-filter-button {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 16px;
  color: white;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}

.date-filter-button:hover {
  background: rgba(255, 255, 255, 0.05);
}

.date-filter-button i {
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.date-filter-button.active i {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.date-filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  width: 380px;
  max-height: 800px;
  background: rgba(30, 34, 36, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.date-filter-menu.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Quick Options */
.date-quick-options {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.date-quick-options button {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: white;
  font-size: 14px;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.date-quick-options button:hover {
  background: rgba(255, 255, 255, 0.05);
}

.date-quick-options button.active {
  background: linear-gradient(45deg, #ff9966, #ff5e62, #ffc371);
  color: white;
}

/* Custom Date Range */
.date-range-picker {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.date-range-header {
  margin-bottom: 12px;
  padding: 0 4px;
}

.date-range-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: white;
  margin: 0;
  opacity: 0.9;
}

.date-range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.date-input-group {
  position: relative;
}

.date-input-group label {
  display: block;
  font-size: 12px;
  color: white;
  opacity: 0.7;
  margin-bottom: 4px;
}

.date-input-group input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  font-size: 14px;
}

.date-input-group input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Calendar */
.date-calendar {
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 12px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-title {
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.calendar-nav {
  display: flex;
  gap: 8px;
}

.calendar-nav button {
  background: transparent;
  border: none;
  color: white;
  opacity: 0.7;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.calendar-nav button:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-weekday {
  font-size: 12px;
  color: white;
  opacity: 0.7;
  text-align: center;
  padding: 4px;
}

.calendar-day {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-day:hover {
  background: rgba(255, 255, 255, 0.1);
}

.calendar-day.other-month {
  opacity: 0.3;
}

.calendar-day.today {
  background: rgba(0, 255, 153, 0.15);
  border: 1px solid rgba(0, 255, 153, 0.3);
}

.calendar-day.selected {
  background: linear-gradient(45deg, #ff9966, #ff5e62, #ffc371);
  color: white;
}

.calendar-day.in-range {
  background: rgba(255, 153, 102, 0.2);
}

/* Action Buttons */
.date-range-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  background: rgba(30, 34, 36, 0.95);
  border-radius: 0 0 12px 12px;
}

.date-range-actions button {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.date-range-actions .cancel-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.date-range-actions .cancel-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.date-range-actions .apply-btn {
  background: linear-gradient(45deg, #ff9966, #ff5e62, #ffc371);
  color: white;
}

.date-range-actions .apply-btn:hover {
  opacity: 0.9;
}

/* ===============================
   Mobile Responsive Styles
   =============================== */

@media (max-width: 768px) {
  /* Mobile backdrop */
  .date-filter-menu::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }
  
  .date-filter-menu {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    width: calc(100vw - 32px) !important;
    max-width: 350px !important;
    max-height: calc(100vh - 100px) !important;
    transform: translate(-50%, -50%) !important;
    z-index: 9999 !important;
  }
  
  .date-filter-menu.visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, -50%) !important;
  }
  
  /* Stack date inputs vertically on mobile */
  .date-range-inputs {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .date-input-group {
    width: 100%;
  }
  
  /* Make calendar more compact on mobile */
  .calendar-day {
    height: 28px;
    font-size: 12px;
  }
  
  .calendar-weekday {
    font-size: 11px;
    padding: 2px;
  }
  
  /* Adjust action buttons for mobile */
  .date-range-actions {
    padding: 8px 12px;
    gap: 6px;
  }
  
  .date-range-actions button {
    padding: 6px 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .date-filter-menu {
    width: calc(100vw - 16px);
    max-width: none;
  }
  
  /* Even more compact for very small screens */
  .calendar-day {
    height: 24px;
    font-size: 11px;
  }
  
  .date-range-picker {
    padding: 8px;
  }
  
  .date-calendar {
    padding: 8px;
  }
}