/* ──────────────────────────────────────────────────────────────────────────────
   Phase 2 — Avatar Profiles & Render Panel styles
   Inherits design tokens from css/styles.css (colors, fonts, form-group, etc.)
────────────────────────────────────────────────────────────────────────────── */

/* ── Profile grid ── */
.avatar-profiles-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.profiles-loading,
.profiles-empty,
.profiles-error {
  color: var(--text-muted, #888);
  font-size: 0.875rem;
  grid-column: 1 / -1;
}

.profiles-error { color: #f87171; }

/* ── Profile card ── */
.profile-card {
  background: var(--surface-2, rgba(255,255,255,0.05));
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}

.profile-card.profile-active {
  border-color: var(--accent, #00d4aa);
  box-shadow: 0 0 0 1px var(--accent, #00d4aa);
}

.profile-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.profile-badge.provider-heygen { background: rgba(124, 58, 237, 0.35); }
.profile-badge.provider-tavus  { background: rgba(0, 212, 170, 0.3); }
.profile-badge.provider-did    { background: rgba(59, 130, 246, 0.35); }

.profile-active-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent, #00d4aa);
  margin-left: auto;
}

.profile-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-meta-item {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
}

.profile-meta-item code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

.profile-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

/* ── Add-profile form grid ── */
.ap-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.ap-full-width {
  grid-column: 1 / -1;
}

@media (max-width: 600px) {
  .ap-form-grid { grid-template-columns: 1fr; }
  .ap-full-width { grid-column: 1; }
}

/* ── Energy selector ── */
.energy-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.energy-btn {
  padding: 6px 18px;
  border-radius: 100px;
  border: 1px solid var(--border, rgba(255,255,255,0.15));
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.energy-btn:hover {
  border-color: var(--accent, #00d4aa);
  color: var(--accent, #00d4aa);
}

.energy-btn.active {
  background: var(--accent, #00d4aa);
  border-color: var(--accent, #00d4aa);
  color: #000;
}

/* ── Render progress bar ── */
.render-progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 8px;
}

.render-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00d4aa, #7c3aed);
  border-radius: 100px;
  transition: width 0.6s ease;
  width: 0%;
}

.render-status-text {
  font-size: 0.85rem;
  color: var(--text-muted, #888);
  margin: 0;
}

/* ── Small buttons ── */
.btn-sm {
  padding: 4px 12px;
  font-size: 0.8rem;
}

.btn-danger {
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #f87171;
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: #f87171;
}

.btn-youtube {
  background: transparent;
  border: 1px solid rgba(255, 0, 0, 0.4);
  color: #ff4444;
  cursor: pointer;
}

.btn-youtube:hover {
  background: rgba(255, 0, 0, 0.1);
  border-color: #ff0000;
}

/* ═══════════════════════════════════════════════════════════
   Phase 3 — Recordings & Imports
   ═══════════════════════════════════════════════════════════ */

/* ── Import action bar ── */
.recordings-import-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ── Import URL form ── */
.import-url-form {
  padding: 20px;
}

/* ── Loading state ── */
.recordings-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 12px;
  color: var(--text-muted, #888);
  grid-column: 1 / -1;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent, #6366f1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Recording library grid ── */
.recordings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 12px;
}

/* ── Recording card ── */
.recording-card {
  background: var(--surface-2, rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.recording-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* ── Thumbnail area ── */
.recording-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}

.recording-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recording-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.15);
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
}

.recording-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(99, 102, 241, 0.85);
  color: #fff;
}

.recording-platform-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(0,0,0,0.55);
  color: #e2e8f0;
}

/* ── Card body ── */
.recording-body {
  padding: 14px;
}

.recording-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recording-meta {
  font-size: 0.78rem;
  color: var(--text-muted, #888);
  margin-bottom: 8px;
}

.recording-desc {
  font-size: 0.82rem;
  color: var(--text-muted, #888);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recording-actions {
  display: flex;
  gap: 8px;
}

/* ── Upload zone ── */
.upload-section {
  padding: 20px;
}

.upload-zone {
  border: 2px dashed rgba(255,255,255,0.18);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted, #888);
}

.upload-zone span {
  color: var(--accent, #6366f1);
  text-decoration: underline;
  cursor: pointer;
}

.upload-zone.dragover {
  border-color: var(--accent, #6366f1);
  background: rgba(99, 102, 241, 0.08);
  color: #e2e8f0;
}

/* ── Upload file info ── */
.upload-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(99,102,241,0.08);
  border-radius: 8px;
  font-size: 0.85rem;
  color: #c4b5fd;
}

/* ═══════════════════════════════════════════════════════════
   Phase 6 — Commerce / Offers Panel
   ═══════════════════════════════════════════════════════════ */

.commerce-panel {
  padding: 12px 0;
}

.commerce-hint {
  font-size: 0.78rem;
  color: var(--text-muted, #888);
  margin: 0 0 12px;
  padding: 0 4px;
}

.commerce-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 16px;
  color: var(--text-muted, #888);
  text-align: center;
}

/* ── Product cards in Offers tab ── */
.commerce-product-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.03);
}

.commerce-product-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.commerce-product-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.commerce-product-name {
  display: block;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.commerce-product-price {
  display: block;
  font-size: 0.8rem;
  color: #00d4aa;
}

.commerce-trigger {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted, #888);
}

/* ── Offer banner overlay ── */
.offer-banner {
  position: fixed;
  bottom: -200px;
  right: 24px;
  z-index: 9000;
  width: 320px;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border: 1px solid rgba(99,102,241,0.5);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transition: bottom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.offer-banner-visible {
  bottom: 24px;
}

.offer-banner-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 6px;
}

.offer-banner-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.offer-banner-body {
  flex: 1;
  min-width: 0;
}

.offer-banner-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a5b4fc;
  margin: 0 0 4px;
}

.offer-banner-name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: #fff;
}

.offer-banner-desc {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  margin: 0 0 8px;
}

.offer-banner-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: #34d399;
  margin: 0 0 10px;
}

.offer-banner-cta {
  width: 100%;
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   PHASE 8 — Live revenue counter
   ═══════════════════════════════════════════════════════════════════════ */

.stat-item--revenue {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(16, 185, 129, 0.10));
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 8px;
  padding: 4px 10px;
  gap: 6px;
  align-items: center;
  animation: revenuePulse 2s ease-in-out;
}

@keyframes revenuePulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  50%  { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

#revenueCount {
  font-weight: 700;
  color: #34d399;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

.stat-item--revenue svg {
  color: #34d399;
  flex-shrink: 0;
}

.stat-badge {
  font-size: 0.7rem;
  color: rgba(52, 211, 153, 0.7);
  white-space: nowrap;
}
