/*
  overrides.css (AZUR dark)
*/

/* 상단 중앙 토스트 배경 */
.toast-top-bg {
  background:
    radial-gradient(circle at 18% 0%, rgba(139, 92, 246, 0.14) 0%, transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(34, 211, 238, 0.08) 0%, transparent 30%),
    linear-gradient(180deg, rgba(11, 16, 26, 0.96) 0%, rgba(7, 11, 18, 0.96) 100%) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(139, 92, 246, 0.1),
    0 0 24px rgba(34, 211, 238, 0.08);
}

@supports ((backdrop-filter: blur(6px)) or (-webkit-backdrop-filter: blur(6px))) {
  .toast-top-bg {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}

/* 상단 중앙 토스트: 텍스트 색 고정 */
.toast-top-bg :is(h1, h2, h3, h4, h5, h6, p, div, span, small, strong, button, .toast-icon) {
  color: inherit !important;
}

.toast-top-bg svg {
  color: inherit !important;
  stroke: currentColor !important;
}

.toast-top-bg a {
  color: inherit !important;
  text-decoration: underline;
}

.toast-top-bg [aria-label='close'] {
  color: inherit !important;
}

/* 우하단 토스트 포인트 색 표시 */
.toast-accent {
  position: relative;
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb, 139, 92, 246), 0.16),
    0 2px 12px rgba(var(--accent-rgb, 139, 92, 246), 0.12),
    0 10px 28px rgba(0, 0, 0, 0.42);
}

.toast-accent::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent, #8b5cf6);
  border-radius: 8px 0 0 8px;
}

.toast-accent .toast-icon {
  color: rgb(var(--accent-rgb, 139, 92, 246));
}

/* ── 공통: 악센트 색 변수
   --accent / --accent-rgb 를 Item.tsx에서 넣어줌 */

/* 좌측 얇은 바 */
.toast-accent-left {
  position: relative;
}

.toast-accent-left::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent, #8b5cf6);
  border-radius: 8px 0 0 8px;
}

/* 좌측 두꺼운 바 */
.toast-accent-left-thick {
  position: relative;
}

.toast-accent-left-thick::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: var(--accent, #8b5cf6);
  border-radius: 10px 0 0 10px;
}

/* 상단 얇은 바 */
.toast-accent-top {
  position: relative;
}

.toast-accent-top::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent, #8b5cf6);
  border-radius: 10px 10px 0 0;
}

/* 좌측/상단 바 스타일 공통 강화 */
.toast-accent-left,
.toast-accent-left-thick,
.toast-accent-top {
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb, 139, 92, 246), 0.14),
    0 2px 12px rgba(var(--accent-rgb, 139, 92, 246), 0.12),
    0 10px 28px rgba(0, 0, 0, 0.42);
}

/* 아이콘 원형 칩 */
.toast-icon-chip {
  position: relative;
}

.toast-icon-chip .toast-icon {
  position: relative;
  z-index: 1;
  color: rgb(var(--accent-rgb, 139, 92, 246));
}

.toast-icon-chip::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 40px;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: rgba(var(--accent-rgb, 139, 92, 246), 0.16);
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb, 139, 92, 246), 0.26),
    0 0 18px rgba(var(--accent-rgb, 139, 92, 246), 0.22);
  pointer-events: none;
}

/* ===== AZUR 글로우 ===== */

.toast-neon {
  position: relative;
  box-shadow:
    0 0 0 1px rgba(var(--glow-rgb, 139, 92, 246), 0.22),
    0 0 10px rgba(var(--glow-rgb, 139, 92, 246), 0.24),
    0 0 22px rgba(var(--glow-rgb, 34, 211, 238), 0.14),
    0 10px 30px rgba(0, 0, 0, 0.46);
}

.toast-neon::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    closest-side,
    color-mix(in oklab, var(--glow, #8b5cf6) 48%, transparent) 0%,
    transparent 95%
  );
  filter: blur(14px);
  opacity: 0.76;
  animation: neonPulse 2.4s ease-in-out infinite;
  z-index: 0;
}

@keyframes neonPulse {
  0%,
  100% {
    opacity: 0.52;
  }

  50% {
    opacity: 0.78;
  }
}

/* ===== CRT 스캔라인 옵션 ===== */

.toast-scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.07) 0px,
    rgba(255, 255, 255, 0.07) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: screen;
  opacity: 0.13;
  animation: scan 7s linear infinite;
  z-index: 1;
}

@keyframes scan {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 0 8px;
  }
}

/* 우측 하단 토스트: 다크용 텍스트 컬러 */
.toast-br {
  color: #f8fafc !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(139, 92, 246, 0.12) 0%, transparent 34%),
    linear-gradient(180deg, rgba(16, 22, 37, 0.98) 0%, rgba(11, 16, 26, 0.98) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(139, 92, 246, 0.08),
    0 0 22px rgba(34, 211, 238, 0.06);
}

.toast-br :is(h1, h2, h3, h4, h5, h6, p, div, span, small, strong, button, a) {
  color: inherit !important;
}

.toast-br svg {
  color: inherit !important;
  stroke: currentColor !important;
}

.toast-br [aria-label='close'] {
  color: inherit !important;
}

/* 프로그레스 트랙 */
.toast-progress-track-top {
  height: 4px;
  background-color: rgba(255, 255, 255, 0.14) !important;
}

.toast-progress-track-br {
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

/* 프로그레스 막대 */
.toast-progress-bar-top,
.toast-progress-bar-br {
  height: 4px;
  transform-origin: right center;
  will-change: transform;
}

.toast-progress-bar-top {
  background: linear-gradient(90deg, #8b5cf6 0%, #ec4899 48%, #22d3ee 100%) !important;
  box-shadow:
    0 0 10px rgba(139, 92, 246, 0.42),
    0 0 14px rgba(34, 211, 238, 0.24);
}

.toast-progress-bar-br {
  background-color: currentColor !important;
  opacity: 0.78;
}

/* 모션 최소화 환경 */
@media (prefers-reduced-motion: reduce) {
  .toast-progress-bar-top,
  .toast-progress-bar-br,
  .toast-neon::before,
  .toast-scanlines::after,
  .marquee,
  .new-item-flash,
  .new-item-slidein {
    animation: none !important;
    transition: none !important;
  }
}

/* 가로 마키 */
@keyframes marquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.marquee {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 1.25rem;
  animation-name: marquee;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.marquee:hover {
  animation-play-state: paused;
}

/* 새 항목 플래시 */
@keyframes newItemFlash {
  0% {
    box-shadow: 0 0 0 rgba(139, 92, 246, 0);
    transform: translateY(0);
  }

  15% {
    box-shadow:
      0 0 18px rgba(139, 92, 246, 0.42),
      0 0 14px rgba(34, 211, 238, 0.2);
    transform: translateY(-1px);
  }

  60% {
    box-shadow:
      0 0 14px rgba(236, 72, 153, 0.28),
      0 0 10px rgba(34, 211, 238, 0.14);
  }

  100% {
    box-shadow: 0 0 0 rgba(139, 92, 246, 0);
    transform: translateY(0);
  }
}

.new-item-flash {
  animation: newItemFlash 1.2s ease-in-out 0s 2;
}

/* 새 항목 슬라이드 */
@keyframes newItemSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-14px);
  }

  60% {
    opacity: 1;
    transform: translateX(0);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.new-item-slidein {
  animation: newItemSlideIn 420ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

/* 세로로 한 줄씩 올리는 티커 */
.vticker {
  will-change: transform;
  transition: transform 1520ms cubic-bezier(0.2, 0.9, 0.2, 1);
}
