/* ──────────────────────────────────────────────────────────────────────────
   Collapsible form sections (v1.21.2)
   Used on trademark create/edit forms — extends the existing .vcard pattern.
   ────────────────────────────────────────────────────────────────────────── */

/* Header is clickable when collapsible */
.vcard-collapsible > .vcard-hd {
  cursor: pointer;
  user-select: none;
  transition: background-color .12s ease;
}
.vcard-collapsible > .vcard-hd:hover {
  background-color: #f8f9fc;
}

/* The chevron indicator */
.vcard-collapsible .vcard-toggle-icon {
  margin-left: auto;
  font-size: 16px;
  color: #878a99;
  transition: transform .18s ease;
}
.vcard-collapsible.vcard-collapsed .vcard-toggle-icon {
  transform: rotate(-90deg);
}

/* "Optional" / "Required" pill in the header */
.vcard-section-tag {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}
.vcard-section-tag-required {
  background: #fff3eb;
  color: #f06548;
}
.vcard-section-tag-optional {
  background: #eef2f6;
  color: #878a99;
}

/* When user fills in data in a collapsed section, show a small dot indicator */
.vcard-section-tag-filled {
  background: #ddf6e9;
  color: #0ab39c;
}

/* Hide the body when collapsed. Use display:none rather than max-height
   so dropdown menus inside (custom field options, etc.) don't get clipped. */
.vcard-collapsible.vcard-collapsed > .vcard-body,
.vcard-collapsible.vcard-collapsed > .empty-state {
  display: none;
}

/* When collapsed, slim the header padding so the section is more compact */
.vcard-collapsible.vcard-collapsed > .vcard-hd {
  border-bottom: none;
}

/* "Expand all / Collapse all" toolbar */
.tm-section-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #878a99;
  margin-bottom: 12px;
  padding: 6px 0;
}
.tm-section-toolbar a {
  color: #405189;
  text-decoration: none;
  font-weight: 500;
}
.tm-section-toolbar a:hover {
  text-decoration: underline;
}

/* ──────────────────────────────────────────────────────────────────────────
   v1.21.3 — Layout customization (drag-to-reorder + hide section)
   Drag handles + hide toggles only show when body.edit-on is active.
   ────────────────────────────────────────────────────────────────────────── */

/* Make the form-sections container support flexbox ordering */
.tm-form-left-column > .vcard {
  margin-bottom: 14px;  /* preserve spacing — flex container has gap:0 to avoid double-spacing */
}

/* Hidden sections — by default fully removed from view */
.vcard.tm-section-hidden,
.vcard[data-section-hidden="1"] {
  display: none !important;
}

/* But in Edit Mode, hidden sections show as muted/striped to allow un-hiding */
body.edit-on .vcard.tm-section-hidden,
body.edit-on .vcard[data-section-hidden="1"] {
  display: block !important;
  opacity: 0.55;
  background: repeating-linear-gradient(45deg, transparent, transparent 8px, #fff8f0 8px, #fff8f0 12px);
  border: 1.5px dashed #f59e0b;
  position: relative;
}
body.edit-on .vcard.tm-section-hidden::after,
body.edit-on .vcard[data-section-hidden="1"]::after {
  content: "Hidden firm-wide — toggle to restore";
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 10px;
  color: #b45309;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  pointer-events: none;
}

/* v2.0 — Up/down arrow buttons replace the section drag handle. Only
   visible in Edit Mode. Stacked vertically to mirror section orientation. */
.vcard-reorder-arrows {
  display: none;
  flex-direction: column;
  gap: 1px;
  padding-right: 8px;
  flex-shrink: 0;
}
body.edit-on .vcard-reorder-arrows { display: inline-flex; }
.vcard-reorder-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 16px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #adb5bd;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background .12s, color .12s, border-color .12s, opacity .12s;
}
.vcard-reorder-arrow:hover:not(:disabled) {
  background: #eff6ff;
  color: #185fa5;
  border-color: #93c5fd;
}
.vcard-reorder-arrow:active:not(:disabled) {
  background: #dbeafe;
  transform: translateY(1px);
}
.vcard-reorder-arrow:disabled {
  opacity: .25;
  cursor: not-allowed;
}
.vcard-reorder-arrow i { font-size: 16px; line-height: 1; }

/* Hide-section eye toggle — unchanged */
.vcard-hide-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  color: #878a99;
  font-size: 16px;
  margin-left: 8px;
  background: transparent;
  border: 1px solid transparent;
  transition: all .15s;
}
.vcard-hide-toggle:hover {
  background: #fef2f2;
  color: #ef4444;
  border-color: #fecaca;
}
body.edit-on .vcard-hide-toggle { display: inline-flex; }

.vcard-hide-toggle[disabled] {
  opacity: .3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Layout edit controls in toolbar — only visible in Edit Mode */
body.edit-on .tm-layout-edit-controls { display: inline-flex !important; align-items: center; }

/* Toast for layout save */
.tm-layout-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1f2937;
  color: white;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}
.tm-layout-toast.tm-layout-toast-show {
  opacity: 1;
  transform: translateY(0);
}
.tm-layout-toast.tm-layout-toast-error {
  background: #b91c1c;
}

/* ──────────────────────────────────────────────────────────────────────────
   v1.21.5 — Tab customization on trademark detail page
   ────────────────────────────────────────────────────────────────────────── */

.tm-tabs-list { /* parent <ul> */ }
.tm-tab-item {
  position: relative;
  transition: background-color .12s ease;
}

/* v2.0 — Left/right arrow buttons replace the tab drag handle. The .tm-tab-
   drag-handle wrapper is repurposed by JS as a flex container for the two
   arrow buttons; styling is mostly on the arrows themselves. */
.tm-tab-drag-handle, .tm-tab-arrow-group {
  display: none;
  font-size: 13px;
  padding: 0 2px 0 4px;
  user-select: none;
  align-items: center;
  gap: 1px;
}
body.edit-on .tm-tab-drag-handle, body.edit-on .tm-tab-arrow-group {
  display: inline-flex;
}
.tm-tab-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #adb5bd;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: background .12s, color .12s, border-color .12s, opacity .12s;
}
.tm-tab-arrow:hover:not(:disabled) {
  background: #eff6ff;
  color: #185fa5;
  border-color: #93c5fd;
}
.tm-tab-arrow:disabled {
  opacity: .25;
  cursor: not-allowed;
}
.tm-tab-arrow i { font-size: 14px; line-height: 1; }

/* Tab hide toggle — unchanged */
.tm-tab-hide-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  color: #878a99;
  font-size: 12px;
  background: transparent;
  border: 1px solid transparent;
  margin-right: 4px;
  transition: all .12s;
}
.tm-tab-hide-toggle:hover {
  background: #fef2f2;
  color: #ef4444;
  border-color: #fecaca;
}
body.edit-on .tm-tab-hide-toggle { display: inline-flex; }

/* Hidden tabs — invisible by default */
.tm-tab-item.tm-tab-hidden,
.tm-tab-item[data-tab-hidden="1"] {
  display: none !important;
}
/* But in Edit Mode they reappear striped/muted to allow un-hiding */
body.edit-on .tm-tab-item.tm-tab-hidden,
body.edit-on .tm-tab-item[data-tab-hidden="1"] {
  display: flex !important;
  opacity: 0.55;
  background: repeating-linear-gradient(45deg, transparent, transparent 6px, #fff8f0 6px, #fff8f0 9px);
  border: 1.5px dashed #f59e0b;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}

/* ──────────────────────────────────────────────────────────────────────────
   v1.21.5 — File preview modal
   ────────────────────────────────────────────────────────────────────────── */
.tm-file-card { user-select: none; }
