/* css/timetable-edit.css — Inline edit-row + add-row form, attachment-section, attach-overlay viewer. Imported into the components layer. */

/* ── Inline edit-row (Section 9 edit-row from legacy.css) ─── */
/* Edit mode row */
.timetable-row--editing td {
  background: rgba(232, 168, 56, 0.06) !important;
  padding: var(--space-2) var(--space-2);
  cursor: default;
}

.timetable-row--editing input,
.timetable-row--editing select {
  font-size: 0.8rem;
  padding: 3px 6px;
  width: 100%;
  min-width: 0;
}

.timetable-row--editing .edit-time {
  width: 80px;
  font-family: var(--font-mono);
}

.timetable-row--editing .edit-notes {
  min-width: 100px;
}

.timetable-row--editing .edit-slot-notes {
  min-width: 100px;
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.timetable-row--editing .edit-slot-offset {
  width: 48px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.dup-row-btn {
  opacity: 0;
  transition: opacity 0.15s;
  margin-left: var(--space-1);
  vertical-align: middle;
}

.timetable-row:hover .dup-row-btn {
  opacity: 1;
}

@media (hover: none) {
  .dup-row-btn {
    opacity: 1;
    min-width: 32px;
    min-height: 32px;
  }
}

.timetable-row__actions {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  white-space: nowrap;
}

/* Phase 5: extra editing row (mode, duration, alert, auto-advance) */
.timetable-row--editing-extra td {
  background: rgba(232, 168, 56, 0.04) !important;
  padding: var(--space-2) var(--space-2);
  cursor: default;
}

.timetable-row__mode-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.edit-mode-label,
.edit-duration-label,
.edit-alert-label,
.edit-aa-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.edit-mode-label select.edit-mode {
  font-size: 0.8rem;
  padding: 3px 6px;
  width: auto;
  min-width: 0;
}

.edit-duration {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 3px 6px;
  width: 72px;
  text-align: center;
}

.edit-duration:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.edit-alert-label input[type="checkbox"],
.edit-aa-label input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent-amber);
}

/* ── Attach-overlay (Section 10c from legacy.css) ─── */
.attach-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  z-index: 300;
}

.attach-overlay[hidden] { display: none; }

.attach-overlay__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border-bottom: 1px solid rgba(240, 236, 228, 0.08);
}

.attach-overlay__filename {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-overlay__frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

/* ── Slot attachments edit-section (Section 10d from legacy.css MINUS .timetable-row__attach-btn which routed to timetable-table.css per R-PATTERNS-CW2-4) ─── */
/* Attach section inside the editing extra row */
.edit-attach-section {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Current attachment display (name + size + remove button) */
.attach-current {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.attach-name {
  font-size: 0.75rem;
  color: var(--text-primary);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-size {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.attach-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0 2px;
  line-height: 1;
}

.attach-remove-btn:hover {
  color: var(--color-error, #ef4444);
}
