@charset "utf-8";

/*
  Toast (공통)
  - Root: .c-toast-root[data-toast-root]
  - Stack: .c-toast-stack[data-toast-stack="bottom-center" ...]
  - Item: .c-toast
*/

.c-toast-root{
  position: fixed;
  inset: 0;
  z-index: var(--z-toast);
  pointer-events: none;
}

.c-toast-stack{
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(92vw, 420px);
  pointer-events: none;
}

/* bottom positions */
.c-toast-stack[data-toast-stack^="bottom"]{
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 16px);
}
body.is-bottom-hidden .c-toast-stack[data-toast-stack^="bottom"]{
  bottom: calc(env(safe-area-inset-bottom) + 16px);
}

/* top positions */
.c-toast-stack[data-toast-stack^="top"]{
  top: calc(var(--header-h) + env(safe-area-inset-top) + 12px);
}

/* horizontal alignment */
.c-toast-stack[data-toast-stack$="-center"]{
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
}
.c-toast-stack[data-toast-stack$="-left"]{
  left: 12px;
  align-items: flex-start;
}
.c-toast-stack[data-toast-stack$="-right"]{
  right: 12px;
  align-items: flex-end;
}

/* per-item offset (추가 여백) */
.c-toast{
  --toast-offset: 0px;

  position: relative;
  transform: translate3d(0, 10px, 0);
  opacity: 0;
  pointer-events: auto;

  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.92);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.14);

  font-size: 13px;
  line-height: 1.35;
  max-width: 100%;
  overflow: hidden;

  will-change: transform, opacity;
  transition: transform .18s ease, opacity .18s ease;
}

/* bottom stack: offset pushes up; top stack: offset pushes down */
.c-toast-stack[data-toast-stack^="bottom"] .c-toast{
  margin-bottom: var(--toast-offset);
}
.c-toast-stack[data-toast-stack^="top"] .c-toast{
  margin-top: var(--toast-offset);
}

.c-toast.is-on{
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.c-toast__msg{
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  word-break: keep-all;
  white-space: pre-wrap;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* types (최소한의 구분) */
.c-toast--success{
  border: 1px solid rgba(255,255,255,.18);
}
.c-toast--warning{
  border: 1px solid rgba(255,255,255,.18);
}
.c-toast--error{
  border: 1px solid rgba(255,255,255,.18);
}

/* 타입별 메시지 색상 
.c-toast--success .c-toast__msg{
  color: #81c784;
}
.c-toast--error .c-toast__msg{
  color: #ff8a80;
}
.c-toast--warning .c-toast__msg{
  color: #ffd54f;
}
*/

/* spinner */
.c-toast__spinner{
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  animation: toast-spin .75s linear infinite;
  flex: 0 0 auto;
}

@keyframes toast-spin{
  to { transform: rotate(360deg); }
}

/* action button */
.c-toast__action{
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  font-size: 12px;
}

/* close button */
.c-toast__close{
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.08);
}

.c-toast__close .material-symbols-outlined{
  font-size: 18px;
}

/* progress bar */
.c-toast__bar{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 0 0 999px 999px;
  background: rgba(255,255,255,.18);
  overflow: hidden;
  pointer-events: none;
}

.c-toast__barfill{
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,.85);
  transition: width .2s ease, background .3s ease;
}

.c-toast__bar.is-complete{
  height: 6px;
  transition: height .2s ease;
}

.c-toast__bar.is-complete .c-toast__barfill{
  background: #4caf50;
}