/* ─── Buttons ────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-family: var(--font-head);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-light);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: #444; }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover:not(:disabled) { background: var(--accent-dim); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(229, 62, 62, 0.4);
}
.btn-danger:hover:not(:disabled) { background: rgba(229, 62, 62, 0.1); }

.btn-icon {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 6px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  letter-spacing: 0;
}
.btn-icon:hover { color: var(--text); background: var(--surface-2); }

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
}

.btn-full { width: 100%; justify-content: center; }

/* ─── Spinner inside button ──────────────────────────── */

.btn .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ─── Form fields ────────────────────────────────────── */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 14px;
  padding: 9px 12px;
  width: 100%;
  transition: border-color var(--transition);
  outline: none;
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

select option { background: var(--surface-2); }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.error-msg {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

.key-reveal-wrap {
  position: relative;
}
.key-reveal-wrap input { padding-right: 40px; }
.key-reveal-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 2px 4px;
}
.key-reveal-btn:hover { color: var(--text); }

/* ─── Card ───────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ─── Project Card (Catalog) ─────────────────────────── */

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), transform var(--transition);
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
}

.card-poster {
  position: relative;
  aspect-ratio: 2/3;
  background: var(--surface-2);
  overflow: hidden;
}

.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .card-poster img { transform: scale(1.03); }

.card-poster .status-badge {
  position: absolute;
  top: 10px;
  left: 10px;
}

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.card-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.card-genre {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-logline {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 4px;
}

.card-director {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: auto;
  padding-top: 8px;
}

/* ─── Status Badge ───────────────────────────────────── */

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-badge.idea {
  background: rgba(100,100,100,0.2);
  color: #999;
  border: 1px solid #444;
}
.status-badge.dev {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(245,130,10,0.3);
}
.status-badge.prep {
  background: rgba(74,222,128,0.08);
  color: var(--success);
  border: 1px solid rgba(74,222,128,0.25);
}

/* ─── Tag ────────────────────────────────────────────── */

.tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ─── Filter Pills ───────────────────────────────────── */

.filter-pill {
  padding: 6px 16px 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  letter-spacing: 0.02em;
}

.filter-pill:hover { color: var(--text); }
.filter-pill.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ─── Modal ──────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeUp 0.25s ease;
}

.modal-box.wide { max-width: 700px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-head);
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ─── Dream Cast Grid ────────────────────────────────── */

.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
}

.cast-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.cast-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.cast-name { font-size: 13px; font-weight: 400; }
.cast-role { font-size: 11px; color: var(--text-muted); }

/* ─── References Table ───────────────────────────────── */

.refs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.refs-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.refs-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.refs-table tr:last-child td { border-bottom: none; }

/* ─── Notes List ─────────────────────────────────────── */

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-item {
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}

.note-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}

.note-text { font-size: 13px; line-height: 1.6; }

.note-bullets {
  margin: 4px 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.note-bullets li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  list-style: disc;
}

/* ─── People List ────────────────────────────────────── */

.people-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.person-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.person-row:last-child { border-bottom: none; }

.person-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 2px;
}

.person-name { font-weight: 400; font-size: 14px; }
.person-sub  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ─── Person status badge ────────────────────────────── */
.person-status-badge {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.person-status-idea     { background: rgba(100,100,100,0.15); color: #888; border: 1px solid #444; }
.person-status-thought  { background: rgba(100,150,255,0.1);  color: #7aa0ff; border: 1px solid rgba(100,150,255,0.3); }
.person-status-sent     { background: rgba(245,130,10,0.1);   color: var(--accent); border: 1px solid rgba(245,130,10,0.3); }
.person-status-agreed   { background: rgba(74,222,128,0.08);  color: var(--success); border: 1px solid rgba(74,222,128,0.25); }
.person-status-approved { background: rgba(74,222,128,0.18);  color: #2ecc71; border: 1px solid rgba(74,222,128,0.5); }

/* ─── Files list ─────────────────────────────────────── */
.files-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), background var(--transition);
}
.file-row:hover {
  border-color: var(--accent);
  background: var(--surface-3);
  color: var(--text);
}
.file-icon   { font-size: 16px; flex-shrink: 0; }
.file-name   { flex: 1; font-size: 13px; }
.file-type-tag {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: var(--radius);
}
.file-ext-arrow { color: var(--text-faint); font-size: 13px; }

/* ─── Platforms List ─────────────────────────────────── */

.platforms-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.platforms-col-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.platforms-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.platforms-list li {
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

/* ─── Budget Block ───────────────────────────────────── */

.budget-block {
  display: flex;
  align-items: center;
  gap: 16px;
}
.budget-amount {
  font-family: var(--font-head);
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

/* ─── Poster Placeholder ─────────────────────────────── */

.poster-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
  padding: 20px;
}

.poster-placeholder svg {
  width: 40px;
  height: 40px;
  opacity: 0.4;
}

/* ─── Loading Spinner ────────────────────────────────── */

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.loading-spinner::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ─── Empty State ────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 20px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state h3 {
  font-size: 1.4rem;
  color: var(--text-muted);
}

.empty-state p { font-size: 13px; max-width: 280px; }

/* ─── Drag & Drop area ───────────────────────────────── */

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ─── Prompt copy block ──────────────────────────────── */

.prompt-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  color: var(--text-muted);
}
