/* ══════════════════════════════════════════════════════════════════════
   LuvMe — Chat Creation Screen
   Animated "your companion is being created" loading state. Lives inside
   the chat content area. Per-chat lock only — no global modal.
   All colors via CSS variables for theme consistency.
   ══════════════════════════════════════════════════════════════════════ */

.cc-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  overflow: hidden;
  background: radial-gradient(ellipse at center,
    var(--rose-04) 0%,
    var(--bg2) 60%,
    var(--bg) 100%);
  opacity: 0;
  animation: ccFadeIn 0.6s ease-out forwards;
  z-index: 5;
}

.cc-screen.cc-exit {
  animation: ccFadeOut 0.45s ease-in forwards;
}

@keyframes ccFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes ccFadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.04); }
}

/* ── Background ambient orbs ──────────────────────────────────────── */
.cc-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.cc-bg-orb-1 {
  width: 380px;
  height: 380px;
  background: var(--rose-15);
  top: -80px;
  left: -100px;
  animation: ccOrbDrift1 18s ease-in-out infinite;
}

.cc-bg-orb-2 {
  width: 320px;
  height: 320px;
  background: var(--rose-12);
  bottom: -60px;
  right: -80px;
  animation: ccOrbDrift2 22s ease-in-out infinite;
}

.cc-bg-orb-3 {
  width: 260px;
  height: 260px;
  background: var(--rose-04);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: ccOrbPulse 9s ease-in-out infinite;
}

@keyframes ccOrbDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(40px, 30px) scale(1.1); }
}

@keyframes ccOrbDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-50px, -25px) scale(1.08); }
}

@keyframes ccOrbPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50%      { transform: translate(-50%, -50%) scale(1.15); opacity: 0.8; }
}

/* ── Avatar stage with orbits and particles ──────────────────────── */
.cc-stage {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-glow {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--rose-30) 0%, transparent 65%);
  filter: blur(20px);
  animation: ccGlowPulse 3s ease-in-out infinite;
}

@keyframes ccGlowPulse {
  0%, 100% { opacity: 0.6; transform: scale(0.95); }
  50%      { opacity: 1;   transform: scale(1.1);  }
}

.cc-avatar {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--rose);
  box-shadow:
    0 0 0 4px var(--rose-15),
    0 0 0 12px var(--rose-04),
    0 12px 40px rgba(0, 0, 0, 0.5);
  animation: ccAvatarBreath 4s ease-in-out infinite;
  z-index: 2;
}

.cc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cc-avatar-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--ff-display);
  font-size: 56px;
  color: var(--cream);
  background: linear-gradient(135deg, var(--rose-d), var(--rose));
}

@keyframes ccAvatarBreath {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 0 4px var(--rose-15),
      0 0 0 12px var(--rose-04),
      0 12px 40px rgba(0, 0, 0, 0.5);
  }
  50% {
    transform: scale(1.04);
    box-shadow:
      0 0 0 6px var(--rose-20),
      0 0 0 16px var(--rose-12),
      0 16px 50px rgba(0, 0, 0, 0.6);
  }
}

/* ── Concentric rotating orbits ──────────────────────────────────── */
.cc-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed var(--rose-20);
  pointer-events: none;
}

.cc-orbit-inner {
  width: 168px;
  height: 168px;
  animation: ccRotate 14s linear infinite;
}

.cc-orbit-mid {
  width: 192px;
  height: 192px;
  border-color: var(--rose-15);
  animation: ccRotateReverse 22s linear infinite;
}

.cc-orbit-outer {
  width: 220px;
  height: 220px;
  border-color: var(--rose-12);
  animation: ccRotate 30s linear infinite;
}

@keyframes ccRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes ccRotateReverse {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

/* ── Orbiting particles ──────────────────────────────────────────── */
.cc-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cc-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rose-l);
  box-shadow: 0 0 8px var(--rose), 0 0 16px var(--rose-30);
  margin: -3px 0 0 -3px;
  transform-origin: 0 0;
}

/* 12 particles, evenly distributed across 3 orbit radii */
.cc-particle-1  { animation: ccOrbit1 8s  linear infinite; }
.cc-particle-2  { animation: ccOrbit1 8s  linear infinite -1s; }
.cc-particle-3  { animation: ccOrbit1 8s  linear infinite -2s; }
.cc-particle-4  { animation: ccOrbit1 8s  linear infinite -3s; }
.cc-particle-5  { animation: ccOrbit2 12s linear infinite; }
.cc-particle-6  { animation: ccOrbit2 12s linear infinite -3s; }
.cc-particle-7  { animation: ccOrbit2 12s linear infinite -6s; }
.cc-particle-8  { animation: ccOrbit2 12s linear infinite -9s; }
.cc-particle-9  { animation: ccOrbit3 16s linear infinite; }
.cc-particle-10 { animation: ccOrbit3 16s linear infinite -4s; }
.cc-particle-11 { animation: ccOrbit3 16s linear infinite -8s; }
.cc-particle-12 { animation: ccOrbit3 16s linear infinite -12s; }

@keyframes ccOrbit1 {
  from { transform: rotate(0deg)   translateX(84px)  rotate(0deg); }
  to   { transform: rotate(360deg) translateX(84px)  rotate(-360deg); }
}

@keyframes ccOrbit2 {
  from { transform: rotate(0deg)   translateX(96px)  rotate(0deg); }
  to   { transform: rotate(-360deg) translateX(96px) rotate(360deg); }
}

@keyframes ccOrbit3 {
  from { transform: rotate(0deg)   translateX(110px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(110px) rotate(-360deg); }
}

/* ── Text block ──────────────────────────────────────────────────── */
.cc-text-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 2;
  position: relative;
  max-width: 320px;
  text-align: center;
}

.cc-meeting-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--rose);
  font-weight: 500;
  opacity: 0;
  animation: ccFadeUp 0.8s ease-out 0.3s forwards;
}

.cc-name {
  font-family: var(--ff-display);
  font-size: 32px;
  font-weight: 400;
  color: var(--cream);
  letter-spacing: 0.5px;
  opacity: 0;
  animation: ccFadeUp 0.8s ease-out 0.5s forwards;
  margin-bottom: 8px;
}

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

.cc-status {
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: ccFadeUp 0.8s ease-out 0.8s forwards;
}

.cc-status-text {
  font-family: var(--ff-body);
  font-size: 13px;
  color: var(--dim);
  font-style: italic;
  font-weight: 300;
  transition: opacity 0.35s ease;
}

.cc-status-text.cc-fade-out {
  opacity: 0;
}

/* ── Pulsing progress hint (no percentage) ───────────────────────── */
.cc-progress-track {
  width: 200px;
  height: 2px;
  background: var(--rose-12);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
  opacity: 0;
  animation: ccFadeUp 0.8s ease-out 1s forwards;
}

.cc-progress-fill {
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--rose), transparent);
  border-radius: 2px;
  animation: ccProgressSlide 2.2s ease-in-out infinite;
}

@keyframes ccProgressSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ── Light theme adjustments ─────────────────────────────────────── */
[data-theme="light"] .cc-screen {
  background: radial-gradient(ellipse at center,
    var(--rose-04) 0%,
    var(--bg2) 70%,
    var(--bg) 100%);
}
