/**
 * MediTON Slot Controller – UI Styles
 */

/* === Visually Hidden Select === */
.amparex-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* === Slot Buttons Container === */
.amparex-slot-wrap {
  position: relative;
  margin-top: 8px;
}

.amparex-slot-wrap.is-loading .amparex-slot-buttons {
  opacity: 0.4;
  pointer-events: none;
}

.amparex-slot-wrap.is-loading .amparex-slot-hint::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: amparex-spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes amparex-spin {
  to { transform: rotate(360deg); }
}

/* === Slot Buttons Grid === */
.amparex-slot-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* === Individual Slot Button === */
.amparex-slot-btn {
  padding: 10px 18px;
  border: 1px solid #c5c5c5;
  border-radius: 5px;
  background: #f6f6f6;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.amparex-slot-btn:hover:not(:disabled) {
  background: #ededed;
  border-color: #999;
}

.amparex-slot-btn.is-active {
  background: #9ccd00;
  color: #fff;
  border-color: #286b04;
}

.amparex-slot-btn.is-past {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}

.amparex-slot-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === Slot Hint / Error === */
.amparex-slot-hint {
  font-size: 14px;
  color: #666;
  margin-top: 6px;
}

.amparex-slot-hint.is-error {
  color: #c00;
  font-weight: 600;
}

/* === Date Icon Button === */
.amparex-date-icon-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 28px;
  padding: 0;
  z-index: 2;
}

.amparex-date-icon-btn svg {
  width: 100%;
  height: 100%;
  color: #666;
}

.amparex-date-icon-btn:hover svg {
  color: #333;
}

/* === Inline Calendar Container === */
.amparex-inline-calendar {
  margin-top: 12px;
  overflow: hidden;
  max-height: 500px;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.35s ease;
}

.amparex-inline-calendar.is-collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.amparex-inline-calendar .flatpickr-calendar {
  box-shadow: none;
  border: 1px solid #ddd;
  border-radius: 6px;
}

/* === Date Message === */
.amparex-date-message {
  display: none;
  font-size: 14px;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 4px;
}

.amparex-date-message.is-visible {
  display: block;
}

.amparex-date-message.is-error {
  background: #fef0f0;
  color: #c00;
  border: 1px solid #fcc;
}

/* === Quick-Day Buttons === */
.amparex-quickday-wrap {
  margin-top: 10px;
  margin-bottom: 6px;
  overflow: hidden;
  max-height: 800px;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.35s ease;
}

.amparex-quickday-wrap.is-collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  pointer-events: none;
}

.amparex-quickday-hint {
  font-size: 14px;
  color: #666;
  margin-bottom: 6px;
}

.amparex-quickday-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.amparex-day-btn {
  padding: 10px 18px;
  border: 1px solid #c5c5c5;
  border-radius: 5px;
  background: #f6f6f6;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.amparex-day-btn:hover {
  background: #ededed;
  border-color: #999;
}

.amparex-day-btn.is-active {
  background: #9ccd00;
  color: #fff;
  border-color: #286b04;
}

/* === Calendar Toggle Button === */
.amparex-calendar-toggle {
  display: inline-block;
  margin-top: 8px;
  margin-bottom: 4px;
  padding: 6px 14px;
  background: none;
  border: 1px solid #c5c5c5;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.amparex-calendar-toggle:hover {
  color: #333;
  border-color: #999;
}

/* === Dayintime Accordion === */
.amparex-dit-wrap {
  margin-top: 10px;
}

.amparex-dit-day {
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 6px;
  overflow: hidden;
}

/* --- Day Header (klickbar) --- */
.amparex-dit-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #f8f8f8;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  transition: background 0.15s ease, color 0.15s ease;
}

.amparex-dit-day-header:hover {
  background: #f0f0f0;
}

/* Chevron */
.amparex-dit-day-header::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid #666;
  border-bottom: 2px solid #666;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 12px;
}

.amparex-dit-day.is-open .amparex-dit-day-header {
  background: #9ccd00;
  color: #fff;
}

.amparex-dit-day.is-open .amparex-dit-day-header::after {
  transform: rotate(-135deg);
  border-color: #fff;
}

/* --- Day Body (Slots-Container) --- */
.amparex-dit-day-body {
  display: none;
  padding: 12px 18px 16px;
}

.amparex-dit-day.is-open .amparex-dit-day-body {
  display: block;
}

/* --- Slot Grid --- */
.amparex-dit-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* --- Individual Slot Button (EIGENE Klasse) --- */
.amparex-dit-slot {
  padding: 8px 14px;
  border: 1px solid #c5c5c5;
  border-radius: 5px;
  background: #f6f6f6;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.amparex-dit-slot:hover {
  background: #ededed;
  border-color: #999;
}

.amparex-dit-slot.is-active {
  background: #9ccd00;
  color: #fff;
  border-color: #286b04;
}

.amparex-dit-slot.is-hidden-more {
  display: none;
}

/* --- Loader --- */
.amparex-dit-loader {
  font-size: 14px;
  color: #666;
  padding: 8px 0;
}

.amparex-dit-loader::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: amparex-spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

/* --- Empty Message --- */
.amparex-dit-empty {
  font-size: 14px;
  color: #999;
  padding: 8px 0;
}

/* --- MEHR Button --- */
.amparex-dit-more {
  display: block;
  margin-top: 10px;
  padding: 8px 20px;
  background: none;
  border: 1px solid #c5c5c5;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.amparex-dit-more:hover {
  color: #333;
  border-color: #999;
}

/* --- WEITERE DATEN Button --- */
.amparex-dit-load-more {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.amparex-dit-load-more:hover {
  background: #eee;
  color: #333;
}
