/* dashboard.css — Extends theme.css for the app dashboard */

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.dashboard-header h1 {
  font-family: 'DM Sans', sans-serif;
  font-size: 32px;
  font-weight: 900;
  color: var(--cream);
  letter-spacing: -0.5px;
}

.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.channel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.channel-card:hover { border-color: rgba(245,158,11,0.3); }

.channel-thumb {
  height: 140px;
  position: relative;
  overflow: hidden;
}

.channel-info {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.channel-info h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 8px;
}

.channel-badge {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 4px;
  padding: 3px 8px;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.channel-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.channel-actions {
  padding: 16px 20px;
  display: flex;
  gap: 10px;
}

/* Buttons */
.btn-primary {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  background: var(--amber);
  color: #0A1628;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  background: var(--surface2);
  color: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
}
.btn-secondary:hover { border-color: rgba(245,158,11,0.3); }

.btn-outline {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 6px;
  padding: 8px 16px;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
}
.btn-outline:hover { background: var(--amber-dim); }

.btn-danger {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-danger:hover { background: rgba(239,68,68,0.1); }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(10,22,40,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal.hidden { display: none; }

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 480px;
  max-width: 90vw;
}

.modal-content h2 {
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: var(--cream);
  margin-bottom: 28px;
  letter-spacing: -0.5px;
}

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

.form-group label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--cream);
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--amber);
}

.form-group select option { background: var(--surface2); }

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 28px;
}

/* States */
.loading-state, .empty-state {
  text-align: center;
  padding: 60px;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
}
.empty-state h3 { font-size: 18px; color: var(--cream); margin-bottom: 8px; }
.error-state { color: #ef4444; text-align: center; padding: 40px; }

/* Channel detail page */
.channel-detail-header {
  padding: 40px 40px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 32px;
  margin-bottom: 40px;
}

.channel-detail-header h1 {
  font-family: 'DM Sans', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--cream);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.channel-detail-header p { color: var(--muted); font-size: 15px; }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

.tab-btn:hover { color: var(--cream); }

/* Scripts list */
.scripts-list, .videos-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.script-card, .video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s;
}
.script-card:hover, .video-card:hover { border-color: rgba(245,158,11,0.3); }

.script-header, .video-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.script-title, .video-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--cream);
}

.script-meta, .video-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 16px;
  align-items: center;
}

.script-body, .video-body {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.script-actions, .video-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

/* Generate section */
.generate-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 28px;
}

.generate-section h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 20px;
}

.generate-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.generate-form .form-group { margin: 0; flex: 1; }

.generate-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  background: var(--amber);
  color: #0A1628;
  border: none;
  border-radius: 8px;
  padding: 14px 28px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.generate-btn:hover { opacity: 0.85; }
.generate-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10,22,40,0.3);
  border-top-color: #0A1628;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

@media (max-width: 768px) {
  .dashboard-container { padding: 24px 20px 60px; }
  .channels-grid { grid-template-columns: 1fr; }
  .generate-form { flex-direction: column; }
}