/* DVC Monitor — Custom styles (Tailwind CDN handles the rest) */

/* System font stack */
html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom select styling — Tailwind CDN can't do appearance:none reliably */
.input-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  padding-right: 2rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Month multi-select button */
.month-btn {
  width: 100%;
  padding: 0.5rem 0.75rem;
  padding-right: 2rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  outline: none;
  text-align: left;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  color: #111827;
}
.month-btn:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.month-btn.placeholder {
  color: #9ca3af;
}

/* Calendar day cells */
.cal-day {
  min-height: 4.5rem;
  padding: 0.375rem;
  border-radius: 0.5rem;
  border: 1px solid #f3f4f6;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
}
.cal-day.available {
  border-left: 3px solid #10b981;
  background: #f0fdf4;
  cursor: pointer;
}
.cal-day.available:hover {
  background: #dcfce7;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.cal-day.unavailable {
  background: #fafafa;
  opacity: 0.5;
}
.cal-day.empty {
  border: none;
  background: transparent;
  min-height: 0;
}

/* Auth pulse animation */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.pulse-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner-sm {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Bottom sheet modal for mobile */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
  }
}
.modal-sheet {
  background: white;
  width: 100%;
  max-width: 28rem;
  border-radius: 1rem 1rem 0 0;
  padding: 1.5rem;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(0);
  transition: transform 0.2s ease;
}
@media (min-width: 640px) {
  .modal-sheet {
    border-radius: 1rem;
  }
}

/* ========== Touch optimizations for tablets and phones (portrait) ========== */
@media (max-width: 1024px) {
  /* Dropdown trigger buttons — min 44px touch target */
  .month-btn {
    min-height: 2.75rem; /* 44px */
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
    font-size: 0.9375rem;
  }

  /* Dropdown checkbox rows — 44px min height */
  [data-resort-dropdown] label,
  [data-month-dropdown] label {
    padding: 0.75rem;
    gap: 0.75rem;
    font-size: 0.9375rem;
    min-height: 2.75rem;
  }

  /* Checkboxes inside dropdowns — bigger tap target */
  [data-resort-dropdown] input[type="checkbox"],
  [data-month-dropdown] input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
  }

  /* Room type pill buttons — taller for touch */
  .room-type-pill {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }

  /* Clear "x" buttons on dropdowns — 44px tap target */
  .clear-btn {
    min-width: 2.75rem;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Modal close button — bigger tap target */
  .modal-sheet button[class*="p-1"] {
    padding: 0.5rem;
  }

  /* Modal view list items — more padding */
  .modal-sheet .space-y-2 > div {
    padding: 1rem;
  }

  /* Auth badge — 44px min height */
  header button[class*="rounded-full"] {
    min-height: 2.75rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Mobile nav icon links — 44px tap target */
  header nav + div a,
  header .sm\\:hidden a {
    padding: 0.625rem;
  }

  /* Search button — ensure 44px */
  button[class*="bg-blue-600"] {
    min-height: 2.75rem;
  }

  /* Accessible checkbox row — bigger tap area */
  label[class*="inline-flex"] {
    padding: 0.375rem 0;
    gap: 0.5rem;
  }
  label[class*="inline-flex"] input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
  }
}

/* Smooth transitions on page load */
[x-cloak] { display: none !important; }
