/* ===============================
   SCREENPLAY OUTLINE PANEL
   Scene-level outline cards in a right-side slide panel.
   Shares panel infrastructure with notes (same wrapper, same transitions).
   =============================== */

/* Panel shell — identical sizing/transition to .notes-panel */
.outline-panel {
  width: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-panel);
  border-left: none;
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease, min-width 0.25s ease;
  opacity: 0;
  pointer-events: none;
}

.outline-panel.outline-panel-open {
  width: 320px;
  min-width: 320px;
  opacity: 1;
  border-left: 1px solid var(--border);
  pointer-events: auto;
  transition: width 0.25s ease, min-width 0.25s ease, opacity 0.15s ease 0.1s;
}

/* Panel Header */
.outline-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.outline-panel-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.outline-panel-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 6px;
}

.outline-panel-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.outline-panel-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.outline-panel-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Panel Content */
.outline-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
}

.outline-panel-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.outline-panel-empty svg {
  display: block;
  margin: 0 auto 12px;
  opacity: 0.3;
}

/* ===============================
   SCENE CARD
   =============================== */

.outline-scene-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 5px;
  margin-bottom: 6px;
  transition: border-color 0.15s ease;
  overflow: hidden;
}

.outline-scene-card:hover {
  border-color: var(--accent-muted);
}

/* Color stripe on left edge */
.outline-scene-card[data-color] {
  border-left-width: 3px;
}

/* Card Header (clickable — navigates to scene) */
.outline-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.outline-card-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.outline-card-number {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.outline-card-heading {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.outline-card-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.outline-scene-card:hover .outline-card-actions {
  opacity: 1;
}

.outline-card-action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.outline-card-action-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.outline-card-action-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Note count badge on card */
.outline-card-note-count {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 8px;
  flex-shrink: 0;
}

/* Card Body (synopsis + preview) */
.outline-card-body {
  padding: 0 10px 8px 10px;
}

.outline-card-preview {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-secondary);
  opacity: 0.6;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: "Courier Prime", "Courier New", Courier, monospace;
}

/* Synopsis display */
.outline-card-synopsis {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Synopsis inline edit */
.outline-synopsis-input {
  width: 100%;
  min-height: 36px;
  max-height: 80px;
  padding: 5px 7px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: 11px;
  font-family: var(--font-ui);
  line-height: 1.4;
  resize: vertical;
  margin-bottom: 4px;
}

.outline-synopsis-input:focus {
  outline: none;
}

.outline-synopsis-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.4;
}

.outline-synopsis-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.outline-synopsis-actions .btn {
  font-size: 10px;
  padding: 2px 8px;
}

/* ===============================
   COLOR PICKER
   =============================== */

.outline-color-picker {
  display: flex;
  gap: 4px;
  padding: 6px 10px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.outline-color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.outline-color-swatch:hover {
  transform: scale(1.15);
}

.outline-color-swatch.swatch-active {
  border-color: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

/* "No color" swatch */
.outline-color-swatch-none {
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  position: relative;
}

.outline-color-swatch-none::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 1px;
  background: var(--text-secondary);
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Toggle button active state */
.outline-toggle-btn.outline-active {
  color: var(--accent) !important;
  background: rgba(209, 139, 60, 0.12) !important;
}

/* ===============================
   PRINT — hide outline panel
   =============================== */

@media print {
  .outline-panel,
  .outline-toggle-btn {
    display: none !important;
  }
}
