/* Custom select styling overrides */
@layer components {
  .select-wrapper select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
    text-indent: 0.15rem;
  }
  .inline-editor-input::-webkit-outer-spin-button,
  .inline-editor-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  .inline-editor-input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
  }
}

/* Ensure modals sit above Google Maps error overlay ("This page can't load Google Maps correctly") */
[data-modal-panel].fixed {
  z-index: 2147483646 !important;
}

/* Modal panel scroll: allow scrolling when content is taller than viewport */
[data-modal-target="panel"] {
  overflow-y: auto;
}
/* Keep backdrop fixed so it doesn't scroll with content */
[data-modal-target="panel"] > div:first-child {
  position: fixed;
}

/* Google Places Autocomplete - Dark Theme Styling (above modals so it shows in Add lodging / Add POI) */
.pac-container {
  background-color: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  margin-top: 4px;
  font-family: inherit;
  z-index: 2147483647 !important;
}

.pac-item {
  padding: 0.75rem 1rem;
  color: #e5e7eb;
  border-top: 1px solid #374151;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.pac-item:first-child {
  border-top: none;
}

.pac-item:hover,
.pac-item-selected {
  background-color: #374151;
}

.pac-item-query {
  color: #ffffff;
  font-weight: 500;
}

.pac-matched {
  color: #60a5fa;
  font-weight: 600;
}

/* Google Places Autocomplete - Light theme */
html:not(.dark) .pac-container {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

html:not(.dark) .pac-item {
  color: #374151;
  border-top-color: #e5e7eb;
}

html:not(.dark) .pac-item:hover,
html:not(.dark) .pac-item-selected {
  background-color: #f3f4f6;
}

html:not(.dark) .pac-item-query {
  color: #111827;
}

html:not(.dark) .pac-matched {
  color: #059669;
}

.pac-icon {
  display: none;
}

.pac-icon-marker {
  display: none;
}

/* Hide Google branding (optional - you may want to keep it for attribution) */
.pac-logo::after {
  display: none;
}

/* Input field styling when autocomplete is active - emerald accent per design system */
.pac-target-input:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.3);
}

/* Budget cards use theme tokens from tailwind/application.css; shared base for compatibility */
.budget-summary-card,
.budget-section-card,
.budget-bucket-card {
  border-radius: 0.75rem;
}
.budget-summary-card { padding: 1.25rem; }
.budget-section-card { padding: 1.5rem; }
.budget-bucket-card { padding: 1rem; }

.budget-section-card > * + *,
.budget-bucket-card > * + *,
.budget-summary-card > * + * {
  margin-top: 0.75rem;
}

.budget-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.budget-muted-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.budget-body-text {
  color: var(--text-primary);
  font-size: 0.85rem;
  opacity: 0.92;
}

/* Preserve profile/alias casing (no capitalize) so "missharvey" stays "missharvey" */
.preserve-name-case {
  text-transform: none !important;
}

/* Obligation action buttons: fixed 20px cells, 6px gap, so spacing is identical between all four */
.obligation-action-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.obligation-action-cell {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.obligation-action-form {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.obligation-action-form .obligation-action-btn {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

/* Ensure inline editor display spans fill their cells so inputs can overlay everything */
[data-inline-editor-target="display"] {
  display: inline-flex;
  width: 100%;
  align-items: center;
  min-height: 2.75rem;
  gap: 0.15rem;
}

.inline-editor-input {
  min-height: 2.5rem;
}

/* Stimulus cursor overrides: pointer only when an action is registered */
/* Exclude form so the whole schedule/other forms don't show pointer over non-interactive areas */
[data-controller][data-action]:not(form),
[data-action]:not([data-action=""]):not(form),
button[data-action],
a[data-action],
label[data-action],
[role="button"][data-action],
[role="tab"][data-action] {
  cursor: pointer !important;
}

/* Insert placeholder button when disabled: show not-allowed, not pointer */
.insert-placeholder-btn-disabled,
[data-placeholder-picker-target="insertButton"]:disabled {
  cursor: not-allowed !important;
}

/* Ensure interactive elements have pointer cursor */
:is(
  button:not(:disabled),
  a[href]:not([href=""]):not([href="#"]),
  label[for],
  summary,
  [role="button"]:not([aria-disabled="true"]),
  [role="tab"],
  input[type="button"]:not(:disabled),
  input[type="submit"]:not(:disabled),
  [data-modal-open],
  [data-modal-close],
  [data-modal-panel],
  [data-modal-target]
) {
  cursor: pointer;
}

/*
 * Loaded after tailwind.css (see layouts). Tailwind v4 does not emit CSS that follows the bundle
 * in app/assets/tailwind/application.css, so these live here. Unlayered + !important beats
 * @layer utilities (`dark:text-white` = pure #fff), which reads as halation on dark zinc panels.
 */
html.dark :where(p, h1, h2, h3, h4, h5, h6, td, th, li).dark\:text-white,
html.dark :where(p, h1, h2, h3, h4, h5, h6, td, th, li).text-white {
  color: rgb(228 228 231) !important;
  font-family: var(--font-ui), ui-sans-serif, system-ui, sans-serif !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: auto;
}

html.dark :where(span.font-medium, span.font-semibold, span.font-bold).text-white,
html.dark :where(span.font-medium, span.font-semibold, span.font-bold).dark\:text-white,
html.dark span.text-2xl.font-bold.text-white,
html.dark span.text-2xl.font-bold.dark\:text-white {
  color: rgb(228 228 231) !important;
  font-family: var(--font-ui), ui-sans-serif, system-ui, sans-serif !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: auto;
}

html.dark :where(p, h1, h2, h3, h4, h5, h6, td, th, li).dark\:text-zinc-100,
html.dark :where(p, h1, h2, h3, h4, h5, h6, td, th, li).text-zinc-100,
html.dark :where(p, h1, h2, h3, h4, h5, h6, td, th, li).dark\:text-zinc-50,
html.dark :where(p, h1, h2, h3, h4, h5, h6, td, th, li).text-zinc-50 {
  color: rgb(212 212 216) !important;
  font-family: var(--font-ui), ui-sans-serif, system-ui, sans-serif !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: auto;
}

html.dark a.dark\:text-zinc-100:not(:hover),
html.dark a.text-zinc-100:not(:hover) {
  color: rgb(212 212 216) !important;
  font-family: var(--font-ui), ui-sans-serif, system-ui, sans-serif !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: auto;
}

/* Panel titles: utility layer can beat @layer components for `dark:text-zinc-300` on .heading-clean-page */
html.dark :where(h1, h2, h3).heading-clean-page {
  color: rgb(200 200 204) !important;
  text-shadow: 0 0 0 transparent !important;
  filter: none !important;
  -webkit-font-smoothing: subpixel-antialiased !important;
  text-rendering: optimizeSpeed;
}

/*
 * Large headings and header metadata: subpixel AA + optimizeSpeed reduces soft halo on displays
 * where grayscale AA or default rendering reads as a glow on light-on-dark type.
 */
html.dark :where(h2, h3).text-xl.font-semibold.dark\:text-white,
html.dark :where(h2, h3).text-xl.font-semibold.text-white,
html.dark :where(h2, h3, p).text-2xl.font-semibold.text-white,
html.dark :where(h2, h3).text-xl.font-semibold.dark\:text-zinc-100,
html.dark header div.mt-2.flex[class*="text-gray"] {
  text-shadow: 0 0 0 transparent !important;
  -webkit-font-smoothing: subpixel-antialiased !important;
  text-rendering: optimizeSpeed;
}

/* Attendee names, lodging names, etc.: same crisp rendering for white body text */
html.dark :where(p, span).font-semibold.text-white {
  text-shadow: 0 0 0 transparent !important;
  -webkit-font-smoothing: subpixel-antialiased !important;
  text-rendering: optimizeSpeed;
}

/*
 * Labels often use `text-gray-500` without `dark:` — still #6b7280 on dark panels.
 * Meta rows use `dark:text-gray-400` on wrappers (`div`); body copy uses `dark:text-gray-300` on `p` and should stay brighter than labels.
 */
html.dark :where(p, span, label, li, td, th, button).text-gray-500 {
  color: var(--text-muted, #a1a1aa) !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: auto;
}

html.dark :where(div, span, a, label, td, th, li).dark\:text-gray-400 {
  color: var(--text-muted, #a1a1aa) !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: auto;
}

html.dark p.dark\:text-gray-300 {
  color: rgb(214 214 220) !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: auto;
}

html.dark span.dark\:text-gray-300 {
  color: rgb(205 205 212) !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: auto;
}

html.dark :where(p, span, label).dark\:text-gray-500,
html.dark :where(p, span, label).dark\:text-gray-600 {
  color: rgb(113 113 122) !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: auto;
}

/* Emerald links: opacity modifiers (e.g. /90) can composite softly; use solid greens + no shadow */
html.dark a.dark\:text-emerald-400\/90:not(:hover),
html.dark a.dark\:text-emerald-400:not(:hover),
html.dark a.dark\:text-emerald-300:not(:hover) {
  color: rgb(52 211 153) !important;
  opacity: 1 !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: auto;
}

html.dark a.dark\:hover\:text-emerald-300:hover {
  color: rgb(110 231 183) !important;
}

/* Sidebar / pills: bright emerald on zinc */
html.dark :where(span, button).text-emerald-800.dark\:text-emerald-400\/90,
html.dark :where(span, button).dark\:text-emerald-400\/90 {
  color: rgb(52 211 153) !important;
  opacity: 1 !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: auto;
}

html.dark button.dark\:\!text-emerald-300 {
  color: rgb(52 211 153) !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: auto;
}

html.dark button.dark\:\!text-emerald-200 {
  color: rgb(110 231 183) !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: auto;
}

html.dark nav button.dark\:text-emerald-400:not(:hover) {
  color: rgb(52 211 153) !important;
  opacity: 1 !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: auto;
}

/* Modal main heading: uppercase; slight padding above border avoids optical clash with letter tops. */
.modal-panel-no-glow h2 {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.3;
  padding-bottom: 0.125rem;
  border: 0;
  outline: none;
}