/* =========================================
   RUNNWAY — components.css
   All reusable UI component styles
   ========================================= */

/* --- Sidebar Collapsed State --- */
.sidebar.collapsed { width: 56px; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .profile-info,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-arrow,
.sidebar.collapsed .upgrade-text,
.sidebar.collapsed .upgrade-sub,
.sidebar.collapsed .user-name,
.sidebar.collapsed .user-sub,
.sidebar.collapsed .sidebar-footer { display: none; }
.sidebar.collapsed .main-content { margin-left: 56px; }

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
}
.login-bg-orb.orb1 {
  width: 500px; height: 500px;
  background: var(--accent-purple);
  top: -150px; left: -150px;
}
.login-bg-orb.orb2 {
  width: 400px; height: 400px;
  background: var(--accent-pink);
  bottom: -100px; right: -100px;
}
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: #111111;
  border: 1px solid #222;
  border-radius: 16px;
  padding: 40px;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.login-logo-icon {
  width: 42px;
  height: 42px;
  background: var(--accent-purple);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.login-logo .logo-icon-img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}
.login-logo-text { font-size: 24px; font-weight: 800; }
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 28px; }
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #222;
}
.login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}
.login-footer a { color: var(--accent-purple); text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }
.input-with-icon {
  position: relative;
}
.input-with-icon .form-input {
  padding-left: 38px;
}
.input-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.input-toggle {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
}
.login-error {
  background: #1a0000;
  border: 1px solid #3a0000;
  color: #f87171;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* --- Asset Cards --- */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.asset-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.asset-card:hover {
  border-color: var(--accent-hover);
  box-shadow: 0 0 10px var(--accent-soft);
  transform: translateY(-2px);
}
.asset-card.selected {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 1px var(--accent-purple);
}
.asset-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.asset-img img { width: 100%; height: 100%; object-fit: cover; }
.asset-card-body { padding: 12px; }
.asset-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-desc { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-actions { display: flex; gap: 6px; margin-top: 10px; }

/* --- Upload Zone --- */
.upload-zone {
  border: 2px dashed #2a2a2a;
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent-hover);
  background: var(--accent-soft);
}
.upload-icon { font-size: 32px; margin-bottom: 12px; }
.upload-text { font-size: 14px; color: var(--text-secondary); }
.upload-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.upload-preview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

/* --- Prompt Builder Steps --- */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s;
}
.step.active .step-num {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: #fff;
}
.step.done .step-num {
  background: #001a0e;
  border-color: #00240f;
  color: #22c55e;
}
.step-label { font-size: 12px; color: var(--text-muted); }
.step.active .step-label { color: var(--text-primary); font-weight: 500; }
.step-connector { height: 1px; flex: 1; background: #2a2a2a; margin: 0 8px; }
.step-connector.done { background: var(--accent-purple); }

.prompt-select-card {
  border: 2px solid transparent;
  transition: border-color 0.15s;
  cursor: pointer;
}
.prompt-select-card:hover { border-color: var(--accent-hover); background: var(--accent-soft); }
.prompt-select-card.selected { border-color: var(--accent-purple); }

/* --- Generation Settings --- */
.settings-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.settings-option {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s;
}
.settings-option:hover { border-color: #444; }
.settings-option.selected {
  border-color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.08);
}
.settings-option-icon { font-size: 20px; margin-bottom: 6px; }
.settings-option-label { font-size: 12px; font-weight: 500; }
.settings-option-sub { font-size: 11px; color: var(--text-muted); }

/* --- Queue / Job Items --- */
.job-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.job-item:hover { border-color: var(--accent-hover); box-shadow: 0 0 15px var(--accent-soft); }
.job-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}
.job-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.job-meta { font-size: 12px; color: var(--text-muted); }
.job-progress { margin-top: 10px; }
.job-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

/* --- Video Player Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  width: 100%;
  max-width: 800px;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #1a1a1a;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close {
  width: 30px;
  height: 30px;
  background: #1a1a1a;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.15s;
}
.modal-close:hover { background: #2a2a2a; color: #fff; }
.modal-body { padding: 20px; }
.modal-video {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-sm);
  object-fit: contain;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* --- Settings Page --- */
.settings-section {
  margin-bottom: 32px;
}
.settings-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--card-border);
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #1a1a1a;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 14px; font-weight: 500; }
.toggle-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.toggle-switch {
  width: 42px;
  height: 24px;
  background: #2a2a2a;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  border: none;
}
.toggle-switch.on { background: var(--accent-purple); }
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: left 0.2s;
}
.toggle-switch.on::after { left: 21px; }

/* --- Notification Toast --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 360px;
  animation: toastIn 0.25s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.toast.success { border-color: #003015; background: #001408; }
.toast.error { border-color: #2a0000; background: #0d0000; }
.toast.info { border-color: #001428; background: #000a14; }
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-sub { font-size: 13px; }

/* --- Loading Spinner --- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Dropdown Menu --- */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: var(--radius-sm);
  min-width: 160px;
  z-index: 500;
  overflow: hidden;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s;
}
.dropdown-item:hover { background: #222; color: var(--text-primary); }
.dropdown-item.danger { color: var(--accent-red); }
.dropdown-divider { height: 1px; background: #222; }

/* --- Char/Product selector in Prompt Builder --- */
.select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.select-grid::-webkit-scrollbar { width: 3px; }
.select-grid::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.select-item {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 12px 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255,255,255,0.02);
  position: relative;
}
.select-item:hover {
  border-color: rgba(124,58,237,0.4);
  background: rgba(124,58,237,0.06);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}
.select-item.selected {
  border-color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.1);
  box-shadow: 0 0 20px rgba(124,58,237,0.2), 0 4px 15px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}
.select-item.selected::after {
  content: '✓';
  position: absolute; top: 6px; right: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-purple); color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(124,58,237,0.4);
}
.select-item-thumb {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  transition: border-color 0.3s;
}
.select-item:hover .select-item-thumb { border-color: rgba(124,58,237,0.3); }
.select-item.selected .select-item-thumb { border-color: rgba(124,58,237,0.5); }
.select-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.select-item-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); transition: color 0.2s; }
.select-item:hover .select-item-name { color: #fff; }
.select-item.selected .select-item-name { color: #fff; }

/* --- Prompt Output Box --- */
.prompt-output {
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
  min-height: 120px;
  font-family: 'Inter', monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- API Key Input --- */
.api-key-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.api-key-row .form-input { font-family: monospace; font-size: 12px; letter-spacing: 0.04em; }
.api-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
}
.api-status.valid { background: #001a0e; color: #22c55e; }
.api-status.invalid { background: #1a0000; color: #ef4444; }
.api-status.unchecked { background: #1a1a1a; color: var(--text-muted); }

/* --- Dashboard Quick Stats --- */
.quick-generate {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(192, 38, 211, 0.1));
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.quick-generate-text h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.quick-generate-text p { font-size: 13px; color: var(--text-secondary); }

/* --- Recent Activity --- */
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #1a1a1a;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.activity-dot.green { background: #22c55e; }
.activity-dot.blue { background: #3b82f6; }
.activity-dot.yellow { background: #f59e0b; }
.activity-dot.red { background: #ef4444; }
.activity-info { flex: 1; }
.activity-title { font-size: 13px; margin-bottom: 2px; }
.activity-time { font-size: 11px; color: var(--text-muted); }

/* --- Custom Confirm Modal --- */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; animation: confirmFadeIn 0.25s ease forwards;
}
@keyframes confirmFadeIn { to { opacity: 1; } }
@keyframes confirmSlideUp { from { transform: translateY(20px) scale(0.96); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

.confirm-box {
  background: #1a1a1a; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 32px; width: 380px; max-width: 90vw;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 40px rgba(124,58,237,0.1);
  animation: confirmSlideUp 0.3s ease forwards;
}
.confirm-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; font-size: 22px;
}
.confirm-icon.danger { background: rgba(239,68,68,0.15); color: #f87171; }
.confirm-icon.warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.confirm-icon.info { background: rgba(124,58,237,0.15); color: var(--accent-purple); }

.confirm-title {
  font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 8px;
}
.confirm-message {
  font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 28px;
}
.confirm-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}
.confirm-btn {
  padding: 10px 22px; border-radius: 10px; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.2s ease;
}
.confirm-btn-cancel {
  background: rgba(255,255,255,0.06); color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.1);
}
.confirm-btn-cancel:hover { background: rgba(255,255,255,0.1); color: #fff; }
.confirm-btn-ok {
  background: var(--accent-purple); color: #fff;
}
.confirm-btn-ok:hover { filter: brightness(1.15); transform: translateY(-1px); }
.confirm-btn-danger {
  background: #dc2626; color: #fff;
}
.confirm-btn-danger:hover { filter: brightness(1.15); transform: translateY(-1px); }

