.date-picker {
  position: fixed;
  /*background: #ffffff;*/
  border: 6px solid rgba(255, 255, 255, 0.9);
  width: 360px; /* wide enough so month names do not clip */
  padding: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  z-index: 9999;
  isolation: isolate;

  border-radius: 14px;

  transform: translateY(-16px) scale(0.2);
  
  color: black;
  opacity: 0;

  pointer-events: none !important;
  visibility: hidden;

}

.date-picker.inline {
  margin-top: 0 !important;
  transform: none !important;
}

.date-picker.inline::before,
.date-picker.inline::after {
  display: none !important;
  content: none !important;
}

.date-picker.inline .date-picker-arrow {
  display: none !important;
}

/* Mobile backdrop overlay */
.date-picker-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* Visible state */
.date-picker-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Picker must be above backdrop */
.date-picker {
  z-index: 9999;
}

/* Mobile modal centering */
.date-picker.mobile-center {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;

  transform: translate(-50%, -50%) !important;
  transition: opacity 0.25s ease !important;
}

/* Prevent transform animation on open (mobile only) */
.date-picker.mobile-center.open {
  transform: translate(-50%, -50%) !important;
}

.date-picker.open {
  opacity: 1;
  
  pointer-events: auto !important;
  visibility: visible;

  transform: translateY(16px) scale(1);
  transition: transform 0.25s ease, opacity 0.25s ease;

  background-color: rgba(255, 255, 255, 0.3);
  filter: drop-shadow(2px 2px 4px #000);
  backdrop-filter: saturate(180%) blur(20px);
}

.date-picker.open * {
  pointer-events: auto !important;
}

.date-picker.above {
  transform: translateY(8px);
}

.date-picker::before {
  content: "";
  position: absolute;
  top: -12px;
  left: var(--arrow-left, 50%);
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 12px solid rgba(255, 255, 255, 0.9);
}

.date-picker.below::before {
  top: -16px;
  border-bottom: 16px solid rgba(255, 255, 255, 0.9); /* outer */
}

.date-picker.below::after {
  content: "";
  position: absolute;
  top: -12px;
  left: var(--arrow-left, 50%);
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 12px solid rgba(255, 255, 255, 0.9); /* inner */
  display: none; /* not on display as it looks a bit shit */
}

.date-picker.above::before {
  bottom: -16px;
  border-top: 16px solid rgba(255, 255, 255, 0.9);
}

.date-picker.above::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: var(--arrow-left, 20px);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 12px solid rgba(255, 255, 255, 0.9);
}

/* Header controls (kept stable, no wrap) */
.date-picker header {
  /*display: grid;*/
  /*grid-template-columns: 38px 1fr 1fr 38px;*/
  display: flex;
  flex-wrap: wrap;
  /*gap: 10px;*/
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.date-picker header button {
  width: 38px;
  height: 38px;
  border: 1px solid #d0d0d0;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.date-picker header select {
  height: 38px;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 0 12px;
  font-size: 16px;
  font-weight: 700;
  width: fit-content;;
  min-width: 0;
  overflow: visible;
  text-align: center;
}

.date-picker header select:hover {
  cursor: pointer;
}

/* Table locked into 7 columns */
.date-picker table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;

  border-radius: 10px;

  background: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(2px 2px 4px rgba(255, 255, 255, 0.9));
  backdrop-filter: saturate(180%) blur(20px);
}

/* Solid green weekday header */
.date-picker thead tr {
  background: rgba(0, 0, 0, 0.3);
  filter: drop-shadow(2px 2px 4px #000);
  /*backdrop-filter: saturate(180%) blur(20px);*/
}

.date-picker th {
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  padding: 10px 0;
  text-align: center;
}

/* Day cells */
.date-picker td {
  width: 14.2857%;
  height: 46px; /* fixed diameter-friendly */
  text-align: center;
  vertical-align: middle;
  font-size: 16px;
  font-weight: 700;
  border-top: 1px solid #f0f0f0;
  cursor: pointer;
  user-select: none;
  position: relative;
}

/* Perfect filled circles (fixed diameter) */
.date-picker td .day-dot {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

/* Hover circle (green filled) */
.date-picker td:not(.disabled):hover .day-dot {
  background: #00ca00;
  color: rgba(255, 255, 255, 0.9);
}

/* Today circle (yellow filled) */
.date-picker td.today .day-dot {
  background: #ffd400;
  color: #111111;
}

/* Selected circle (red filled) - MUST WIN */
.date-picker td.selected .day-dot {
  background: #ff0000;
  color: rgba(255, 255, 255, 0.9);
}

/* Ensure selected wins even on hover */
.date-picker td.selected:hover .day-dot {
  background: #ff0000;
  color: rgba(255, 255, 255, 0.9);
}

/* Disabled styling: red + strike-through, no hover, no pointer */
.date-picker td.disabled {
  cursor: not-allowed;
  color: #ff0000;
}

.date-picker td.disabled .day-dot {
  background: transparent;
  color: #ff0000;
  text-decoration: line-through;
}

.date-picker td.disabled:hover .day-dot {
  background: transparent;
  color: #ff0000;
}

/* Rounded corners for header strip */
.date-picker thead th:first-child {
  border-top-left-radius: 10px;
}

.date-picker thead th:last-child {
  border-top-right-radius: 10px;
}

@media (hover: none) {
  .date-picker td:hover {
    background: none;
  }
}

