/* Modern Date Picker and Dropdown Styles */
.date-quick-select, 
.duration-quick-select {
  position: relative;
}

/* Date Picker */
.modern-date-picker {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: auto;
  right: 0;
  z-index: 100;
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 300px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

/* Fix for dropdown position on smaller screens (two-row layout) */
@media (max-width: 630px) {
  .date-quick-select, 
  .duration-quick-select {
    position: static; /* Change to static to prevent overflow issue */
  }
  
  .modern-date-picker,
  .modern-dropdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    width: 300px;
    z-index: 1001;
    max-height: 80vh;
    overflow-y: auto;
  }
  
  /* Add backdrop for modal style on mobile */
  .modern-date-picker.visible::before,
  .modern-dropdown.visible::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }
}

.modern-date-picker.visible {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.date-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background-color: var(--primary-color);
  color: white;
}

.date-picker-header button {
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.date-picker-header button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.current-month {
  font-weight: 600;
  font-size: 1rem;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 0;
  font-size: 0.8rem;
  color: var(--text-color-secondary);
  font-weight: 600;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 0.5rem;
}

.calendar-days button {
  background: none;
  border: none;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border-radius: 50%;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-days button:hover {
  background-color: var(--highlight-color);
}

.calendar-days button.today {
  background-color: var(--primary-color);
  color: white;
  font-weight: bold;
}

.calendar-days button.selected {
  background-color: var(--primary-light);
  color: white;
  font-weight: bold;
}

.calendar-days button.prev-month-day,
.calendar-days button.next-month-day {
  color: var(--text-color-tertiary);
  opacity: 0.6;
}

.calendar-days button.past-day {
  color: var(--text-color-tertiary);
  opacity: 0.3;
  cursor: not-allowed;
  background-color: transparent;
}

/* Duration Dropdown */
.modern-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: auto;
  right: 0;
  z-index: 100;
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 300px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.modern-dropdown.visible {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

/* Additional animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes highlightPrompt {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
    color: var(--primary-color);
    transform: scale(1.02);
  }
  100% {
    opacity: 0.5;
  }
}

/* 
 * Note: The main dropdown-option styles are defined in style-buttons.css 
 * These are additional styles specifically for the datepicker dropdowns
 */

/* Make dropdown options more touch-friendly on small screens */
@media (max-width: 630px) {
  .modern-dropdown .dropdown-option {
    padding: 1rem;
    font-size: 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Add a separator between options */
  .modern-dropdown .dropdown-option:not(:last-child) {
    border-bottom: 1px solid var(--border-color-light, rgba(0,0,0,0.1));
  }

  /* More noticeable hover/active state */
  .modern-dropdown .dropdown-option:hover,
  .modern-dropdown .dropdown-option.selected {
    background-color: var(--hover-color);
    color: var(--primary-color);
    font-weight: 500;
  }
}