/* ═══════════════════════════════════════════════════════════════
   SOCIALYN SIDE-PANEL V2 STYLES
   Slide-Panel von links (Desktop) mit Fullscreen-Fallback (Mobile)
   ═══════════════════════════════════════════════════════════════ */

/* Backdrop */
#sidePanelBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9990;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#sidePanelBackdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Panel */
#sidePanel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 50%;
  min-width: 560px;
  max-width: 900px;
  background: var(--bg, #1a1c21);
  border-right: 1px solid var(--border, #3a3c41);
  z-index: 9991;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 4px 0 30px rgba(0, 0, 0, 0.4);
}
#sidePanel.active {
  transform: translateX(0);
}

/* Mobile: Fullscreen */
@media (max-width: 768px) {
  #sidePanel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    left: 0;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
}

/* ─── Header ─── */
.sp-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  flex-shrink: 0;
}
.sp-header-left {
  flex: 1;
  min-width: 0;
}
.sp-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink, #fff);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  word-break: break-word;
}
.sp-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}
.sp-meta-sep {
  color: var(--ink-sec, #999);
}
.sp-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.sp-badge-reel { background: rgba(236, 72, 153, 0.15); color: #f472b6; border-color: rgba(236, 72, 153, 0.3); }
.sp-badge-post { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border-color: rgba(59, 130, 246, 0.3); }
.sp-badge-story { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border-color: rgba(139, 92, 246, 0.3); }
.sp-badge-carousel { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.sp-badge-longform { background: rgba(249, 115, 22, 0.15); color: #fb923c; border-color: rgba(249, 115, 22, 0.3); }

.sp-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}
.sp-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.sp-status-published { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.sp-status-done { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.sp-status-draft { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }
.sp-status-in_progress { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }

.sp-close {
  background: transparent;
  border: 1px solid var(--border, #3a3c41);
  color: var(--ink-sec, #999);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.sp-close:hover {
  background: var(--border, #3a3c41);
  color: var(--ink, #fff);
}

/* ─── Body (scrollbar) ─── */
.sp-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  -webkit-overflow-scrolling: touch;
}
.sp-body::-webkit-scrollbar { width: 8px; }
.sp-body::-webkit-scrollbar-thumb { background: var(--border, #3a3c41); border-radius: 4px; }

/* ─── Section ─── */
.sp-section {
  padding: 18px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sp-section:first-child { padding-top: 4px; }
.sp-section:last-child { border-bottom: none; padding-bottom: 4px; }

.sp-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink, #fff);
  letter-spacing: -0.01em;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sp-section-meta {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-faint, #666);
}

/* ─── Fields ─── */
.sp-field {
  margin-bottom: 14px;
}
.sp-field:last-child {
  margin-bottom: 0;
}
.sp-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-sec, #999);
  margin-bottom: 6px;
}
.sp-optional {
  font-weight: 400;
  color: var(--ink-faint, #666);
  font-size: 11px;
  margin-left: 4px;
}
.sp-required {
  color: #ef4444;
}
.sp-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, #3a3c41);
  border-radius: 8px;
  color: var(--ink, #fff);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
}
.sp-input:focus {
  outline: none;
  border-color: var(--accent, #f5c063);
  background: rgba(255,255,255,0.05);
}
.sp-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* Grids */
.sp-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sp-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 768px) {
  .sp-grid-2, .sp-grid-3 { grid-template-columns: 1fr; }
}

/* ─── Plattformen ─── */
.sp-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sp-plat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, #3a3c41);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.sp-plat:hover {
  border-color: var(--ink-sec, #999);
}
.sp-plat.active {
  border-color: var(--accent, #f5c063);
  background: rgba(245, 192, 99, 0.08);
}
.sp-plat input[type="checkbox"] {
  margin: 0;
}

/* ─── Read-only ─── */
.sp-readonly-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink, #fff);
  white-space: pre-wrap;
}

.sp-checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 0;
  font-size: 14px;
}

/* ─── Actions Inline ─── */
.sp-actions-inline {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ─── File-Items ─── */
.sp-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 13px;
}
.sp-file-item a {
  flex: 1;
  color: var(--accent, #f5c063);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-file-size {
  font-size: 11px;
  color: var(--ink-faint, #666);
}
.sp-file-input {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-sec, #999);
}

/* ─── Buttons ─── */
.sp-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.08s, opacity 0.15s, background 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
}
.sp-btn:active { transform: scale(0.97); }
.sp-btn-primary {
  background: var(--accent, #f5c063);
  color: #000;
}
.sp-btn-primary:hover { opacity: 0.9; }
.sp-btn-secondary {
  background: rgba(255,255,255,0.04);
  color: var(--ink, #fff);
  border: 1px solid var(--border, #3a3c41);
}
.sp-btn-secondary:hover { background: var(--border, #3a3c41); }
.sp-btn-danger {
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.sp-btn-danger:hover { background: rgba(239, 68, 68, 0.1); }

.sp-btn-icon {
  background: transparent;
  border: none;
  color: var(--ink-faint, #666);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 4px;
}
.sp-btn-icon:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ─── Footer ─── */
.sp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  flex-shrink: 0;
}
.sp-footer-right {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

/* ─── Loading ─── */
.sp-loading {
  padding: 20px;
  text-align: center;
  color: var(--ink-sec, #999);
  font-size: 13px;
  font-style: italic;
}


/* ─── Header Actions ─── */
.sp-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sp-btn-small {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* ─── Section Fields Grid (2 Spalten für kompakte Felder) ─── */
.sp-section-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.sp-field-wide {
  grid-column: 1 / -1;
}
@media (max-width: 768px) {
  .sp-section-fields { grid-template-columns: 1fr; }
}


/* ═══════════════════════════════════════════════════════════════
   FIELD CONFIG MANAGER STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Scope Toggle */
.fcm-scope-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  margin-bottom: 12px;
}
.fcm-scope-btn {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--ink-sec, #999);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.fcm-scope-btn.active {
  background: var(--accent, #f5c063);
  color: #000;
  font-weight: 600;
}
.fcm-scope-btn:hover:not(.active) {
  color: var(--ink, #fff);
}

/* Info banner */
.fcm-info {
  font-size: 12px;
  color: var(--ink-sec, #999);
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  margin-bottom: 14px;
  line-height: 1.4;
}
.fcm-link {
  background: none;
  border: none;
  color: var(--accent, #f5c063);
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  text-decoration: underline;
  font-family: inherit;
}

/* New Section Controls */
.fcm-sections-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.fcm-input-inline {
  flex: 1;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, #3a3c41);
  border-radius: 6px;
  color: var(--ink, #fff);
  font-size: 13px;
  font-family: inherit;
}
.fcm-input-inline:focus {
  outline: none;
  border-color: var(--accent, #f5c063);
}
.fcm-btn-sm {
  padding: 8px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #3a3c41);
  border-radius: 6px;
  color: var(--ink, #fff);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.fcm-btn-sm:hover {
  background: var(--border, #3a3c41);
}

/* List container */
.fcm-list {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid var(--border, #3a3c41);
  border-radius: 8px;
  padding: 6px;
  background: rgba(0,0,0,0.15);
}

/* Row */
.fcm-row {
  display: grid;
  grid-template-columns: 20px 22px 1fr 160px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  border-radius: 6px;
  margin-bottom: 4px;
  transition: border-color 0.1s, background 0.1s;
  cursor: default;
}
.fcm-row:hover {
  background: rgba(255,255,255,0.05);
}
.fcm-row.dragging {
  opacity: 0.4;
}
.fcm-row.fcm-drop-hint {
  border-color: var(--accent, #f5c063);
  background: rgba(245, 192, 99, 0.08);
}

.fcm-handle {
  color: var(--ink-faint, #666);
  cursor: grab;
  user-select: none;
  font-size: 14px;
  line-height: 1;
  text-align: center;
  letter-spacing: -3px;
}
.fcm-handle:active { cursor: grabbing; }

.fcm-check {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.fcm-check input {
  cursor: pointer;
  width: 16px; height: 16px;
}

.fcm-label {
  font-size: 13px;
  color: var(--ink, #fff);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fcm-type-tag {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  font-size: 10px;
  color: var(--ink-sec, #999);
  margin-left: 6px;
}
.fcm-override-badge {
  color: var(--accent, #f5c063);
  font-size: 20px;
  line-height: 0;
  margin-left: 6px;
  font-weight: 700;
}

.fcm-section-select {
  padding: 4px 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, #3a3c41);
  border-radius: 4px;
  color: var(--ink, #fff);
  font-size: 12px;
  font-family: inherit;
}


/* Field-Config-Manager als Slide-Panel */
.fcm-body-wrapper {
  padding: 20px 24px;
}
.fcm-body-wrapper .modal-title {
  display: none; /* Der Titel ist schon im sp-header */
}
.fcm-body-wrapper .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}


/* ═══════════════════════════════════════════════════════════════
   Segment-Control Sub-Tabs (iOS/macOS-Style)
   Überschreibt die alten .sub-tabs / .sub-tab Styles
   ═══════════════════════════════════════════════════════════════ */

.sub-tabs {
  display: inline-flex !important;
  gap: 4px !important;
  padding: 4px !important;
  background: rgba(255,255,255,0.05) !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  margin-bottom: 20px !important;
  width: auto !important;
}

.sub-tab {
  padding: 8px 18px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 8px !important;
  color: var(--ink-sec, #999) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  transition: background 0.15s, color 0.15s !important;
  white-space: nowrap !important;
}

.sub-tab:hover:not(.active) {
  color: var(--ink, #fff) !important;
  background: rgba(255,255,255,0.03) !important;
}

.sub-tab.active {
  background: rgba(255,255,255,0.12) !important;
  color: var(--ink, #fff) !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(255,255,255,0.06) !important;
}
