/* =====================================
   Project Settings — Lína Style
   Uses shared .screenplay-page / .screenplay-header / .screenplay-canvas
   ===================================== */

.project-page {
  /* Inherits flex column + height:100% from .screenplay-page */
  border-width: 0px !important;
}

.project-header {
  border-bottom: 0px !important;
}

/* ===============================
   SECTION HEADER (inside .screenplay-header)
   =============================== */

.project-header .project-header-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-muted) 100%);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-header .project-header-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

/* project-header-name removed — project name no longer shown in header */

/* ===============================
   CANVAS AREA
   =============================== */

.project-canvas {
  background: transparent !important;
  border-width: 0px;
}

.project-container {
  width: 100%;
}

/* ===============================
   SECTION CARDS
   =============================== */

.project-section {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}

.project-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  min-height: 0;
}

.project-section-header .btn {
  height: auto;
  padding: 6px 14px;
  font-size: 12px;
  line-height: 1;
}

.project-section-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-section-title .section-icon {
  font-size: 16px;
  opacity: 0.7;
}

.project-section-body {
  padding: 20px;
}

.project-section-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ===============================
   PRODUCTION TIMELINE BAR
   =============================== */

.timeline-bar-container {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 52px 14px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-bar-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 0;
}

.timeline-bar-empty-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.timeline-bar-track {
  position: relative;
  height: 26px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  overflow: hidden;
}

.timeline-bar-segment {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: opacity 0.15s ease;
  overflow: hidden;
  min-width: 2px;
}

.timeline-bar-segment:hover {
  opacity: 1;
}

.timeline-bar-segment-label {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.timeline-bar-today {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  z-index: 2;
}

.timeline-bar-today-line {
  width: 2px;
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
  box-shadow: 0 0 4px rgba(209, 139, 60, 0.5);
}

.timeline-bar-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  position: relative;
}

.timeline-bar-date {
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.timeline-bar-today-label {
  position: absolute;
  transform: translateX(-50%);
  color: var(--accent);
}

.timeline-edit-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.timeline-edit-btn svg {
  width: 14px;
  height: 14px;
}

.timeline-edit-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--accent-muted);
}

/* Timeline edit modal phases */
.timeline-modal-phases {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-modal-phase {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-input, #1a1a1e);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s ease;
}

.timeline-modal-phase:focus-within {
  border-color: var(--accent);
}

.timeline-modal-phase-info {
  width: 110px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-modal-phase-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.timeline-modal-phase-duration {
  font-size: 11px;
  color: var(--text-secondary);
  min-height: 14px;
}

.timeline-modal-phase-dates {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Shared phase indicator dots */
.phase-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.phase-indicator.pre-prod {
  background: #3498db;
}

.phase-indicator.production {
  background: #2ecc71;
}

.phase-indicator.post-prod {
  background: #9b59b6;
}

/* Shared phase date inputs */
.phase-date-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color 0.15s ease, background 0.15s ease;
  box-sizing: border-box;
}

.phase-date-input:hover {
  background: rgba(0,0,0,0.3);
}

.phase-date-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0,0,0,0.3);
}

.phase-separator {
  color: var(--text-tertiary);
  font-size: 12px;
}

/* ===============================
   PRODUCTION OFFICE
   =============================== */

.production-office-fields {
  min-height: 60px;
}

.po-loading,
.po-empty {
  text-align: center;
  padding: 20px 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

.po-empty-text {
  line-height: 1.5;
}

/* Read-only display */
.po-display {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.po-display-company {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.po-display-row {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.po-display-label {
  width: 60px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding-top: 1px;
}

.po-display-value {
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.po-display-value a {
  color: var(--accent);
  text-decoration: none;
}

.po-display-value a:hover {
  text-decoration: underline;
}

/* Edit form */
.po-edit-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.po-field-row {
  display: flex;
  gap: 10px;
}

.po-field-row-3 {
  gap: 10px;
}

.po-field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.po-field-full {
  flex: 1 1 100%;
}

.po-field input,
.po-field textarea {
  width: 100%;
  padding: 8px 12px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-ui);
  transition: border-color 0.15s ease, background 0.15s ease;
  box-sizing: border-box;
}

.po-field input:hover,
.po-field textarea:hover {
  background: rgba(0,0,0,0.3);
}

.po-field input:focus,
.po-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0,0,0,0.3);
}

.po-field textarea {
  resize: vertical;
  min-height: 40px;
}

/* ===============================
   TWO-COLUMN SECTION ROW
   =============================== */

.project-section-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.project-section-half {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

/* ===============================
   CHARACTERS LIST
   =============================== */

.characters-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 400px;
  overflow-y: auto;
}

.character-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-input, #1a1a1e);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.15s ease;
}

.character-item:hover {
  border-color: var(--accent-muted);
}

.character-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.3px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.character-source {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.source-parsed {
  background: rgba(52, 152, 219, 0.15);
  color: #5dade2;
}

.source-manual {
  background: rgba(155, 89, 182, 0.15);
  color: #bb8fce;
}

.character-delete {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.character-item:hover .character-delete {
  opacity: 1;
}

.characters-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-secondary);
}

.characters-empty-text {
  font-size: 13px;
  line-height: 1.5;
}

.characters-loading {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ===============================
   DRAFTS LIST
   =============================== */

.drafts-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.draft-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-input, #1a1a1e);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.draft-card:hover {
  border-color: var(--accent-muted);
  background: var(--bg-elevated);
}

.draft-card.draft-current {
  border-color: rgba(46, 204, 113, 0.5);
  background: rgba(46, 204, 113, 0.05);
}

.draft-icon {
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.draft-current .draft-icon {
  background: rgba(46, 204, 113, 0.15);
}

.draft-info {
  flex: 1;
  min-width: 0;
}

.draft-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draft-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.draft-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.draft-badge-current {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.draft-actions {
  display: flex;
  gap: 6px;
}

.draft-empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-secondary);
}

.draft-empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.draft-empty-text {
  font-size: 14px;
  margin-bottom: 16px;
}

/* ===============================
   DANGER ZONE
   =============================== */

.danger-zone {
  border-color: rgba(231, 76, 60, 0.3);
}

.danger-zone .project-section-header {
  background: rgba(231, 76, 60, 0.08);
}

.danger-zone .project-section-title {
  color: #e74c3c;
}

.danger-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.danger-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.danger-item:first-child {
  padding-top: 0;
}

.danger-info h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.danger-info p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* ===============================
   LOADING STATE
   =============================== */

.project-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text-secondary);
  gap: 14px;
}

.project-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===============================
   PROJECT STATS BAR
   =============================== */

.project-stats-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.project-stats-bar .stat-card {
  flex: 1;
  min-width: 80px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 10px;
  text-align: center;
  transition: border-color 0.15s ease;
}

.project-stats-bar .stat-card:hover {
  border-color: var(--accent-muted);
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

/* Location coverage progress bar removed */

/* ===============================
   LOCATIONS LIST
   =============================== */

.locations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.location-card {
  background: var(--bg-input, #1a1a1e);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  transition: border-color 0.15s ease;
}

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

.location-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.location-card-info {
  flex: 1;
  min-width: 0;
}

.location-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.location-address {
  font-size: 12px;
  color: var(--text-secondary);
}

.location-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.location-scene-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.06);
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.location-card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.location-detail {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.location-detail strong {
  color: var(--text-primary);
  font-weight: 500;
}

.location-scene-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.location-scene-tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.location-scene-more {
  color: var(--accent);
  background: rgba(209, 139, 60, 0.1);
}

.locations-empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-secondary);
}

.locations-empty-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 12px;
  opacity: 0.4;
}

.locations-empty-text {
  font-size: 13px;
  line-height: 1.5;
}

.locations-loading {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ===============================
   MODAL HELPERS
   =============================== */

.modal-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ===============================
   SCENE ASSIGNMENT MODAL
   =============================== */

.scene-assignment-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 6px;
}

.scene-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 400px;
  overflow-y: auto;
}

.scene-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s ease;
  font-size: 13px;
  color: var(--text-primary);
}

.scene-checkbox-row:hover {
  background: rgba(255,255,255,0.04);
}

.scene-checkbox-row.scene-checked {
  background: rgba(209, 139, 60, 0.08);
}

.scene-checkbox-row input[type="checkbox"] {
  flex-shrink: 0;
  accent-color: var(--accent);
}

.scene-checkbox-heading {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-other-location {
  font-size: 10px;
  font-weight: 500;
  color: #e67e22;
  background: rgba(230, 126, 34, 0.12);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.scene-checkbox-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* --- Grouped Scene Assignment --- */

.scene-group {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 2px;
  transition: border-color 0.15s ease;
}

.scene-group.scene-group-checked {
  border-color: rgba(209, 139, 60, 0.25);
  background: rgba(209, 139, 60, 0.04);
}

.scene-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  cursor: pointer;
}

.scene-group-header:hover {
  background: rgba(255,255,255,0.04);
}

.scene-group-header input[type="checkbox"] {
  flex-shrink: 0;
  accent-color: var(--accent);
}

.scene-group-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.scene-group-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-group-meta {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-group-expand {
  flex-shrink: 0;
  font-size: 12px !important;
  padding: 2px 6px !important;
  min-width: 24px;
  text-align: center;
  background: transparent !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: var(--text-secondary) !important;
}

.scene-group-expand:hover {
  background: rgba(255,255,255,0.06) !important;
  color: var(--text-primary) !important;
}

.scene-group-scenes {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 2px 0 2px 28px;
  background: rgba(0,0,0,0.12);
}

.scene-group-scenes .scene-checkbox-row {
  padding: 5px 10px;
  font-size: 12px;
}

.scene-group-scenes .scene-checkbox-heading {
  font-size: 12px;
  color: var(--text-secondary);
}

.scene-filter-btn {
  font-size: 11px !important;
  padding: 4px 10px !important;
}

.scene-filter-btn.active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

/* ===============================
   RESPONSIVE
   =============================== */

@media (max-width: 768px) {
  .project-canvas {
  padding: 16px !important;
  }

  .project-section-row {
  flex-direction: column;
  }
  
  .stats-grid {
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }

  .project-stats-bar {
  gap: 8px;
  }

  .project-stats-bar .stat-card {
  min-width: 70px;
  padding: 10px 8px;
  }

  .stat-value {
  font-size: 18px;
  }

  .timeline-bar-segment-label {
  font-size: 9px;
  padding: 0 4px;
  }

  .timeline-modal-phase {
  flex-wrap: wrap;
  }

  .timeline-modal-phase-info {
  width: 100%;
  }

  .timeline-modal-phase-dates {
  width: 100%;
  }

  .po-field-row {
  flex-direction: column;
  }

  .po-field-row-3 {
  flex-direction: row;
  }

  .location-card-header {
  flex-direction: column;
  }

  .location-card-actions {
  width: 100%;
  justify-content: flex-start;
  }
}

/* ===============================
   LOCATION MODAL TABS
   =============================== */

.loc-modal-tab {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: -1px;
}

.loc-modal-tab:hover {
  color: var(--text-primary);
}

.loc-modal-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.loc-modal-panels-wrapper {
  display: grid;
}

.loc-modal-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  /* All panels overlap in the same grid cell */
  grid-row: 1;
  grid-column: 1;
}

/* Inactive panels: invisible but still sized — tallest one sets the row height */
.loc-modal-panel:not(.active) {
  visibility: hidden;
  pointer-events: none;
}

.loc-modal-panel.active {
  visibility: visible;
}


