/**
 * Event Date Picker Widget Styles
 * All classes prefixed with .edp- for scoping
 */

/* Container */
.edp-container {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #1a1a2e;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  max-width: 100%;
}

/* Dropdown Panel - hidden by default with animation */
.edp-dropdown {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  max-height: 0;
  overflow: hidden;
}

.edp-container.edp-open .edp-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  max-height: 1000px;
  overflow: visible;
}

/* Sherlock Input Section */
.edp-input-section {
  position: relative;
}

.edp-parse-preview {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border: 1px solid #81c784;
  border-radius: 8px;
  font-size: 13px;
  color: #2e7d32;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out, visibility 0.2s;
}

.edp-parse-preview.edp-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.edp-parse-preview.edp-error {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  border-color: #ffb74d;
  color: #e65100;
}

.edp-parse-icon {
  margin-right: 8px;
  font-size: 16px;
}

.edp-parse-text {
  flex: 1;
}

.edp-parse-confirm {
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.2s;
}

.edp-parse-confirm:hover {
  background: #43a047;
}

.edp-input-wrapper {
  position: relative;
}

.edp-text-input {
  width: 100%;
  padding: 12px 44px 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  cursor: pointer;
}

.edp-text-input:focus,
.edp-container.edp-open .edp-text-input {
  outline: none;
  border-color: #5c6bc0;
  box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.15);
  cursor: text;
  padding-right: 70px; /* Make room for Done button */
}

/* Selection hint shown below input when dropdown is closed */
.edp-selection-hint {
  font-size: 13px;
  color: #5c6bc0;
  padding: 4px 2px;
  min-height: 1em;
}

.edp-selection-hint:empty {
  display: none;
}

.edp-selection-hint.edp-has-selection {
  display: block;
}

/* Hide selection hint when dropdown is open */
.edp-container.edp-open .edp-selection-hint {
  display: none;
}

.edp-text-input::placeholder {
  color: #9e9e9e;
}

.edp-input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9e9e9e;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* Hide icon when dropdown is open */
.edp-container.edp-open .edp-input-icon {
  opacity: 0;
}

/* Done button inside input */
.edp-done-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 14px;
  background: #5c6bc0;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, background 0.2s;
}

.edp-done-btn:hover {
  background: #3f51b5;
}

.edp-container.edp-open .edp-done-btn {
  opacity: 1;
  visibility: visible;
}

/* Quick Shortcuts */
.edp-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.edp-shortcut {
  padding: 8px 14px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #424242;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.edp-shortcut:hover {
  background: #eeeeee;
  border-color: #bdbdbd;
  transform: translateY(-1px);
}

.edp-shortcut:active {
  transform: translateY(0);
}

.edp-shortcut.edp-active {
  background: linear-gradient(135deg, #5c6bc0 0%, #3f51b5 100%);
  color: white;
  border-color: #3f51b5;
}

/* Calendar Navigation */
.edp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.edp-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  color: #616161;
  transition: all 0.2s;
}

.edp-nav-btn:hover {
  background: #eeeeee;
  color: #1a1a2e;
}

.edp-nav-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.edp-month-select,
.edp-year-select {
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  cursor: pointer;
  color: #1a1a2e;
}

.edp-month-select {
  min-width: 120px; /* Wide enough for "September" */
}

.edp-month-select:focus,
.edp-year-select:focus {
  outline: none;
  border-color: #5c6bc0;
}

.edp-clear-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid #ef5350;
  border-radius: 8px;
  color: #ef5350;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.edp-clear-btn:hover {
  background: #ef5350;
  color: white;
}

/* Calendar Grid */
.edp-calendars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .edp-calendars {
    grid-template-columns: 1fr;
  }
}

.edp-calendar {
  background: #fafafa;
  border-radius: 10px;
  padding: 12px;
}

.edp-calendar-title {
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: #424242;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eeeeee;
}

.edp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}

.edp-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #9e9e9e;
  text-transform: uppercase;
  padding: 4px;
}

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

.edp-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  background: transparent;
  color: #424242;
}

.edp-day:hover:not(.edp-other-month) {
  background: #e8eaf6;
}

.edp-day.edp-other-month {
  color: #bdbdbd;
}

.edp-day.edp-empty {
  cursor: default;
  pointer-events: none;
  background: transparent;
}

.edp-day.edp-today {
  font-weight: 700;
  color: #5c6bc0;
}

.edp-day.edp-today::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: #5c6bc0;
  border-radius: 50%;
}

.edp-day.edp-selected {
  background: linear-gradient(135deg, #5c6bc0 0%, #3f51b5 100%);
  color: white;
  font-weight: 500;
}

.edp-day.edp-selected.edp-today::after {
  background: white;
}

.edp-day.edp-in-range {
  background: #e8eaf6;
}

.edp-day.edp-range-start,
.edp-day.edp-range-end {
  background: linear-gradient(135deg, #7986cb 0%, #5c6bc0 100%);
  color: white;
}

.edp-day.edp-dragging {
  background: #c5cae9;
}

.edp-day.edp-deselecting {
  background: #ffcdd2;
  text-decoration: line-through;
  opacity: 0.7;
}

.edp-day.edp-weekend {
  color: #e57373;
}

.edp-day.edp-weekend.edp-selected {
  color: white;
}

.edp-day.edp-past {
  opacity: 0.5;
}

/* Selection Summary */
.edp-summary {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  font-size: 13px;
  color: #757575;
}

.edp-summary-label {
  font-weight: 600;
  color: #424242;
  margin-right: 8px;
}

.edp-summary-dates {
  display: inline;
}

.edp-summary-date {
  display: inline-block;
  background: #e8eaf6;
  color: #3f51b5;
  padding: 3px 8px;
  border-radius: 4px;
  margin: 2px 4px 2px 0;
  font-size: 12px;
}


