* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --success: #10b981;
  --success-hover: #059669;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #475569;
  --shadow: rgba(0, 0, 0, 0.3);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  text-align: center;
  padding: 30px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Main Layout */
.main {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
}

/* Session Panel */
.session-panel {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 20px;
}

.session-panel h2 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.session-item:hover {
  background: var(--bg);
  border-color: var(--primary);
}

.session-item.active {
  background: var(--primary);
  border-color: var(--primary);
}

.session-info {
  flex: 1;
  cursor: pointer;
}

.session-item .session-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.session-item .session-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.session-item.active .session-meta {
  color: rgba(255, 255, 255, 0.8);
}

.session-delete-btn {
  background: transparent;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 4px;
  opacity: 0.5;
  transition: all 0.2s;
}

.session-delete-btn:hover {
  background: var(--danger);
  opacity: 1;
}

.session-item.active .session-delete-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Editor Panel */
.editor-panel {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 25px;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.editor-header h2 {
  font-size: 1.4rem;
}

.editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.editor-info {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 10px 15px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  font-size: 0.9rem;
}

.editor-info span {
  color: var(--text-muted);
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: var(--success-hover);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

/* Steps Container */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Step Card */
.step-card {
  display: grid;
  grid-template-columns: auto 200px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px;
  background: var(--bg);
  border-radius: 12px;
  border: 2px solid var(--border);
  transition: all 0.2s;
  cursor: grab;
}

.step-card:hover {
  border-color: var(--primary);
}

.step-card.dragging {
  opacity: 0.5;
  border-style: dashed;
}

.step-card.drag-over {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.step-card.excluded {
  opacity: 0.5;
  border-color: var(--bg-tertiary);
}

.step-card.excluded .step-thumbnail {
  filter: grayscale(100%);
}

/* Step Number & Checkbox */
.step-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.step-number {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  font-weight: bold;
  border-radius: 50%;
  font-size: 1.1rem;
}

.step-card.excluded .step-number {
  background: var(--bg-tertiary);
}

.step-checkbox {
  width: 24px;
  height: 24px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* Step Thumbnail */
.step-thumbnail {
  width: 200px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  border: 1px solid var(--border);
}

.step-thumbnail:hover {
  transform: scale(1.05);
}

/* Step Details */
.step-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-description {
  font-size: 1rem;
  font-weight: 500;
}

.step-url {
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-all;
}

.step-meta {
  display: flex;
  gap: 15px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.step-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Step Actions */
.step-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-actions .btn {
  padding: 8px 12px;
  font-size: 0.85rem;
}

/* Drag Handle */
.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 1.5rem;
  user-select: none;
}

.drag-handle:hover {
  color: var(--text);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  font-size: 2rem;
  color: white;
  cursor: pointer;
}

#preview-image {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
}

.preview-details {
  margin-top: 15px;
  padding: 15px;
  background: var(--bg-secondary);
  border-radius: 8px;
  color: var(--text);
  max-width: 800px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 15px 25px;
  background: var(--success);
  color: white;
  border-radius: 8px;
  font-weight: 600;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 1001;
}

.toast.active {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  background: var(--danger);
}

/* Loading */
.loading {
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 1024px) {
  .main {
    grid-template-columns: 1fr;
  }

  .session-panel {
    position: static;
  }

  .step-card {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .step-thumbnail {
    grid-column: 1 / -1;
    width: 100%;
    height: 200px;
  }

  .step-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }
}

/* ============================================
   BLUR EDITOR STYLES
   ============================================ */

.blur-modal {
  background: rgba(0, 0, 0, 0.95);
}

.blur-editor-container {
  width: 95%;
  max-width: 1600px;
  height: 95vh;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-radius: 16px;
  overflow: hidden;
}

.blur-editor-header {
  padding: 20px 25px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

.blur-editor-header h3 {
  font-size: 1.4rem;
  margin-bottom: 5px;
}

.blur-editor-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.blur-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 15px 25px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-group label {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.blur-tools {
  display: flex;
  gap: 6px;
}

.blur-tools .btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.blur-tools .btn.active {
  background: var(--primary);
  color: white;
}

.blur-tools .btn span {
  font-size: 1rem;
}

/* Color Picker */
.color-picker-group {
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.color-options {
  display: flex;
  gap: 6px;
}

.color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
}

/* Line width slider */
.tool-group input[type="range"] {
  width: 80px;
  accent-color: var(--primary);
}

.tool-group > span {
  color: var(--text);
  font-size: 0.8rem;
  min-width: 35px;
}

.blur-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.blur-canvas-wrapper {
  flex: 1;
  overflow: auto;
  background: var(--bg);
  position: relative;
  padding: 20px;
}

#blur-canvas {
  cursor: crosshair;
  border: 2px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 40px var(--shadow);
  display: block;
  margin: 0 auto;
}

.blur-hint {
  padding: 12px 25px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border);
  text-align: center;
}

.blur-hint span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Blur tool button colors */
#tool-blur.active {
  background: #3b82f6;
}

#tool-pixelate.active {
  background: #8b5cf6;
}

#tool-blackout.active {
  background: #1f2937;
  border: 1px solid var(--border);
}

#tool-arrow.active {
  background: #ef4444;
}

#tool-rectangle.active {
  background: #f59e0b;
}

/* Mobile responsive for blur editor */
@media (max-width: 768px) {
  .blur-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .blur-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
  
  .blur-tools {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   EXPORT MODAL STYLES
   ============================================ */

.export-dialog {
  background: var(--bg-secondary);
  border-radius: 16px;
  width: 500px;
  max-width: 95%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.export-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

.export-header h3 {
  font-size: 1.3rem;
  margin: 0;
}

.export-header .modal-close {
  position: static;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.export-header .modal-close:hover {
  color: var(--text);
}

.export-body {
  padding: 25px;
}

.export-info {
  margin-bottom: 20px;
  color: var(--text-muted);
}

.export-info strong {
  color: var(--primary);
}

.export-option {
  margin-bottom: 15px;
}

.export-option label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text);
}

.export-option input[type="radio"],
.export-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.export-custom-path {
  margin: 15px 0 20px 28px;
  padding: 15px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.export-custom-path label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.path-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 0.95rem;
  font-family: monospace;
}

.path-input:focus {
  outline: none;
  border-color: var(--primary);
}

.export-custom-path small {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.export-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 25px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border);
}

/* ============================================
   DELETE CONFIRMATION MODAL
   ============================================ */

.delete-dialog {
  background: var(--bg-secondary);
  border-radius: 16px;
  width: 420px;
  max-width: 95%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.delete-header {
  padding: 20px 25px;
  background: var(--danger);
  color: white;
}

.delete-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.delete-body {
  padding: 25px;
}

.delete-body p {
  margin-bottom: 10px;
  color: var(--text);
}

.delete-session-name {
  padding: 10px 15px;
  background: var(--bg);
  border-radius: 6px;
  font-family: monospace;
  word-break: break-all;
}

.delete-warning {
  margin-top: 15px !important;
  color: var(--danger) !important;
  font-size: 0.9rem;
}

.delete-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 25px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border);
}
/* ============================================
   TEXT INPUT MODAL
   ============================================ */

.text-input-modal {
  z-index: 1100; /* Above blur modal */
  background: rgba(0, 0, 0, 0.8);
}

.text-input-modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.text-input-dialog {
  background: var(--bg-secondary);
  border-radius: 16px;
  width: 450px;
  max-width: 95%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.text-input-header {
  padding: 20px 25px;
  background: var(--primary);
  color: white;
}

.text-input-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.text-input-body {
  padding: 25px;
}

.text-input-body label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 500;
}

.text-input-field {
  width: 100%;
  padding: 12px 15px;
  font-size: 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 20px;
}

.text-input-field:focus {
  outline: none;
  border-color: var(--primary);
}

.text-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.text-option {
  display: flex;
  align-items: center;
  gap: 15px;
}

.text-option label {
  min-width: 90px;
  margin-bottom: 0;
  font-size: 14px;
}

.text-bg-colors,
.text-colors {
  display: flex;
  gap: 6px;
}

.text-bg-colors .color-btn,
.text-colors .color-btn {
  width: 28px;
  height: 28px;
}

.font-size-select {
  padding: 8px 12px;
  font-size: 14px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.font-size-select:focus {
  outline: none;
  border-color: var(--primary);
}

.text-input-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 25px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border);
}

/* ============================================
   METADATA EDITOR STYLES
   ============================================ */

.metadata-editor {
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.metadata-section h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text);
}

.metadata-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.metadata-required {
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.form-group label .required {
  color: var(--danger);
}

.form-group label small {
  font-weight: normal;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text);
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-input::placeholder {
  color: var(--text-muted);
}

textarea.form-input {
  resize: vertical;
  min-height: 60px;
}

select.form-input {
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Tags Input */
.tags-input-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  min-height: 46px;
}

.tags-input-container:focus-within {
  border-color: var(--primary);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.tag.prereq {
  background: var(--success);
}

.tag-remove {
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.8;
}

.tag-remove:hover {
  opacity: 1;
}

.tags-input {
  flex: 1;
  min-width: 120px;
  padding: 6px 0;
  border: none !important;
  background: transparent !important;
}

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

/* Optional Fields Collapsible */
.metadata-optional,
.metadata-auto,
.metadata-fields {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.metadata-optional summary,
.metadata-auto summary,
.metadata-fields summary {
  padding: 12px 16px;
  background: var(--bg-secondary);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.metadata-optional summary:hover,
.metadata-auto summary:hover,
.metadata-fields summary:hover {
  background: var(--bg);
}

.optional-fields-content,
.auto-fields-content,
.field-mappings-list {
  padding: 16px;
  background: var(--bg-secondary);
}

/* Custom Fields */
.custom-fields-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.custom-field-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 10px;
  align-items: center;
}

.custom-key,
.custom-value {
  font-size: 0.9rem;
}

/* Auto-Detected Fields (Read-Only) */
.auto-field {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.auto-field:last-child {
  border-bottom: none;
}

.auto-label {
  font-weight: 600;
  min-width: 130px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auto-value {
  color: var(--text);
  font-size: 0.9rem;
  word-break: break-all;
}

.auto-value.badge {
  display: inline-block;
  padding: 2px 10px;
  background: var(--warning);
  color: #000;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Field Mappings */
.field-mapping-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  margin-bottom: 8px;
}

.field-mapping-item:last-child {
  margin-bottom: 0;
}

.field-key {
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 600;
}

.field-details {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.field-type {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--bg);
  border-radius: 10px;
  color: var(--text-muted);
}

.field-type.sensitive {
  background: var(--danger);
  color: white;
}

/* Metadata Actions */
.metadata-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* Empty Hints */
.empty-hint {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* Small Button */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Prereqs Input */
.prereqs-input-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  min-height: 46px;
}

.prereqs-input-container:focus-within {
  border-color: var(--primary);
}

/* ============================================
   ANNOTATION EDITOR STYLES (Schema 2.2)
   ============================================ */

.annotation-modal {
  background: rgba(0, 0, 0, 0.95);
}

.annotation-editor-container {
  width: 98%;
  max-width: 1800px;
  height: 95vh;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
}

/* Header */
.annotation-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

.annotation-nav {
  display: flex;
  align-items: center;
  gap: 15px;
}

.annotation-nav span {
  font-weight: 600;
  color: var(--text);
}

.annotation-header-actions {
  display: flex;
  gap: 10px;
}

/* Body */
.annotation-editor-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Canvas Area */
.annotation-canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.annotation-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 12px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.annotation-tools {
  display: flex;
  gap: 6px;
}

.annotation-tools button {
  min-width: 40px;
  padding: 8px 10px;
}

.annotation-tools button.active {
  background: var(--primary);
  color: white;
}

.annotation-canvas-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: auto;
  padding: 20px;
  background: #1a1a2e;
}

#annotation-canvas {
  border: 2px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Sidebar */
.annotation-sidebar {
  width: 320px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-left: 1px solid var(--border);
  overflow-y: auto;
}

.annotation-metadata-section,
.annotation-list-section,
.actionable-fields-section {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.annotation-metadata-section h3,
.annotation-list-section h3,
.actionable-fields-section h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text);
}

.btn-full {
  width: 100%;
}

/* Annotation List */
.annotation-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.annotation-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.annotation-item:hover {
  background: var(--bg-tertiary);
}

.annotation-item.selected {
  background: var(--primary);
  color: white;
}

/* Permanent redaction info */
.redact-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #fef3cd 0%, #fff8e1 100%);
  border: 1px solid #ffc107;
  border-radius: 6px;
  color: #856404;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 10px;
}

.redact-info.pending {
  background: linear-gradient(135deg, #fff3cd 0%, #ffecb5 100%);
  border-color: #ff9800;
  color: #8a5a00;
}

/* Pending redaction item styling */
.annotation-item.redact-pending {
  border-left: 3px solid #ff9800;
  background: rgba(255, 152, 0, 0.1);
}

.annotation-icon {
  font-size: 1.1rem;
}

.annotation-label {
  flex: 1;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.annotation-delete-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.5;
  padding: 4px;
}

.annotation-delete-btn:hover {
  opacity: 1;
}

/* Actionable Fields List */
.actionable-fields-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.actionable-field-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
}

.actionable-field-item .field-info {
  flex: 1;
}

.actionable-field-item .field-action {
  display: inline-block;
  padding: 2px 6px;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-right: 8px;
}

.actionable-field-item .field-instruction {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Footer */
.annotation-editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border);
}

.annotation-status {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.annotation-footer-actions {
  display: flex;
  gap: 10px;
}

/* Text Input Modal */
.annotation-text-modal {
  z-index: 1100;
}

.annotation-text-dialog {
  width: 400px;
  max-width: 90%;
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
}

.annotation-text-header {
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

.annotation-text-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.annotation-text-body {
  padding: 20px;
}

.annotation-text-body .form-group {
  margin-bottom: 16px;
}

.annotation-text-body .form-row {
  display: flex;
  gap: 16px;
}

.annotation-text-body .form-row .form-group {
  flex: 1;
}

.annotation-text-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

/* Step Card Enhancements */
.step-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.annotation-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.step-user-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
  .annotation-sidebar {
    width: 280px;
  }
}

@media (max-width: 900px) {
  .annotation-editor-body {
    flex-direction: column;
  }
  
  .annotation-sidebar {
    width: 100%;
    max-height: 300px;
  }
  
  .annotation-canvas-wrapper {
    min-height: 400px;
  }
}