/* These styles are generated from project.scss. */

[x-cloak] {
  display: none !important;
}

/* Keep crispy-tailwind form controls flat (no rounded corners). */
form [id^="div_id_"] .rounded,
form [id^="div_id_"] .rounded-lg,
form [id^="div_id_"] .rounded-t,
form [id^="div_id_"] .rounded-b,
form [id^="div_id_"] .rounded-l-none,
form [id^="div_id_"] .rounded-r-none {
  border-radius: 0 !important;
}

/* Date inputs enhanced with the calendar popup (js/widgets/datetime-picker.js):
   hide the browser's own picker icon so it cannot open the native calendar
   next to the custom one. Scoped to the widget wrapper so it applies before
   Alpine initializes; without JavaScript the icon stays as the only picker. */
@media (scripting: enabled) {
  .datetime-picker input::-webkit-calendar-picker-indicator {
    display: none;
  }
}

.alert-debug {
  color: black;
  background-color: white;
  border-color: #e5e7eb;
}

.alert-error {
  color: #FF5100;
  background-color: #FFF1EB;
  border-color: #FF5100;
}

.htmx-on-request {
  display: none;
}

.htmx-request .htmx-on-request,
.htmx-request.htmx-on-request {
  display: inline;
}

.htmx-request .htmx-on-idle,
.htmx-request.htmx-on-idle {
  display: none;
}

.export-job-submit.htmx-request {
  cursor: wait;
  color: #6b7280;
}

/* PDF ticket designer. The canvas stays framework-light: PDF.js paints the
   artwork and Alpine positions plain DOM overlays in millimetres. */
.ticket-layout-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.ticket-layout-workspace {
  display: grid;
  grid-template-columns: 13rem minmax(28rem, 1fr) 18rem;
  min-width: 0;
}

.ticket-layout-layers,
.ticket-layout-properties,
.ticket-layout-stage {
  min-width: 0;
}

.ticket-layout-page-shell {
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
}

.ticket-layout-page {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.ticket-layout-page canvas {
  pointer-events: none;
}

.ticket-layout-element {
  z-index: 1;
  touch-action: none;
  outline: none;
}

.ticket-layout-resize-handle {
  cursor: nwse-resize;
  touch-action: none;
}

@media (min-width: 1280px) {
  .ticket-layout-layers,
  .ticket-layout-properties {
    position: sticky;
    top: 4rem;
    max-height: calc(100vh - 5rem);
    align-self: start;
    overflow-y: auto;
  }
}

@media (max-width: 1279px) {
  .ticket-layout-workspace {
    grid-template-columns: 12rem minmax(0, 1fr);
  }

  .ticket-layout-properties {
    grid-column: 1 / -1;
    border-top: 1px solid #e5e7eb;
    border-left: 0;
  }
}

@media (max-width: 767px) {
  .ticket-layout-toolbar {
    display: grid;
    align-items: stretch;
  }

  .ticket-layout-workspace {
    display: block;
  }

  .ticket-layout-layers {
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .ticket-layout-properties {
    border-top: 1px solid #e5e7eb;
  }
}

.portal-shell {
  position: relative;
}

.portal-sidebar {
  z-index: 30;
}

.sidebar-open-button,
.sidebar-close-button {
  display: none;
}

@media (max-width: 1023px) {
  .portal-main {
    margin-left: 0;
  }

  .portal-sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease-in-out;
  }

  .portal-shell.sidebar-open .portal-sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(17, 24, 39, 0.45);
    border: 0;
    padding: 0;
    cursor: pointer;
  }

  .sidebar-open-button,
  .sidebar-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #fff;
    color: #374151;
  }

  .sidebar-open-button {
    flex-direction: column;
    gap: 0.2rem;
    flex-shrink: 0;
  }

  .sidebar-open-button span {
    width: 0.9rem;
    height: 2px;
    border-radius: 9999px;
    background: currentColor;
    font-size: 0;
  }

  .sidebar-close-button {
    font-size: 1.5rem;
    line-height: 1;
  }
}

@media (min-width: 1024px) {
  .sidebar-backdrop,
  .sidebar-open-button,
  .sidebar-close-button {
    display: none !important;
  }
}
