/* =====================================
   Cast & Crew — Lina Style
   Uses shared .screenplay-page / .screenplay-header / .screenplay-canvas
   ===================================== */

/* Page overrides — borderless, transparent canvas */
.castcrew-page {
  border-width: 0px !important;
}

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

/* Section header icon & title */
.castcrew-header .castcrew-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;
}

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

/* Canvas area */
.castcrew-canvas {
  background: transparent !important;
  border-width: 0px;
}

/* ===============================
   TAB BUTTONS (center zone)
   =============================== */

.castcrew-header .screenplay-header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tab-btn {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: all 0.15s ease;
}

.tab-btn.tab-active {
  background: rgba(46, 204, 113, 0.15);
  border-color: rgba(46, 204, 113, 0.5);
  color: #2ecc71;
  box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.3);
}

.tab-btn.tab-active:hover {
  background: rgba(46, 204, 113, 0.25);
  border-color: rgba(46, 204, 113, 0.6);
}

/* ===============================
   TOOL BUTTONS (right zone)
   =============================== */

.castcrew-header .tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.castcrew-header .tool-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===============================
   INLINE ADD BUTTON
   =============================== */

.add-person-inline {
  margin-top: 6px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-secondary);
}

.add-person-inline:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ===============================
   EMPTY STATE
   =============================== */

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

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  margin-bottom: 20px;
}

/* ===============================
   CAST TABLE
   =============================== */

.cast-table {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.cast-row {
  display: grid;
  grid-template-columns: 50px 50px 1fr 1fr 1.2fr 100px 100px;
  gap: 12px;
  padding: 10px 14px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.cast-row:last-child {
  border-bottom: none;
}

.cast-row-head {
  background: rgba(0, 0, 0, 0.2);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 8px 14px;
}

.cast-row:hover:not(.cast-row-head) {
  background: rgba(255, 255, 255, 0.02);
}

.cast-number {
  font-family: "Unbounded", sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

.cast-headshot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.cast-headshot-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  opacity: 0.5;
}

/* ===============================
   CREW DEPARTMENT BLOCKS
   =============================== */

.crew-department-block {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 16px;
  overflow: hidden;
}

.crew-department-header {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.department-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.department-count {
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ===============================
   CREW TABLE
   =============================== */

.crew-table {
  padding: 0;
}

.crew-row {
  display: grid;
  grid-template-columns: 180px 1fr 1.2fr 80px 100px 100px;
  gap: 12px;
  padding: 10px 14px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.crew-row:last-child {
  border-bottom: none;
}

.crew-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.col-position {
  font-weight: 600;
  color: var(--text);
}

.col-rate {
  font-family: monospace;
  color: var(--text-secondary);
}

/* ===============================
   CONTACT / STATUS / ACTIONS
   =============================== */

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

.contact-email {
  color: var(--accent-muted);
}

.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-confirmed {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.status-pending {
  background: rgba(241, 196, 15, 0.15);
  color: #f1c40f;
}

.status-wrapped {
  background: rgba(155, 89, 182, 0.15);
  color: #9b59b6;
}

.col-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.btn-small {
  padding: 4px 8px;
  font-size: 12px;
}

.btn-danger-icon {
  color: #e74c3c;
}

.btn-danger-icon:hover {
  background: rgba(231, 76, 60, 0.15);
}

/* ===============================
   FORM STYLES (modals)
   =============================== */

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.form-group input,
.form-group select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.form-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ===============================
   AVAILABILITY MODAL
   =============================== */

.availability-modal {
  min-height: 200px;
}

.availability-loading,
.availability-error,
.availability-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
}

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

.availability-list {
  max-height: 250px;
  overflow-y: auto;
}

.availability-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.availability-item.unavailable {
  border-left: 3px solid #e74c3c;
}

.availability-item.tentative {
  border-left: 3px solid #f1c40f;
}

.avail-date {
  flex: 1;
  font-size: 13px;
}

.avail-status {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ===============================
   IMPORT MODAL
   =============================== */

.import-modal p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
}

.import-modal code {
  display: block;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text);
  word-break: break-all;
}

.import-modal a {
  color: var(--accent);
  text-decoration: none;
}

.import-modal a:hover {
  text-decoration: underline;
}

.import-preview-info {
  padding: 12px;
  background: rgba(46, 204, 113, 0.1);
  border-radius: 4px;
  color: #2ecc71;
}

.import-error {
  padding: 12px;
  background: rgba(231, 76, 60, 0.1);
  border-radius: 4px;
  color: #e74c3c;
}

/* ===============================
   LOADING / ERROR
   =============================== */

.loading-message {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.error-message {
  text-align: center;
  padding: 40px;
  color: #e74c3c;
}
