/* ==========================================================================
   Demo Ticket Form (shared across all variants: A, B, A-mobile, B-mobile)
   In-app editable ticket form opened by clicking any kanban / taskboard card.
   ========================================================================== */

/* Anchor overlays inside the variant container (desktop .demo-content + mobile
   variant wrapper). */
[data-demo-variant] .demo-content,
[data-demo-variant="A-mobile"],
[data-demo-variant="B-mobile"] {
  position: relative;
}

/* ---------- Clickable cards (desktop kanban + mobile taskboard) ---------- */
.demo-kanban__card--clickable,
.demo-mobile-taskboard__card--clickable {
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.demo-kanban__card--clickable:hover,
.demo-mobile-taskboard__card--clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  border-color: rgba(124, 224, 154, 0.5);
}

.demo-kanban__card--active,
.demo-mobile-taskboard__card--active {
  border-color: var(--primary-green, #7ce09a);
  box-shadow: 0 0 0 2px rgba(124, 224, 154, 0.22);
}

.demo-kanban__card--pulse,
.demo-mobile-taskboard__card--pulse {
  animation: demo-ticket-card-pulse 1.1s ease;
}

/* Title is independently clickable + keyboard-focusable. */
.demo-kanban__desc--clickable,
.demo-mobile-taskboard__card-title--clickable {
  cursor: pointer;
  transition: color 150ms ease, text-decoration-color 150ms ease;
  text-decoration: underline transparent;
  text-underline-offset: 2px;
  outline: none;
}

.demo-kanban__desc--clickable:hover,
.demo-kanban__desc--clickable:focus-visible,
.demo-mobile-taskboard__card-title--clickable:hover,
.demo-mobile-taskboard__card-title--clickable:focus-visible {
  color: var(--primary-green, #7ce09a);
  text-decoration-color: var(--primary-green, #7ce09a);
}

.demo-kanban__desc--clickable:focus-visible,
.demo-mobile-taskboard__card-title--clickable:focus-visible {
  border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(124, 224, 154, 0.35);
}

@keyframes demo-ticket-card-pulse {
  0% { box-shadow: 0 0 0 0 rgba(124, 224, 154, 0.45); }
  100% { box-shadow: 0 0 0 10px rgba(124, 224, 154, 0); }
}

/* ---------- Form overlay + panel ---------- */
.demo-ticket-form-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 13, 22, 0.72);
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 18px;
  overflow: auto;
}

/* Desktop overlays sit below the content header (52px tall). */
[data-demo-variant="A"] .demo-content > .demo-ticket-form-overlay,
[data-demo-variant="B"] .demo-content > .demo-ticket-form-overlay {
  inset: 52px 0 0;
}

.demo-ticket-form-overlay[hidden] {
  display: none;
}

.demo-ticket-form-panel {
  width: min(760px, 100%);
  border: 1px solid #334155;
  border-radius: 12px;
  background: linear-gradient(180deg, #0f1a2a 0%, #0b1320 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.demo-ticket-form {
  padding: 16px;
}

.demo-ticket-form__header h3 {
  margin: 0 0 12px;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 700;
}

.demo-ticket-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.demo-ticket-form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.demo-ticket-form__field--full {
  grid-column: 1 / -1;
}

.demo-ticket-form__field > span {
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.demo-ticket-form input,
.demo-ticket-form select,
.demo-ticket-form textarea {
  width: 100%;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #111d2f;
  color: #e2e8f0;
  padding: 8px 10px;
  font-size: 0.78rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

.demo-ticket-form textarea {
  resize: vertical;
}

.demo-ticket-form input:focus,
.demo-ticket-form select:focus,
.demo-ticket-form textarea:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.25);
}

.demo-ticket-form__actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.demo-ticket-form__btn {
  border-radius: 8px;
  border: 1px solid #334155;
  background: #111d2f;
  color: #cbd5e1;
  padding: 7px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.demo-ticket-form__btn:hover {
  transform: translateY(-1px);
}

.demo-ticket-form__btn--ghost:hover {
  background: #1a2940;
  border-color: #4b627f;
}

.demo-ticket-form__btn--primary {
  background: var(--gradient-primary, linear-gradient(135deg, #7ce09a 0%, #4ec97a 100%));
  border-color: transparent;
  color: #0f172a;
}

.demo-ticket-form__btn--primary:hover {
  opacity: 0.95;
}

/* Mobile tweaks: single column form, smaller padding. */
[data-demo-variant$="-mobile"] .demo-ticket-form-overlay {
  padding: 10px;
}

[data-demo-variant$="-mobile"] .demo-ticket-form__grid {
  grid-template-columns: 1fr;
}

[data-demo-variant$="-mobile"] .demo-ticket-form-panel {
  width: 100%;
}

/* ---------- Light (bright) mode overrides ----------
   Dark mode keeps the existing palette above. In light mode the form
   panel and its controls flip to a white surface with dark text. */
:root:not([data-theme="dark"]) .demo-ticket-form-overlay {
  background: rgba(15, 23, 42, 0.45);
}

:root:not([data-theme="dark"]) .demo-ticket-form-panel {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

:root:not([data-theme="dark"]) .demo-ticket-form__header h3 {
  color: #0f172a;
}

:root:not([data-theme="dark"]) .demo-ticket-form__field > span {
  color: #475569;
}

:root:not([data-theme="dark"]) .demo-ticket-form input,
:root:not([data-theme="dark"]) .demo-ticket-form select,
:root:not([data-theme="dark"]) .demo-ticket-form textarea {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

:root:not([data-theme="dark"]) .demo-ticket-form input::placeholder,
:root:not([data-theme="dark"]) .demo-ticket-form textarea::placeholder {
  color: #94a3b8;
}

:root:not([data-theme="dark"]) .demo-ticket-form input:focus,
:root:not([data-theme="dark"]) .demo-ticket-form select:focus,
:root:not([data-theme="dark"]) .demo-ticket-form textarea:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

:root:not([data-theme="dark"]) .demo-ticket-form__btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
}

:root:not([data-theme="dark"]) .demo-ticket-form__btn--ghost:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

:root:not([data-theme="dark"]) .demo-ticket-form__btn--primary {
  color: #0f172a;
}
