/* ── Component: Podcast studio progress cards ──
 * Class prefix: podcast-progress, pp-
 */

/* ── Podcast Progress Card (Animated Production) ──────────────────────── */

.podcast-progress {
  background: transparent;
  border: none;
  padding: 16px 0 8px;
  margin-top: 4px;
  min-width: 240px;
  max-width: 360px;
  overflow: hidden;
  position: relative;
}

/* When embedded inside a CoT bubble, add a top separator */
.sv-cot-bubble .podcast-progress {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Hero: orbital animation area ── */

.podcast-progress__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.podcast-progress--complete .podcast-progress__hero {
  opacity: 0;
  transform: scale(0.8);
  height: 0;
  padding: 0;
  overflow: hidden;
  transition: opacity 0.4s ease, transform 0.4s ease, height 0.4s ease 0.1s, padding 0.4s ease 0.1s;
}

/* ── Orb system (login-style, pp- prefix) ── */

.pp-orb-system {
  position: relative;
  width: 90px;
  height: 90px;
}

/* Center: 🧞‍♀️ with subtle purple glow, no background */
.pp-orb-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  z-index: 2;
  filter: drop-shadow(0 0 10px rgba(167, 139, 250, 0.4));
  animation: pp-center-pulse 3s ease-in-out infinite;
}

/* 2 concentric rings (purple + green) */
.pp-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pp-ring-spin linear infinite;
}

.pp-ring--1 {
  width: 86px;
  height: 86px;
  border-color: rgba(167, 139, 250, 0.15);
  animation-duration: 12s;
}

.pp-ring--2 {
  width: 60px;
  height: 60px;
  border-color: rgba(52, 211, 153, 0.2);
  animation-duration: 8s;
  animation-direction: reverse;
}

/* 2 satellite dot wraps orbiting at different speeds */
.pp-sat-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pp-ring-spin linear infinite;
}

.pp-sat-wrap--1 {
  width: 78px;
  height: 78px;
  animation-duration: 6s;
}

.pp-sat-wrap--2 {
  width: 54px;
  height: 54px;
  animation-duration: 4s;
  animation-direction: reverse;
}

.pp-sat-dot {
  border-radius: 50%;
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
}

.pp-sat-dot--purple {
  width: 6px;
  height: 6px;
  background: #a78bfa;
  box-shadow: 0 0 6px #a78bfa;
}

.pp-sat-dot--green {
  width: 5px;
  height: 5px;
  background: #34d399;
  box-shadow: 0 0 5px #34d399;
}

/* ── Stage text (fading in/out animation) ── */

.podcast-progress__stage-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #94a3b8);
  text-align: center;
  min-height: 20px;
  animation: pp-text-breathe 3s ease-in-out infinite;
}

.podcast-progress__stage-text--fade {
  animation: pp-text-fade-swap 0.8s ease forwards;
}

/* ── Horizontal timeline (2 steps) ── */

.podcast-progress__timeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding-top: 4px;
  transition: opacity 0.5s ease;
}

.podcast-progress--complete .podcast-progress__timeline {
  opacity: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, height 0.3s ease 0.2s, padding 0.3s ease 0.2s;
}

.podcast-progress__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 70px;
}

.podcast-progress__step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(167, 139, 250, 0.25);
  background: transparent;
  transition: all 0.4s ease;
  position: relative;
}

.podcast-progress__step--active .podcast-progress__step-dot {
  border-color: #a78bfa;
  background: rgba(167, 139, 250, 0.25);
  animation: pp-dot-pulse 1.5s ease-in-out infinite;
}

.podcast-progress__step--done .podcast-progress__step-dot {
  border-color: #34d399;
  background: #34d399;
  animation: none;
}

.podcast-progress__step--done .podcast-progress__step-dot::after {
  content: '\2713';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.podcast-progress__step-label {
  font-size: 11px;
  color: var(--text-secondary, #94a3b8);
  transition: color 0.3s ease;
}

.podcast-progress__step--active .podcast-progress__step-label {
  color: #a78bfa;
}

.podcast-progress__step--done .podcast-progress__step-label {
  color: #34d399;
}

.podcast-progress__connector {
  width: 36px;
  height: 2px;
  background: rgba(167, 139, 250, 0.15);
  margin-bottom: 20px;
  transition: background 0.4s ease;
}

.podcast-progress__connector--done {
  background: #34d399;
}

/* ── Card reveal (completion) ── */

.podcast-progress__card-reveal {
  animation: pp-fade-in 0.6s ease forwards;
}

/* ── Error state ── */

.podcast-progress__error {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  color: #f87171;
  font-size: 13px;
  animation: pp-shake 0.4s ease;
}

/* ── Keyframes ── */

@keyframes pp-ring-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes pp-center-pulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.3)); }
  50% { filter: drop-shadow(0 0 18px rgba(167, 139, 250, 0.6)); }
}

@keyframes pp-text-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes pp-text-fade-swap {
  0% { opacity: 1; }
  40% { opacity: 0; }
  60% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes pp-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(167, 139, 250, 0); }
}

@keyframes pp-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pp-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ── Podcast Card (Ready State) ────────────────────────────────────────── */

.podcast-card {
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
  max-width: 420px;
  overflow: hidden;
}

.podcast-card__info {
  margin-bottom: 12px;
}

.podcast-card__title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary, #e2e8f0);
  margin-bottom: 4px;
  line-height: 1.3;
}

.podcast-card__meta {
  font-size: 12px;
  color: var(--text-secondary, #94a3b8);
}

.podcast-card__player-wrap {
  margin-bottom: 12px;
}

.podcast-card__preview-btn {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 8px;
  color: #a78bfa;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}
.podcast-card__preview-btn:hover {
  background: rgba(124, 58, 237, 0.25);
}

.podcast-card__video {
  max-height: 240px;
}

.podcast-card__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.podcast-card__btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s ease;
  text-align: center;
}

.podcast-card__btn--youtube {
  background: rgba(255, 0, 0, 0.12);
  border-color: rgba(255, 0, 0, 0.3);
  color: #ff6b6b;
}
.podcast-card__btn--youtube:hover:not(:disabled) {
  background: rgba(255, 0, 0, 0.2);
}

.podcast-card__btn--download {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.3);
  color: #34d399;
}
.podcast-card__btn--download:hover {
  background: rgba(52, 211, 153, 0.2);
}

.podcast-card__btn--linkedin {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}
.podcast-card__btn--linkedin:hover {
  background: rgba(59, 130, 246, 0.2);
}

.podcast-card__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.podcast-card__yt-link {
  font-size: 12px;
  color: #a78bfa;
  text-decoration: none;
  word-break: break-all;
}
.podcast-card__yt-link:hover {
  text-decoration: underline;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .podcast-card,
  .podcast-progress {
    max-width: 100%;
  }
}
