/* ============================================================== */
/* INDISTAYNEST BRANDED CALENDAR & DATE PICKER COMPONENT           */
/* ============================================================== */

/* Suppress ugly browser native datepicker indicators */
input[type="date"]::-webkit-calendar-picker-indicator,
input.sndp-input::-webkit-calendar-picker-indicator {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button {
  display: none !important;
}

.sndp-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.sndp-input {
  width: 100%;
  padding-right: 40px !important;
  cursor: pointer !important;
}

.sndp-calendar-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sn-primary, #0f4c47);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s ease;
}

.sndp-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 99998;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sndp-backdrop.active {
  display: block;
  opacity: 1;
}

.sndp-popup {
  position: fixed;
  background: #ffffff;
  border: 1px solid var(--sn-border, #e2e8f0);
  border-radius: 18px;
  box-shadow: 0 20px 45px -8px rgba(15, 23, 42, 0.18), 0 8px 20px -4px rgba(15, 23, 42, 0.08);
  padding: 18px;
  z-index: 99999;
  width: 320px;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  font-family: inherit;
  user-select: none;
  display: none;
  opacity: 0;
  transform: scale(0.96) translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.sndp-popup.active {
  display: block;
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Header */
.sndp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sndp-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sndp-nav-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sndp-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s ease;
  padding: 0;
}

.sndp-nav-btn:hover {
  background: #f0fdf4;
  border-color: #a7f3d0;
  color: #047857;
  transform: scale(1.05);
}

.sndp-nav-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.2;
}

/* Weekday row */
.sndp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* Days grid */
.sndp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.sndp-day {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.14s ease;
  color: #0f172a;
  position: relative;
}

.sndp-day:hover:not(.sndp-disabled):not(.sndp-selected) {
  background: #f0fdf4;
  color: #047857;
}

.sndp-day.sndp-muted {
  color: #cbd5e1;
  font-weight: 500;
}

.sndp-day.sndp-muted:hover:not(.sndp-disabled) {
  background: #f8fafc;
  color: #64748b;
}

.sndp-day.sndp-today:not(.sndp-selected) {
  border: 1.5px solid var(--sn-primary, #0f4c47);
  color: var(--sn-primary, #0f4c47);
  font-weight: 700;
}

.sndp-day.sndp-selected {
  background: var(--sn-primary, #0f4c47) !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(15, 76, 71, 0.32);
}

.sndp-day.sndp-disabled {
  color: #e2e8f0;
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: line-through;
}

/* Footer Action Bar */
.sndp-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  gap: 8px;
}

.sndp-btn-today {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sn-primary, #0f4c47);
  background: #eef7f6;
  border: 1px solid rgba(15, 76, 71, 0.15);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sndp-btn-today:hover {
  background: var(--sn-primary, #0f4c47);
  color: #ffffff;
}

.sndp-btn-clear {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.sndp-btn-clear:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.sndp-btn-done {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  background: var(--sn-primary, #0f4c47);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sndp-btn-done:hover {
  filter: brightness(1.1);
}

/* Mobile responsive bottom sheet */
@media (max-width: 520px) {
  .sndp-popup {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    padding: 24px 20px 32px !important;
    transform: translateY(100%) !important;
    animation: sndpSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  }
  
  .sndp-popup.active {
    transform: translateY(0) !important;
  }
  
  .sndp-day {
    height: 42px;
    font-size: 14px;
  }
}

@keyframes sndpSlideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ============================================================== */
/* INDISTAYNEST BRANDED CUSTOM SELECT / DROPDOWN COMPONENT         */
/* ============================================================== */

.sn-custom-select {
  position: relative;
  display: inline-block;
  width: 100%;
  user-select: none;
  font-family: inherit;
  box-sizing: border-box;
}

.sn-custom-select select.sn-select-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.sn-custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1.5px solid var(--border, var(--sn-border, #cbd5e1));
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, var(--sn-text, #0f172a));
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  box-sizing: border-box;
  outline: none;
  gap: 8px;
}

.sn-custom-select-trigger:hover {
  border-color: var(--sn-primary, var(--primary, #047857));
  background: #fcfdfd;
}

.sn-custom-select.open .sn-custom-select-trigger,
.sn-custom-select-trigger:focus-visible {
  border-color: var(--sn-primary, var(--primary, #047857));
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.15);
  background: #ffffff;
}

.sn-custom-select-value {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 4px;
}

.sn-custom-select-arrow {
  flex-shrink: 0;
  color: var(--sn-primary, var(--primary, #047857));
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sn-custom-select.open .sn-custom-select-arrow {
  transform: rotate(180deg);
}

.sn-custom-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 100%;
  width: max-content;
  max-width: 360px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  z-index: 99999;
  max-height: 260px;
  overflow-y: auto;
  display: none;
  padding: 6px;
  margin: 0;
  box-sizing: border-box;
  animation: snCustomSelectIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.sn-custom-select-menu.open-upward {
  top: auto;
  bottom: calc(100% + 4px);
}

.sn-custom-select.open .sn-custom-select-menu {
  display: block;
}

@keyframes snCustomSelectIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sn-custom-select-menu::-webkit-scrollbar {
  width: 5px;
}

.sn-custom-select-menu::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.sn-custom-select-group-label {
  padding: 8px 12px 4px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted, #64748b);
  border-top: 1px solid #f1f5f9;
  margin-top: 4px;
}

.sn-custom-select-group-label:first-child {
  border-top: none;
  margin-top: 0;
}

.sn-custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #0f172a);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.14s ease;
  user-select: none;
}

.sn-custom-select-option:hover {
  background: #f0fdf4;
  color: #065f46;
  font-weight: 600;
}

.sn-custom-select-option.selected {
  background: #eef7f6;
  color: var(--sn-primary, var(--primary, #0f4c47));
  font-weight: 700;
}

.sn-custom-select-checkmark {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--sn-primary, var(--primary, #0f4c47));
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.15s ease;
  stroke: currentColor;
}

.sn-custom-select-option.selected .sn-custom-select-checkmark {
  opacity: 1;
  transform: scale(1);
  display: inline-block;
}

/* Disabled state */
.sn-custom-select.disabled .sn-custom-select-trigger,
.sn-custom-select-trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* Compact and Filterbar responsive adjustments */
.filterbar .sn-custom-select,
.sn-custom-select.sn-custom-select-compact {
  width: auto;
  display: inline-block;
}

.filterbar .sn-custom-select-trigger,
.sn-custom-select.sn-custom-select-compact .sn-custom-select-trigger {
  min-height: 38px;
  height: 38px;
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 8px;
}
