/* ===== PHASE 5: Content Output Hub Styles ===== */

/* ── Loading & Error States ─────────────────────────────────── */
.p5-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  color: var(--color-text-muted);
}

.p5-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 45, 120, 0.15);
  border-top-color: #ff2d78;
  border-radius: 50%;
  animation: p5spin 0.8s linear infinite;
}

.p5-spinner-sm {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 45, 120, 0.15);
  border-top-color: #ff2d78;
  border-radius: 50%;
  animation: p5spin 0.8s linear infinite;
}

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

.p5-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
}
.p5-error h2 { font-size: 1.5rem; color: var(--color-text); }
.p5-error p { color: var(--color-text-muted); }

.p5-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ── Hero Banner ─────────────────────────────────────────────── */
.p5-hub {
  max-width: 100%;
  min-height: 100vh;
}

.p5-hero {
  position: relative;
  padding: 100px 24px 48px;
  background: linear-gradient(135deg, #0a0a0f 0%, #1a0a15 50%, #0a0a0f 100%);
  overflow: hidden;
}

.p5-hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(255, 45, 120, 0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(0, 229, 255, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.p5-hero-content {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.p5-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.2s;
}
.p5-breadcrumb:hover { color: #ff2d78; }

.p5-hero-title {
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 700;
  color: #f0f0f5;
  line-height: 1.15;
  margin: 0 0 8px;
}

.p5-hero-meta {
  font-size: 1rem;
  color: rgba(240, 240, 245, 0.6);
  margin: 0 0 24px;
}

.p5-hero-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.p5-stat {
  display: flex;
  flex-direction: column;
}

.p5-stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f0f0f5;
  line-height: 1.2;
}

.p5-stat-label {
  font-size: 0.75rem;
  color: rgba(240, 240, 245, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Tabs ─────────────────────────────────────────────────────── */
.p5-tabs-wrap {
  position: sticky;
  top: 60px;
  z-index: 50;
  background: var(--color-bg, #0a0a0f);
  border-bottom: 1px solid var(--color-divider, rgba(240,240,245,0.08));
}

.p5-tabs {
  display: flex;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.p5-tabs::-webkit-scrollbar { display: none; }

.p5-tab {
  flex-shrink: 0;
  padding: 14px 20px;
  border: none;
  background: none;
  color: var(--color-text-muted, rgba(240,240,245,0.5));
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  white-space: nowrap;
}
.p5-tab:hover { color: var(--color-text, #f0f0f5); }
.p5-tab.active {
  color: #ff2d78;
}
.p5-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 2px;
  background: #ff2d78;
  border-radius: 2px 2px 0 0;
}

/* ── Content Panels ──────────────────────────────────────────── */
.p5-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.p5-panel {
  display: none;
}
.p5-panel.active {
  display: block;
  animation: p5fadeIn 0.3s ease;
}

@keyframes p5fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Three-Tier Cards ────────────────────────────────────────── */
.p5-tiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.p5-tier-card {
  position: relative;
  padding: 28px 24px;
  background: var(--color-surface, rgba(240,240,245,0.03));
  border: 1px solid var(--color-divider, rgba(240,240,245,0.08));
  border-radius: 16px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.p5-tier-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 45, 120, 0.2);
  box-shadow: 0 8px 32px rgba(255, 45, 120, 0.06);
}
.p5-tier-card.ready {
  border-color: rgba(255, 45, 120, 0.3);
}

.p5-tier-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 45, 120, 0.12);
  color: #ff2d78;
}

.p5-tier-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.p5-tier-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text, #f0f0f5);
  margin: 0 0 8px;
}

.p5-tier-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.p5-tier-duration,
.p5-tier-res {
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.75rem;
  color: rgba(240, 240, 245, 0.5);
  background: rgba(240, 240, 245, 0.04);
  border-radius: 12px;
  margin: 0 2px 12px;
}

.p5-tier-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.p5-tier-status {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.p5-processing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #00e5ff;
  font-size: 0.85rem;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.p5-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: #f0f0f5;
}

.p5-btn-primary {
  background: #ff2d78;
}
.p5-btn-primary:hover {
  background: #e6256c;
  transform: translateY(-1px);
}

.p5-btn-ghost {
  background: rgba(240, 240, 245, 0.06);
  border: 1px solid var(--color-divider, rgba(240,240,245,0.1));
}
.p5-btn-ghost:hover {
  background: rgba(240, 240, 245, 0.1);
}

.p5-btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* ── Songs List ──────────────────────────────────────────────── */
.p5-songs-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.p5-song-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  transition: background 0.15s;
}
.p5-song-row:hover {
  background: rgba(240, 240, 245, 0.04);
}

.p5-song-num {
  width: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.p5-song-art {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
}

.p5-song-art-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: rgba(240, 240, 245, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.p5-song-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.p5-song-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text, #f0f0f5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p5-song-artist {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.p5-song-clips {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.p5-song-duration {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.p5-song-status {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: capitalize;
  white-space: nowrap;
}
.p5-status-complete { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.p5-status-processing { background: rgba(0, 229, 255, 0.12); color: #00e5ff; }
.p5-status-pending { background: rgba(240, 240, 245, 0.06); color: var(--color-text-muted); }
.p5-status-queued { background: rgba(255, 193, 7, 0.12); color: #ffc107; }

/* ── Social Cuts Grid ────────────────────────────────────────── */
.p5-social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.p5-social-card {
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-surface, rgba(240,240,245,0.03));
  border: 1px solid var(--color-divider, rgba(240,240,245,0.08));
  transition: transform 0.2s, box-shadow 0.2s;
}
.p5-social-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.p5-social-preview {
  position: relative;
  background: #111;
}

.p5-social-aspect {
  aspect-ratio: 9/16;
  max-height: 320px;
  overflow: hidden;
}

.p5-social-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p5-social-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.p5-social-meta {
  padding: 14px;
}

.p5-social-platform {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text, #f0f0f5);
  margin-bottom: 4px;
}

.p5-social-duration {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.p5-social-caption {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 6px 0 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.p5-social-actions {
  margin-top: 10px;
}

/* ── Gallery Grid ────────────────────────────────────────────── */
.p5-gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.p5-gallery-count {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.p5-gallery-filters {
  display: flex;
  gap: 4px;
}

.p5-filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--color-divider, rgba(240,240,245,0.08));
  border-radius: 20px;
  background: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.p5-filter-btn:hover { border-color: rgba(255, 45, 120, 0.3); color: var(--color-text); }
.p5-filter-btn.active {
  background: rgba(255, 45, 120, 0.1);
  border-color: #ff2d78;
  color: #ff2d78;
}

.p5-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.p5-gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}
.p5-gallery-item:hover {
  transform: scale(1.03);
}
.p5-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p5-best-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  background: #ff2d78;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.p5-quality-score {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.7);
  color: rgba(240, 240, 245, 0.8);
  font-size: 0.7rem;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

.p5-gallery-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px;
  color: var(--color-text-muted);
}

/* ── Lightbox ────────────────────────────────────────────────── */
.p5-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.p5-lightbox.open {
  opacity: 1;
  visibility: visible;
}

.p5-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}
.p5-lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }

.p5-lightbox-prev,
.p5-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}
.p5-lightbox-prev { left: 16px; }
.p5-lightbox-next { right: 16px; }
.p5-lightbox-prev:hover,
.p5-lightbox-next:hover { background: rgba(255, 255, 255, 0.15); }

.p5-lightbox-body {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.p5-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.p5-lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* ── Audio List ──────────────────────────────────────────────── */
.p5-audio-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.p5-audio-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  transition: background 0.15s;
}
.p5-audio-row:hover { background: rgba(240, 240, 245, 0.04); }
.p5-audio-row.playing { background: rgba(255, 45, 120, 0.06); }

.p5-audio-play-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 45, 120, 0.1);
  color: #ff2d78;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}
.p5-audio-play-btn:hover {
  background: rgba(255, 45, 120, 0.2);
  transform: scale(1.05);
}

.p5-audio-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.p5-audio-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text, #f0f0f5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p5-audio-detail {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.p5-audio-duration {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  margin-right: 8px;
}

/* ── Timelapse Grid ──────────────────────────────────────────── */
.p5-timelapse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.p5-timelapse-card {
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-surface, rgba(240,240,245,0.03));
  border: 1px solid var(--color-divider, rgba(240,240,245,0.08));
  transition: transform 0.2s;
}
.p5-timelapse-card:hover { transform: translateY(-2px); }

.p5-timelapse-preview {
  aspect-ratio: 16/9;
  background: #111;
  overflow: hidden;
}

.p5-timelapse-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p5-placeholder-dark {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.p5-timelapse-info {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.p5-timelapse-type {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text, #f0f0f5);
  flex: 1;
}

.p5-timelapse-dur,
.p5-timelapse-speed {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ── Downloads Hub ───────────────────────────────────────────── */
.p5-downloads-hub {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.p5-dl-section {
  background: var(--color-surface, rgba(240,240,245,0.03));
  border: 1px solid var(--color-divider, rgba(240,240,245,0.08));
  border-radius: 14px;
  padding: 20px;
}

.p5-dl-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text, #f0f0f5);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-divider, rgba(240,240,245,0.06));
}

.p5-dl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}
.p5-dl-row + .p5-dl-row {
  border-top: 1px solid var(--color-divider, rgba(240,240,245,0.04));
}

.p5-dl-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.p5-dl-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text, #f0f0f5);
}

.p5-dl-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.p5-dl-empty {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ── Video Player Overlay ────────────────────────────────────── */
.p5-video-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.p5-video-overlay.open { opacity: 1; }

.p5-video-container {
  position: relative;
  width: 90vw;
  max-width: 1200px;
}

.p5-video-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}
.p5-video-close:hover { background: rgba(255, 255, 255, 0.2); }

.p5-video-player {
  width: 100%;
  border-radius: 8px;
  background: black;
  max-height: 80vh;
}

/* ── Mobile Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
  .p5-hero {
    padding: 80px 16px 32px;
  }

  .p5-hero-title {
    font-size: 1.5rem;
  }

  .p5-hero-stats {
    gap: 20px;
  }

  .p5-stat-num {
    font-size: 1.2rem;
  }

  .p5-tabs {
    padding: 0 16px;
  }

  .p5-tab {
    padding: 12px 14px;
    font-size: 0.85rem;
  }

  .p5-content {
    padding: 20px 16px 60px;
  }

  .p5-tiers-grid {
    grid-template-columns: 1fr;
  }

  .p5-social-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .p5-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .p5-gallery-item {
    border-radius: 4px;
  }

  .p5-song-row {
    padding: 10px 8px;
    gap: 10px;
  }

  .p5-song-clips {
    display: none;
  }

  .p5-lightbox-prev { left: 8px; }
  .p5-lightbox-next { right: 8px; }

  .p5-dl-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .p5-audio-row {
    gap: 10px;
    padding: 12px 8px;
  }
}

@media (max-width: 480px) {
  .p5-social-grid {
    grid-template-columns: 1fr 1fr;
  }

  .p5-social-aspect {
    max-height: 240px;
  }

  .p5-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .p5-gallery-toolbar {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
}
