/* ==========================================================================
   css/components/attachments-formatting.css
   Split from app.html (build 2026.10.08.9-beta), original lines 3045-3159.
   Rules are in their ORIGINAL order; load order is defined in index.html.
   ========================================================================== */
/* Attach dropdown */
.attach-btn { position: relative; }
/* -- Record Clip modal -- */
.rec-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1400; }
.rec-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 1401;
  width: 520px; max-width: 94vw; background: var(--bg-deep); border: 1px solid var(--border-strong);
  border-radius: 14px; box-shadow: 0 24px 80px rgba(0,0,0,.8); display: flex; flex-direction: column;
  gap: 12px; padding: 16px; animation: modal-pop .2s var(--ease-out, ease); }
.rec-head { display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 700; color: var(--text-primary); }
.rec-x { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 6px; display: flex; }
.rec-x:hover { color: var(--text-primary); background: var(--bg-hover); }
.rec-video-wrap { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 10px; overflow: hidden; }
.rec-video-wrap video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.rec-badge { position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.6);
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #ed4245; animation: rec-blink 1s steps(2, start) infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
.rec-meter { height: 8px; border-radius: 4px; background: var(--bg-void); overflow: hidden; }
.rec-meter-fill { height: 100%; width: 0%; border-radius: 4px; background: linear-gradient(90deg,#23a559,#f0b232 70%,#ed4245); transition: width .06s linear; }
.rec-selects { display: flex; gap: 8px; }
.rec-sel { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--bg-void); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; color: var(--text-muted); min-width: 0; }
.rec-sel select { flex: 1; background: none; border: none; color: var(--text-primary); font-size: 12.5px; outline: none; min-width: 0; }
.rec-sel select option { background: var(--bg-elevated); color: var(--text-primary); }
.rec-limit { font-size: 12.5px; color: var(--text-muted); text-align: center; }
.rec-limit b { color: var(--text-secondary); }
.rec-actions { display: flex; gap: 8px; justify-content: center; }
.rec-btn { padding: 9px 18px; border-radius: 8px; border: none; font-size: 13px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 7px; }
.rec-btn-rec { background: #ed4245; color: #fff; }
.rec-btn-rec.recording { background: var(--bg-elevated); color: var(--text-primary); }
.rec-btn-send { background: var(--accent); color: #fff; }
.rec-btn-ghost { background: var(--bg-elevated); color: var(--text-secondary); }
.rec-btn:disabled { opacity: .5; cursor: default; }
/* Custom nameplate builder */
.npb-preview { position: relative; height: 52px; border-radius: 10px; background-color: var(--bg-void); background-repeat: no-repeat; display: flex; align-items: center; gap: 10px; padding: 0 14px; overflow: hidden; }
.npb-preview > span { font-size: 15px; font-weight: 700; color: #fff;white-space: nowrap; }
.npb-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.npb-row label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.npb-row select { background: var(--bg-void); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 13px; padding: 7px 10px; outline: none; min-width: 180px; }
.npb-row input[type="color"] { width: 54px; height: 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-void); cursor: pointer; padding: 2px; }
.plate-edit-badge { position: absolute; right: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; }

.attach-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 4px;
  min-width: 180px;
  z-index: 200;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.3);
}
.attach-menu.open { display: block; animation: menu-in 0.22s var(--ease-out, ease); }
.attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: background 0.1s, color 0.1s;
}
.attach-item:hover { background: var(--bg-hover); color: var(--text-primary); }
/* Format popup (floating above input, like GIF/emoji pickers) */
.format-bar {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 8px;
  z-index: 100;
  flex-wrap: wrap;
  /* Match the app's other popups (context menu etc.) instead of the heavy --shadow-lg
     that made this float above the theme. */
  box-shadow: 0 12px 32px -8px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.3);
  min-width: 240px;
}
.format-bar.open { display: flex; animation: menu-in 0.22s var(--ease-out, ease); }
.fmt-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 48px;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.fmt-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
.fmt-symbol { font-size: 13px; font-weight: 600; line-height: 1.2; }
.fmt-label { font-size: 9px; color: var(--text-muted); letter-spacing: 0.3px; text-transform: uppercase; }
.fmt-btn:hover .fmt-label { color: var(--text-secondary); }
/* Always-visible quick formatting toolbar above the composer */
.format-quick { display: flex; align-items: center; gap: 1px; padding: 0 2px 5px; }
.fq-btn {
  width: 30px; height: 26px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-muted); border-radius: 6px;
  cursor: pointer; font-size: 14px; font-weight: 700; line-height: 1; transition: background .1s, color .1s;
}
.fq-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.fq-sep { width: 1px; height: 16px; background: var(--border); margin: 0 4px; flex-shrink: 0; }
