/* ===========================================
   ELEVN — ONE Creation Flow — Skeleton CSS V1
   Minimal styles for modal ONE sections
   =========================================== */

.one-publisher .one-section {
  padding: 16px;
  border-bottom: 1px solid #eee;
}

body.night-mode .one-publisher .one-section {
  border-bottom-color: var(--card-dark-divider);
}

.one-publisher .one-section:last-child {
  border-bottom: none;
}

.one-publisher .one-section-title {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 14px;
}

.one-publisher .one-section-placeholder {
  color: #888;
  font-size: 13px;
  font-style: italic;
}

body.night-mode .one-publisher .one-section-placeholder {
  color: #999;
}

/* ===========================================
   ELEVN — ONE Upload Zone CSS (2.B)
   =========================================== */

.one-publisher .one-upload-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 30px 20px;
  border: 2px dashed #ccc;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}

body.night-mode .one-publisher .one-upload-trigger {
  border-color: var(--card-dark-divider);
}

.one-publisher .one-upload-trigger:hover {
  border-color: #007AFF;
  background: rgba(0, 122, 255, 0.04);
}

.one-publisher .one-upload-icon svg path {
  fill: #111 !important;
}

body.night-mode .one-publisher .one-upload-icon svg path {
  fill: #c1d4e3 !important;
}

.one-publisher .one-upload-label {
  display: block;
  font-weight: 700;
  font-size: 16px;
}

.one-publisher .one-upload-hint {
  display: block;
  color: #888;
  font-size: 13px;
}

body.night-mode .one-publisher .one-upload-hint {
  color: #999;
}

.one-publisher .publisher-meta[data-meta="reel"] {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(0, 122, 255, 0.08);
  border-radius: 8px;
  font-size: 13px;
}

body.night-mode .one-publisher .publisher-meta[data-meta="reel"] {
  background: rgba(0, 122, 255, 0.15);
}

/* Hide the upload trigger when a reel is attached
   (the meta block will be visible instead) */
.one-publisher .publisher-meta[data-meta="reel"]:not([style*="display: none"]) ~ .one-upload-trigger,
.one-publisher .publisher-attachments.js_publisher-reels:not(.x-hidden) ~ .one-upload-trigger {
  /* Visual cue : ONE uploaded successfully takes over */
  /* For now we keep trigger visible — to be refined in polish phase */
}

/* ===========================================
   ELEVN — ONE Caption Zone CSS (2.C)
   =========================================== */

.one-publisher .one-caption-wrapper {
  position: relative;
}

/* ELEVN — ONE Caption textarea height tuning (2.C.fix) */
.one-publisher .one-caption-textarea {
  width: 100%;
  min-height: 90px;
  max-height: 140px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  /* 16px to prevent iOS Safari auto-zoom on focus */
  font-size: 16px;
  line-height: 1.4;
  resize: vertical;
  background: transparent;
  color: inherit;
  box-sizing: border-box;
}

body.night-mode .one-publisher .one-caption-textarea {
  border-color: var(--card-dark-divider);
}

.one-publisher .one-caption-textarea:focus {
  outline: none;
  border-color: #007AFF;
}

.one-publisher .one-caption-textarea::placeholder {
  color: #999;
}

.one-publisher .one-caption-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.one-publisher .one-caption-counter {
  font-size: 12px;
  color: #888;
  font-variant-numeric: tabular-nums;
}

.one-publisher .one-caption-counter.warning {
  color: #f0a020;
}

.one-publisher .one-caption-counter.danger {
  color: #e24b4a;
  font-weight: 600;
}

.one-publisher .one-caption-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #888;
}

body.night-mode .one-publisher .one-caption-hint {
  color: #999;
}

/* ===========================================
   ELEVN — ONE Caption textarea mobile override (2.C.fix2)
   Override the global `.publisher textarea` mobile rule
   that forces height:32px (intended for the Post publisher
   textarea, but not for our multi-line ONE caption)
   =========================================== */

@media (max-width: 767.98px) {
  .publisher.one-publisher .one-caption-textarea {
    min-height: 90px !important;
    height: auto !important;
    line-height: 1.4 !important;
    padding: 12px !important;
    margin: 0 !important;
    font-size: 16px !important;
  }
}

/* ===========================================
   ELEVN — ONE Title + Hashtags CSS (2.C-bis)
   =========================================== */

.one-publisher .one-hashtags-wrapper {
  position: relative;
}

.one-publisher .one-hashtags-display {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  background: transparent;
  color: inherit;
  box-sizing: border-box;
  cursor: default;
}

body.night-mode .one-publisher .one-hashtags-display {
  border-color: var(--card-dark-divider);
}

.one-publisher .one-hashtags-display::placeholder {
  color: #999;
}

.one-publisher .one-hashtags-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.one-publisher .one-chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  background: #f0f2f5;
  color: #333;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}

body.night-mode .one-publisher .one-chip {
  background: var(--card-dark-divider);
  color: #ddd;
}

.one-publisher .one-chip:hover {
  background: #e4e6eb;
}

body.night-mode .one-publisher .one-chip:hover {
  background: #3a3a3a;
}

.one-publisher .one-chip.selected {
  background: #007AFF;
  color: #fff;
}

.one-publisher .one-chip.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===========================================
   ELEVN — ONE uploader isolation fix (2.C-bis.fix.1)
   Sngine wraps js_x-uploader in a form with an invisible
   input[type=file] that defaults to 2135px x 759px,
   capturing clicks across the entire modal.
   This fix constrains the input to its container.
   =========================================== */

.one-publisher .x-uploader {
  position: relative;
  overflow: hidden;
}

.one-publisher .x-uploader input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  font-size: 16px !important;
  opacity: 0;
  cursor: pointer;
}

/* ===========================================
   ELEVN — ONE Title input CSS (2.C-bis.fix.2)
   Replaces the textarea-based caption with a single-line input
   (more aligned with the "Titre du ONE" concept, 35 chars max)
   =========================================== */

.one-publisher .one-title-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  background: transparent;
  color: inherit;
  box-sizing: border-box;
}

body.night-mode .one-publisher .one-title-input {
  border-color: var(--card-dark-divider);
}

.one-publisher .one-title-input:focus {
  outline: none;
  border-color: #007AFF;
}

.one-publisher .one-title-input::placeholder {
  color: #999;
}

/* ===========================================
   ELEVN — ONE chip selected dark mode fix (2.C-bis.fix.3)
   The night-mode rule body.night-mode .one-publisher .one-chip
   has higher specificity than .one-publisher .one-chip.selected,
   so selected chips stayed dark in night mode.
   This rule restores the ELEVN blue selection in dark mode.
   =========================================== */

body.night-mode .one-publisher .one-chip.selected {
  background: #007AFF;
  color: #fff;
}

/* ===========================================
   ELEVN — ONE Soundtrack CSS (2.D.1)
   =========================================== */

.one-publisher .one-add-soundtrack-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border: 2px dashed #ccc;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

body.night-mode .one-publisher .one-add-soundtrack-btn {
  border-color: var(--card-dark-divider);
}

.one-publisher .one-add-soundtrack-btn:hover {
  border-color: #007AFF;
  background: rgba(0, 122, 255, 0.04);
}

.one-publisher .one-add-soundtrack-btn i {
  color: #007AFF;
  font-size: 18px;
}

/* Sound Stack (shown after sound selection) */
.one-publisher .one-elevn-sound-stack {
  margin-top: 0;
}

.one-publisher .one-elevn-sound-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(0, 122, 255, 0.08);
  border-radius: 10px;
}

body.night-mode .one-publisher .one-elevn-sound-selected {
  background: rgba(0, 122, 255, 0.15);
}

.one-publisher .one-elevn-sound-selected-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.one-publisher .one-elevn-sound-selected-inner i {
  color: #007AFF;
  font-size: 18px;
}

.one-publisher .one-elevn-sound-selected-text {
  flex: 1;
  min-width: 0;
}

.one-publisher .one-elevn-sound-selected-title {
  font-size: 12px;
  color: #888;
  font-weight: 600;
}

body.night-mode .one-publisher .one-elevn-sound-selected-title {
  color: #999;
}

.one-publisher .one-elevn-sound-selected-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================================
   ELEVN — x-hidden specificity fix (2.D.1.fix1)
   Our .one-publisher .one-add-soundtrack-btn rule has higher
   specificity than Sngine's .x-hidden, so x-hidden didn't hide it.
   This rule forces hidden state when the class is present.
   =========================================== */

.one-publisher .one-add-soundtrack-btn.x-hidden,
.one-publisher .one-elevn-sound-stack.x-hidden,
.one-publisher .one-elevn-sound-selected.x-hidden {
  display: none !important;
}

/* ===========================================
   ELEVN — Audio panel z-index fix above Bootstrap modal (2.D.1.fix5)
   The Sngine Bootstrap modal (#modal) has z-index 99999.
   The audio panel (#elevn-audio-panel) was at 9999, so it
   was rendered BEHIND the ONE modal when opened from inside it.
   Raise it to 999999 to always sit above the modal.
   =========================================== */

#elevn-audio-panel {
  z-index: 999999 !important;
}

/* ===========================================
   ELEVN — ONE Sound Mode box CSS (2.D.2)
   3 mode buttons side by side: Original / Soundtrack / Mix
   =========================================== */

.one-publisher .one-elevn-sound-mode-box {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(0, 122, 255, 0.06);
  border-radius: 10px;
}

body.night-mode .one-publisher .one-elevn-sound-mode-box {
  background: rgba(0, 122, 255, 0.10);
}

.one-publisher .one-elevn-sound-mode-box.x-hidden {
  display: none !important;
}

.one-publisher .one-elevn-sound-mode-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  margin-bottom: 8px;
}

body.night-mode .one-publisher .one-elevn-sound-mode-label {
  color: #999;
}

.one-publisher .one-elevn-sound-modes {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.one-publisher .one-elevn-sound-mode-btn {
  flex: 1;
  padding: 8px 6px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

body.night-mode .one-publisher .one-elevn-sound-mode-btn {
  border-color: var(--card-dark-divider);
}

.one-publisher .one-elevn-sound-mode-btn:hover {
  background: rgba(0, 122, 255, 0.08);
}

.one-publisher .one-elevn-sound-mode-btn.active {
  background: #007AFF;
  color: #fff;
  border-color: #007AFF;
}

body.night-mode .one-publisher .one-elevn-sound-mode-btn.active {
  background: #007AFF;
  color: #fff;
  border-color: #007AFF;
}

.one-publisher .one-elevn-sound-mode-help {
  display: block;
  font-size: 11px;
  color: #888;
  line-height: 1.4;
}

body.night-mode .one-publisher .one-elevn-sound-mode-help {
  color: #999;
}

/* ===========================================
   ELEVN — ONE Sound Preview box CSS (2.D.3)
   Play/Stop preview combining the uploaded ONE video + selected sound
   =========================================== */

.one-publisher .one-elevn-sound-preview-box {
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(0, 122, 255, 0.04);
  border-radius: 10px;
}

body.night-mode .one-publisher .one-elevn-sound-preview-box {
  background: rgba(0, 122, 255, 0.08);
}

.one-publisher .one-elevn-sound-preview-box.x-hidden {
  display: none !important;
}

.one-publisher .one-elevn-sound-preview-head {
  margin-bottom: 10px;
}

.one-publisher .one-elevn-sound-preview-title {
  font-weight: 700;
  font-size: 13px;
}

.one-publisher .one-elevn-sound-preview-title i {
  color: #007AFF;
  margin-right: 6px;
}

.one-publisher .one-elevn-sound-preview-subtitle {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

body.night-mode .one-publisher .one-elevn-sound-preview-subtitle {
  color: #999;
}

.one-publisher .one-elevn-sound-preview-actions {
  display: flex;
  gap: 8px;
}

.one-publisher .one-elevn-sound-preview-actions .btn {
  flex: 1;
}

/* The dynamic preview video that gets injected by JS */
.one-publisher #one-elevn-inline-preview-video {
  width: 100%;
  margin-top: 10px;
  border-radius: 12px;
  background: #000;
  display: block;
  pointer-events: none;
}

/* ===========================================
   ELEVN — ONE Preview Toggle Play/Stop visual state (2.D.3)
   Single toggle button: blue Play <-> red Stop, full width
   =========================================== */

.one-publisher .one-elevn-preview-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.one-publisher .one-elevn-preview-toggle i {
  font-size: 12px;
}

.one-publisher .one-elevn-preview-toggle.is-playing {
  background: #DC3545;
  border-color: #DC3545;
  color: #fff;
}

.one-publisher .one-elevn-preview-toggle.is-playing:hover {
  background: #BB2D3B;
  border-color: #B02A37;
  color: #fff;
}

body.night-mode .one-publisher .one-elevn-preview-toggle.is-playing {
  background: #DC3545;
  border-color: #DC3545;
  color: #fff;
}

body.night-mode .one-publisher .one-elevn-preview-toggle.is-playing:hover {
  background: #BB2D3B;
  border-color: #B02A37;
}

.one-publisher .one-elevn-sound-preview-actions {
  gap: 0;
}

/* ===========================================
   ELEVN — ONE Publish button (2.E)
   Full-width primary button + inline error zone
   =========================================== */

.one-publisher .one-publish-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 15px;
  margin-top: 8px;
  transition: background-color 0.15s, opacity 0.15s;
}

.one-publisher .one-publish-btn i {
  font-size: 13px;
}

.one-publisher .one-publish-btn:disabled,
.one-publisher .one-publish-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.one-publisher .one-publish-btn:not(:disabled):hover {
  background: #3D5BE0;
  border-color: #3D5BE0;
}

.one-publisher .one-publish-error {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(220, 53, 69, 0.10);
  border: 1px solid rgba(220, 53, 69, 0.30);
  border-radius: 8px;
  color: #DC3545;
  font-size: 13px;
  line-height: 1.4;
}

body.night-mode .one-publisher .one-publish-error {
  background: rgba(220, 53, 69, 0.15);
  border-color: rgba(220, 53, 69, 0.40);
}

.one-publisher .one-publish-error.x-hidden {
  display: none !important;
}

/* ===========================================
   ELEVN - ONE Publish button (2.E min)
   Full-width primary button + inline error zone
   =========================================== */

.one-publisher .one-publish-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 15px;
  margin-top: 8px;
  transition: background-color 0.15s, opacity 0.15s;
}

.one-publisher .one-publish-btn i {
  font-size: 13px;
}

.one-publisher .one-publish-btn:disabled,
.one-publisher .one-publish-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.one-publisher .one-publish-btn:not(:disabled):hover {
  background: #3D5BE0;
  border-color: #3D5BE0;
}

.one-publisher .one-publish-error {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(220, 53, 69, 0.10);
  border: 1px solid rgba(220, 53, 69, 0.30);
  border-radius: 8px;
  color: #DC3545;
  font-size: 13px;
  line-height: 1.4;
}

body.night-mode .one-publisher .one-publish-error {
  background: rgba(220, 53, 69, 0.15);
  border-color: rgba(220, 53, 69, 0.40);
}

.one-publisher .one-publish-error.x-hidden {
  display: none !important;
}

/* ===========================================
   ELEVN — ONE upload progress bar (aligned with publisher-meta)
   Visually matches .publisher-meta[data-meta="reel"] so the progress bar
   appears in the SAME position/style as the success badge that will
   replace it when upload completes. Same margin, padding, background,
   border-radius — only the inner content differs.
   =========================================== */

.one-publisher .one-attachments-video {
  margin-top: 12px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-sizing: border-box;
}

body.night-mode .one-publisher .one-attachments-video {
  background: transparent;
}

.one-publisher .one-attachments-video:not(.x-hidden) {
  display: block !important;
}

.one-publisher .one-attachments-video:empty {
  display: none !important;
}

.one-publisher .one-attachments-video ul,
.one-publisher .one-attachments-video li.loading {
  width: 100%;
  padding: 0;
  margin: 0;
  list-style: none;
  background: transparent;
  box-sizing: border-box;
}

.one-publisher .one-attachments-video .progress {
  width: 100%;
  height: 44px;
  margin: 0;
  background: rgba(0, 122, 255, 0.15);
  border: 0;
  box-shadow: none;
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
}

body.night-mode .one-publisher .one-attachments-video .progress {
  background: rgba(0, 122, 255, 0.18);
}

.one-publisher .one-attachments-video .progress-bar {
  height: 100%;
  background: #007AFF;
  border-radius: 8px 0 0 8px;
  box-shadow: none;
  transition: width 0.2s ease;
}

/* Hide the upload trigger while progress bar is showing
   (mirrors the rule for publisher-meta[data-meta="reel"]) */
.one-publisher .one-attachments-video:not(:empty) ~ .one-upload-trigger {
  display: none;
}

/* ============================================================
   ELEVN — Clean modern feed (19/06/2026)
   Masque le filtre legacy Sngine (Recent Updates / All dropdown)
   pour un feed continu style TikTok/Instagram
   Note: la logique backend reste intacte (filtre "all" par defaut)
   Pour revenir: retirer ce bloc ou backup .bak-FEEDCLEAN-20260619
   ============================================================ */
.posts-filter {
  display: none !important;
}
