/* Yaloo Universe — shared futuristic theme: uploads, tabs, panels, Music Studio bridge */

/* ========== Compose drag-drop — cosmic portal ========== */
.yal-compose-drop-active,
.yal-universe-drop {
  outline: none !important;
  position: relative;
  box-shadow:
    inset 0 0 0 2px rgba(138, 99, 255, 0.55),
    inset 0 0 48px rgba(56, 189, 248, 0.12),
    0 0 40px rgba(138, 99, 255, 0.25);
  border-radius: 16px;
  animation: yal-universe-drop-pulse 1.2s ease-in-out infinite;
}

@keyframes yal-universe-drop-pulse {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(138, 99, 255, 0.45), inset 0 0 32px rgba(56, 189, 248, 0.08), 0 0 24px rgba(138, 99, 255, 0.18); }
  50% { box-shadow: inset 0 0 0 2px rgba(56, 189, 248, 0.65), inset 0 0 64px rgba(240, 36, 155, 0.12), 0 0 48px rgba(138, 99, 255, 0.35); }
}

/* ========== Universe upload backdrop (orbiting particles) ========== */
.x-compose-media-preview {
  position: relative;
}

.yal-universe-upload-bg {
  position: absolute;
  inset: -8px;
  border-radius: 20px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.yal-universe-uploading .yal-universe-upload-bg {
  opacity: 1;
}

.yal-universe-orbit {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  animation: yal-universe-orbit-spin 3.5s linear infinite;
}

.yal-universe-orbit--a {
  width: 120px;
  height: 120px;
  top: 10%;
  left: 8%;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.yal-universe-orbit--b {
  width: 80px;
  height: 80px;
  bottom: 12%;
  right: 10%;
  border: 1px solid rgba(240, 36, 155, 0.35);
  animation-duration: 2.8s;
  animation-direction: reverse;
}

.yal-universe-orbit--c {
  width: 48px;
  height: 48px;
  top: 40%;
  right: 28%;
  background: radial-gradient(circle, rgba(138, 99, 255, 0.45), transparent 70%);
  animation-duration: 2.2s;
}

@keyframes yal-universe-orbit-spin {
  from { transform: rotate(0deg) scale(1); opacity: 0.7; }
  50% { transform: rotate(180deg) scale(1.08); opacity: 1; }
  to { transform: rotate(360deg) scale(1); opacity: 0.7; }
}

/* ========== Upload overlay — holographic ring ========== */
.yal-universe-upload-overlay,
.yal-compose-upload-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background:
    radial-gradient(ellipse 80% 70% at 50% 50%, rgba(8, 6, 24, 0.72), rgba(0, 0, 0, 0.88)),
    linear-gradient(115deg, rgba(29, 155, 240, 0.08), rgba(138, 99, 255, 0.12), rgba(240, 36, 155, 0.06));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: yal-universe-overlay-breathe 2.4s ease-in-out infinite;
}

@keyframes yal-universe-overlay-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15) saturate(1.2); }
}

.yal-compose-upload-ring-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
}

.yal-compose-upload-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #38bdf8,
    #8a63ff,
    #f0249b,
    #1d9bf0,
    transparent calc(var(--yal-upload-pct, 0) * 3.6deg),
    rgba(255, 255, 255, 0.08) calc(var(--yal-upload-pct, 0) * 3.6deg)
  );
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  animation: yal-universe-ring-spin 4s linear infinite;
  box-shadow: 0 0 28px rgba(138, 99, 255, 0.45);
}

.yal-compose-upload-ring::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 20px rgba(56, 189, 248, 0.15);
}

@keyframes yal-universe-ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.yal-compose-upload-pct {
  position: relative;
  z-index: 1;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(100deg, #38bdf8, #8a63ff, #f0249b);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: yft-flow 4s linear infinite;
  text-shadow: none;
  filter: drop-shadow(0 0 12px rgba(138, 99, 255, 0.5));
}

.yal-compose-upload-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
}

.yal-compose-upload-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--yft-grad, linear-gradient(100deg, #1d9bf0, #8a63ff, #f0249b));
  background-size: 280% auto;
  animation: yft-flow 5s linear infinite;
  box-shadow: 0 0 16px rgba(138, 99, 255, 0.65);
  border-radius: 0 3px 0 0;
}

/* ========== Status bar — nebula progress ========== */
.yal-universe-upload-status {
  background:
    linear-gradient(100deg, rgba(10, 8, 28, 0.95), rgba(0, 0, 0, 0.92)) !important;
  border: 1px solid rgba(138, 99, 255, 0.45) !important;
  box-shadow:
    0 8px 32px rgba(80, 40, 200, 0.28),
    inset 0 0 24px rgba(56, 189, 248, 0.06) !important;
}

.yal-universe-upload-status::before {
  background: linear-gradient(90deg, #1a8cd8, #8a63ff, #f0249b) !important;
  opacity: 0.85;
}

.yal-universe-upload-spark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.12) 50%, transparent 58%);
  background-size: 300% 300%;
  animation: yft-sweep 3.5s ease-in-out infinite;
}

/* ========== Media frame — glass hologram ========== */
.yal-x-media-frame {
  border: 1px solid rgba(138, 99, 255, 0.35) !important;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 32px rgba(138, 99, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  background: linear-gradient(145deg, rgba(8, 6, 20, 0.9), rgba(0, 0, 0, 0.95)) !important;
}

.yal-universe-uploading .yal-x-media-frame,
.yal-universe-uploading .yal-universe-audio-shell {
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.35),
    0 0 48px rgba(138, 99, 255, 0.25),
    inset 0 0 40px rgba(29, 155, 240, 0.06);
}

/* Large-file upload placeholder (no blob preview — avoids white-screen crash) */
.yal-universe-upload-placeholder {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 220px;
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(138, 99, 255, 0.35);
  background:
    linear-gradient(135deg, rgba(12, 10, 28, 0.92), rgba(0, 0, 0, 0.96)),
    linear-gradient(100deg, rgba(29, 155, 240, 0.08), rgba(240, 36, 155, 0.06));
  box-shadow: 0 12px 36px rgba(80, 40, 200, 0.18);
  overflow: hidden;
  text-align: center;
  padding: 24px 16px;
}

.yal-universe-upload-placeholder-icon {
  font-size: 2.4rem;
  line-height: 1;
  color: #7dd3fc;
  text-shadow: 0 0 24px rgba(56, 189, 248, 0.45);
}

.yal-universe-upload-placeholder-name {
  max-width: 92%;
  font-size: 0.88rem;
  color: #94a3b8;
  word-break: break-word;
}

.yal-compose-media-preview.yal-compose-uploading .x-media,
.yal-compose-media-preview.yal-universe-uploading .x-media {
  opacity: 0.92;
}

/* ========== Audio shell — cosmic player ========== */
.yal-universe-audio-shell {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(138, 99, 255, 0.35);
  background:
    linear-gradient(135deg, rgba(12, 10, 28, 0.92), rgba(0, 0, 0, 0.96)),
    linear-gradient(100deg, rgba(29, 155, 240, 0.06), rgba(240, 36, 155, 0.05));
  box-shadow: 0 12px 36px rgba(80, 40, 200, 0.18);
  overflow: hidden;
}

.yal-universe-audio-art {
  position: relative;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.yal-universe-audio-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #38bdf8;
  border-right-color: #8a63ff;
  animation: yal-universe-ring-spin 2.5s linear infinite;
  box-shadow: 0 0 16px rgba(138, 99, 255, 0.4);
}

.yal-universe-audio-icon {
  font-size: 1.35rem;
  color: #fff;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.65);
  animation: yal-universe-audio-bounce 1.8s ease-in-out infinite;
}

@keyframes yal-universe-audio-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.yal-universe-audio {
  width: 100%;
  min-width: 0;
  height: 40px;
  border-radius: 999px;
  filter: drop-shadow(0 0 8px rgba(138, 99, 255, 0.25));
}

.yal-post-audio-player {
  margin: 0.5rem 0;
  max-width: 100%;
}

/* ========== Global page shells — universe glass ========== */
body.yal-has-shell .x-share-modal,
body.yal-has-shell .x-bookmark-modal,
body.yal-has-shell .yal-explore-wrap,
body.yal-has-shell .yal-chat-modal,
body.yal-has-shell .x-notif-list,
body.yal-has-shell .x-profile-body {
  position: relative;
}

body.yal-has-shell .x-share-modal .x-share-body,
body.yal-has-shell .yal-explore-body {
  background: linear-gradient(180deg, rgba(6, 4, 14, 0.35), transparent 24%);
}

/* Music Studio — match main app tab rail energy */
#ymm-studio {
  --yft-grad: linear-gradient(100deg, #1d9bf0, #8a63ff, #f0249b, #38bdf8, #1d9bf0);
  --yft-grad-text: linear-gradient(100deg, #38bdf8, #8a63ff, #f0249b, #1d9bf0, #38bdf8);
  --yft-cyan: #38bdf8;
  --yft-violet: #8a63ff;
}

#ymm-studio .ymm-rail {
  background:
    linear-gradient(180deg, rgba(10, 8, 22, 0.95), rgba(0, 0, 0, 0.88)),
    linear-gradient(100deg, rgba(29, 155, 240, 0.05), rgba(138, 99, 255, 0.06));
  border-right: 1px solid rgba(138, 99, 255, 0.28);
  box-shadow: 4px 0 32px rgba(80, 40, 200, 0.12);
}

#ymm-studio .ymm-rail-btn {
  position: relative;
  transition: color 0.2s ease, transform 0.18s ease, box-shadow 0.25s ease;
}

#ymm-studio .ymm-rail-btn::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 18%;
  bottom: 18%;
  width: 3px;
  border-radius: 3px;
  background: var(--yft-grad);
  background-size: 280% auto;
  transform: scaleY(0);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: yft-flow 6s linear infinite;
}

#ymm-studio .ymm-rail-btn.active::before,
#ymm-studio .ymm-rail-btn:hover::before {
  transform: scaleY(1);
}

#ymm-studio .ymm-rail-btn.active .ymm-rail-label,
#ymm-studio .ymm-rail-btn.active .ymm-rail-icon {
  background: var(--yft-grad-text);
  background-size: 280% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: yft-flow 6s linear infinite;
  filter: drop-shadow(0 0 10px rgba(138, 99, 255, 0.35));
}

#ymm-studio .ymm-main-inner,
#ymm-studio .ymm-view-panel {
  animation: yft-tab-content-in 0.45s cubic-bezier(0.18, 1.2, 0.4, 1) both;
}

#ymm-studio .ymm-studio-hero,
#ymm-studio .ymm-card,
#ymm-studio .ymm-panel {
  border-color: rgba(138, 99, 255, 0.28) !important;
  box-shadow: 0 8px 32px rgba(80, 40, 200, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

/* Explore / chat / modals — tab rail parity */
body.yal-has-shell .yal-explore-tabs,
body.yal-has-shell .yal-chat-tabs,
body.yal-has-shell .x-segment {
  position: relative;
}

body.yal-has-shell .yal-chat-tabs button.active,
body.yal-has-shell .x-segment .active {
  background: var(--yft-grad-text) !important;
  background-size: 280% auto !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  animation: yft-flow 6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .yal-compose-drop-active,
  .yal-universe-drop,
  .yal-universe-upload-overlay,
  .yal-compose-upload-ring,
  .yal-universe-orbit,
  .yal-universe-audio-ring,
  .yal-universe-audio-icon,
  #ymm-studio .ymm-rail-btn.active .ymm-rail-label,
  #ymm-studio .ymm-main-inner {
    animation: none !important;
  }
}
