/* Yaloo Apple Future — premium glass, calm motion, no spinners */

:root {
  --yaf-bg: #000000;
  --yaf-surface: rgba(28, 28, 30, 0.72);
  --yaf-surface-2: rgba(44, 44, 46, 0.55);
  --yaf-glass: rgba(255, 255, 255, 0.06);
  --yaf-glass-border: rgba(255, 255, 255, 0.12);
  --yaf-glass-highlight: rgba(255, 255, 255, 0.18);
  --yaf-blue: #0a84ff;
  --yaf-cyan: #64d2ff;
  --yaf-violet: #bf5af2;
  --yaf-text: #f5f5f7;
  --yaf-muted: #98989d;
  --yaf-grad: linear-gradient(135deg, #0a84ff 0%, #64d2ff 48%, #5e5ce6 100%);
  --yaf-grad-soft: linear-gradient(
    160deg,
    rgba(10, 132, 255, 0.22) 0%,
    rgba(100, 210, 255, 0.12) 40%,
    rgba(191, 90, 242, 0.08) 100%
  );
  --yaf-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --yaf-blur: blur(40px) saturate(180%);
  --bg: var(--yaf-bg);
  --panel: #1c1c1e;
  --border: rgba(255, 255, 255, 0.1);
  --text: var(--yaf-text);
  --muted: var(--yaf-muted);
  --blue: var(--yaf-blue);
}

/* ── Remove spinning elements on feed / shell ── */
.yal-shell-orbit,
body.yal-has-shell .yal-login-orbit {
  display: none !important;
}

body.yal-has-shell .x-compose.yal-glass-panel::before,
.x-center form.x-compose .x-compose-actions-icons > button[type="submit"]::after {
  animation: none !important;
  background: linear-gradient(
    135deg,
    rgba(10, 132, 255, 0.55),
    rgba(100, 210, 255, 0.35),
    rgba(191, 90, 242, 0.22)
  ) !important;
  opacity: 0.45;
}

.yal-shell-grid {
  animation: none !important;
  opacity: 0.18 !important;
  transform: perspective(520px) rotateX(68deg) !important;
}

body.yal-has-shell .yal-universe-audio-ring,
body.yal-has-shell .yal-compose-upload-ring {
  animation: none !important;
}

/* ── Ambient mesh (Apple-style dark wallpaper) ── */
body.yal-has-shell::before,
body:has(.x-shell)::before {
  content: "";
  position: fixed;
  inset: -15%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 42% 36% at 12% 18%, rgba(10, 132, 255, 0.18), transparent 58%),
    radial-gradient(ellipse 38% 34% at 88% 12%, rgba(100, 210, 255, 0.12), transparent 55%),
    radial-gradient(ellipse 48% 40% at 72% 82%, rgba(191, 90, 242, 0.1), transparent 60%),
    radial-gradient(ellipse 55% 45% at 38% 72%, rgba(94, 92, 230, 0.08), transparent 58%),
    #000;
  background-size: 200% 200%, 220% 220%, 180% 180%, 240% 240%, auto;
  animation: yaf-mesh-drift 32s ease-in-out infinite;
}

body.yal-shell-fx-active::before {
  opacity: 0.72;
}

@keyframes yaf-mesh-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-1.2%, 1.5%) scale(1.02); }
}

/* ── Center column — frosted channel ── */
body.yal-has-shell .x-center {
  position: relative;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 12%),
    linear-gradient(180deg, rgba(28, 28, 30, 0.55) 0%, rgba(0, 0, 0, 0.92) 100%);
  backdrop-filter: var(--yaf-blur);
  -webkit-backdrop-filter: var(--yaf-blur);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.06),
    inset -1px 0 0 rgba(255, 255, 255, 0.04),
    0 0 120px rgba(10, 132, 255, 0.04);
  animation: none !important;
}

/* ── Compose — hero glass card ── */
body.yal-has-shell .x-compose.yal-glass-panel {
  margin: 14px 14px 0;
  border-radius: 22px !important;
  background: var(--yaf-surface) !important;
  border: 1px solid var(--yaf-glass-border) !important;
  box-shadow:
    var(--yaf-shadow),
    inset 0 1px 0 var(--yaf-glass-highlight) !important;
  backdrop-filter: var(--yaf-blur);
  -webkit-backdrop-filter: var(--yaf-blur);
  animation: yaf-compose-breathe 6s ease-in-out infinite;
}

@keyframes yaf-compose-breathe {
  0%, 100% {
    box-shadow: var(--yaf-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }
  50% {
    box-shadow:
      0 28px 90px rgba(0, 0, 0, 0.6),
      0 0 48px rgba(10, 132, 255, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
}

body.yal-has-shell .x-compose:focus-within {
  animation: none;
  border-color: rgba(10, 132, 255, 0.45) !important;
  box-shadow:
    0 0 0 1px rgba(10, 132, 255, 0.35),
    0 0 40px rgba(10, 132, 255, 0.12),
    var(--yaf-shadow) !important;
}

body.yal-has-shell .x-compose.yn2-compose-flash {
  animation: yaf-compose-flash 0.65s ease-out;
}

@keyframes yaf-compose-flash {
  0% { filter: brightness(1.25); }
  100% { filter: none; }
}

body.yal-has-shell .x-center-head.yal-glass-panel {
  background: rgba(0, 0, 0, 0.72) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}

body.yal-has-shell .x-center-head.yal-glass-panel::after {
  background: var(--yaf-grad) !important;
  opacity: 0.85;
  height: 1px;
}

/* ── Feed posts — clean glass cards ── */
body.yal-has-shell .x-center .x-post {
  margin: 0 10px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding: 16px 16px 16px 18px;
  background: rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  transition:
    transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.28s ease,
    border-color 0.28s ease,
    background 0.28s ease;
}

body.yal-has-shell .x-center .x-post::before {
  animation: none !important;
  background: var(--yaf-grad) !important;
  opacity: 0;
  width: 3px;
  transition: opacity 0.25s ease;
}

body.yal-has-shell .x-center .x-post::after {
  animation: none !important;
}

body.yal-has-shell .x-center .x-post:hover {
  animation: none !important;
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(10, 132, 255, 0.08) inset !important;
  transform: translateY(-2px);
}

body.yal-has-shell .x-center .x-post:hover::before {
  opacity: 0.9;
}

body.yal-has-shell .x-center .x-post.yn2-post-enter {
  animation: yaf-post-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.yal-has-shell .x-center .x-post.yn2-post-fresh {
  border-color: rgba(10, 132, 255, 0.35) !important;
  background: rgba(10, 132, 255, 0.06);
  box-shadow:
    inset 3px 0 0 var(--yaf-blue),
    0 0 32px rgba(10, 132, 255, 0.12),
    0 12px 40px rgba(0, 0, 0, 0.35) !important;
  animation: yaf-fresh-glow 2.4s ease-in-out 2;
}

@keyframes yaf-post-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes yaf-fresh-glow {
  0%, 100% { box-shadow: inset 3px 0 0 var(--yaf-blue), 0 0 24px rgba(10, 132, 255, 0.1); }
  50% { box-shadow: inset 3px 0 0 var(--yaf-cyan), 0 0 40px rgba(100, 210, 255, 0.18); }
}

/* ── Avatars — subtle ring ── */
body.yal-has-shell .x-post-avatar img,
body.yal-has-shell .x-post-avatar > div {
  box-shadow:
    0 0 0 1.5px rgba(255, 255, 255, 0.14),
    0 4px 16px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.25s ease, transform 0.22s ease;
}

body.yal-has-shell .x-post:hover .x-post-avatar img,
body.yal-has-shell .x-post:hover .x-post-avatar > div {
  box-shadow:
    0 0 0 2px rgba(10, 132, 255, 0.45),
    0 8px 24px rgba(10, 132, 255, 0.15);
  transform: scale(1.03);
}

/* ── Typography ── */
body.yal-has-shell .x-post-text {
  font-size: 1.01rem;
  line-height: 1.52;
  letter-spacing: -0.01em;
  color: var(--yaf-text);
  font-weight: 400;
}

body.yal-has-shell .x-post-header strong {
  letter-spacing: -0.02em;
}

/* ── Stats — tactile pills ── */
body.yal-has-shell .x-post-stats .x-stat-btn {
  padding: 6px 12px;
  min-height: 36px;
  font-weight: 500;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.18s ease;
}

body.yal-has-shell .x-post-stats .x-stat-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.yal-has-shell .x-stat-btn.is-liked svg {
  animation: none !important;
  filter: drop-shadow(0 0 6px rgba(255, 45, 85, 0.45));
}

/* ── Sidebar — floating dock ── */
body.yal-has-shell .x-left {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.88));
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

body.yal-has-shell .x-left .x-nav-btn.active {
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 4px 20px rgba(0, 0, 0, 0.25) !important;
}

body.yal-has-shell .x-left .x-nav-btn.active .x-nav-icon-wrap {
  box-shadow: 0 0 20px rgba(10, 132, 255, 0.25);
}

/* ── Tabs ── */
body.yal-has-shell .x-home-tabs,
body.yal-has-shell .x-profile-tabs,
body.yal-has-shell .x-notif-tabs,
body.yal-has-shell .yal-explore-tabs {
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  background: rgba(0, 0, 0, 0.75) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

body.yal-has-shell .x-home-tab.active,
body.yal-has-shell .x-profile-tabs button.active,
body.yal-has-shell .x-notif-tabs button.active,
body.yal-has-shell .yal-explore-tabs button.active {
  color: var(--yaf-text) !important;
  text-shadow: none;
}

/* ── Right panel ── */
body.yal-has-shell .x-right > .x-panel.yal-glass-panel {
  background: var(--yaf-surface) !important;
  border: 1px solid var(--yaf-glass-border) !important;
  border-radius: 20px !important;
  backdrop-filter: var(--yaf-blur);
  -webkit-backdrop-filter: var(--yaf-blur);
  box-shadow: var(--yaf-shadow) !important;
}

body.yal-has-shell .x-right > .x-panel.yal-glass-panel:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16) !important;
}

body.yal-has-shell .x-right > .x-panel.yal-glass-panel:hover::before {
  animation: none !important;
  opacity: 0;
}

/* ── CTAs — Apple blue gradient, no spin ── */
.x-center form.x-compose .x-compose-actions-icons > button[type="submit"]:not(:disabled),
.x-left .x-post-btn,
body.yal-has-shell #yal-fab {
  background: var(--yaf-grad) !important;
  background-size: 100% auto !important;
  animation: yaf-cta-shine 4s ease-in-out infinite !important;
  border: none !important;
  box-shadow:
    0 8px 28px rgba(10, 132, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

@keyframes yaf-cta-shine {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

.x-left .x-post-btn:hover,
body.yal-has-shell #yal-fab:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 36px rgba(10, 132, 255, 0.45) !important;
}

/* ── Post burst — soft flash ── */
.yn2-post-burst {
  background: radial-gradient(circle at 50% 20%, rgba(10, 132, 255, 0.14), transparent 50%);
}

/* ── Shell atmosphere — calmer ── */
body.yal-shell-fx-active .yal-shell-fx .yal-shell-canvas {
  opacity: 0.28 !important;
}

body.yal-shell-fx-active .yal-shell-fx .yal-login-aurora {
  opacity: 0.22 !important;
  filter: blur(80px);
}

body.yal-shell-fx-active .yal-shell-fx .yal-login-aurora--1 {
  background: radial-gradient(circle, rgba(10, 132, 255, 0.55), transparent 70%) !important;
}

body.yal-shell-fx-active .yal-shell-fx .yal-login-aurora--2 {
  background: radial-gradient(circle, rgba(100, 210, 255, 0.45), transparent 70%) !important;
}

body.yal-shell-fx-active .yal-shell-fx .yal-login-aurora--3 {
  background: radial-gradient(circle, rgba(94, 92, 230, 0.35), transparent 70%) !important;
}

body.yal-shell-fx-active .yal-shell-scan {
  opacity: 0.35 !important;
  animation-duration: 14s !important;
}

.yal-glass-hud-corner {
  border-color: rgba(255, 255, 255, 0.2) !important;
  animation: none !important;
  opacity: 0.4;
}

/* ── Scrollbars ── */
body.yal-has-shell .x-center::-webkit-scrollbar {
  width: 6px;
}

body.yal-has-shell .x-center::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

body.yal-has-shell .x-center::-webkit-scrollbar-track {
  background: transparent;
}

/* ── Login parity ── */
.x-auth-wrap.yal-login-enhanced {
  background:
    radial-gradient(circle at 12% 18%, rgba(10, 132, 255, 0.22), transparent 44%),
    radial-gradient(circle at 88% 12%, rgba(100, 210, 255, 0.16), transparent 42%),
    radial-gradient(circle at 52% 98%, rgba(191, 90, 242, 0.12), transparent 50%),
    #000 !important;
}

.x-auth-wrap.yal-login-enhanced .x-auth-card {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow:
    0 0 80px rgba(10, 132, 255, 0.12),
    0 24px 64px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

@media (prefers-reduced-motion: reduce) {
  body.yal-has-shell::before,
  body.yal-has-shell .x-compose.yal-glass-panel,
  body.yal-has-shell .x-center .x-post.yn2-post-enter,
  body.yal-has-shell .x-center .x-post.yn2-post-fresh,
  .x-center form.x-compose .x-compose-actions-icons > button[type="submit"]:not(:disabled),
  .x-left .x-post-btn,
  body.yal-has-shell #yal-fab {
    animation: none !important;
  }
}
