/**
 * Toast Notification Styles
 *
 * 알림 도착 시 우측 상단에 표시되는 토스트 알림 카드 스타일
 * - 5초 자동 닫힘 + 원형 타이머
 * - 큰 아이콘 + 세로 스택 레이아웃
 * - 스택으로 쌓임 (최대 3개)
 */

/* ===== Toast Container ===== */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 360px;
  width: 100%;
}

@media (max-width: 480px) {
  .toast-container {
    top: 8px;
    right: 8px;
    left: 8px;
    max-width: none;
    width: auto;
  }
}

/* ===== Toast Card ===== */
.toast-card {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  animation: toast-slide-in 0.3s ease-out;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.toast-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.toast-card.toast-card--closing {
  animation: toast-slide-out 0.25s ease-in forwards;
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ===== Toast Layout (Icon | Content Stack | Actions) ===== */
.toast-card__layout {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

/* Large Icon - 세로 가운데 정렬 */
.toast-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
  background: var(--color-primary-soft, rgba(59, 130, 246, 0.15));
  color: var(--color-primary, #3B82F6);
}

.toast-card__icon .material-symbols-rounded {
  font-size: 24px;
}

/* Content Area (Type / Title / Body) */
.toast-card__content-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toast-card__type {
  font-size: 11px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toast-card__title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.85);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.toast-card__body {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.55);
  margin-top: 2px;
  max-height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ===== Actions (Timer + Close) ===== */
.toast-card__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  align-self: flex-start;
}

/* Circular Timer */
.toast-card__timer {
  width: 18px;
  height: 18px;
  position: relative;
}

.toast-card__timer svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.toast-card__timer circle {
  fill: none;
  stroke: rgba(0, 0, 0, 0.15);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 50.265;  /* 2 * PI * 8 */
  stroke-dashoffset: 0;
  animation: toast-timer-countdown var(--duration, 5000ms) linear forwards;
}

.toast-card--paused .toast-card__timer circle {
  animation-play-state: paused;
}

@keyframes toast-timer-countdown {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: 50.265;
  }
}

/* Close Button */
.toast-card__close {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.toast-card__close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.7);
}

.toast-card__close .material-symbols-rounded {
  font-size: 16px;
}

/* ===== Type Variants ===== */
/* Mention */
.toast-card--mention .toast-card__icon {
  background: rgba(59, 130, 246, 0.15);
  color: #3B82F6;
}

/* In Review / MCP Review */
.toast-card--in_review .toast-card__icon,
.toast-card--mcp_review_pending .toast-card__icon {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}

/* Status Change */
.toast-card--reviewer_status_change .toast-card__icon {
  background: rgba(139, 92, 246, 0.15);
  color: #8B5CF6;
}

/* Assigned */
.toast-card--reviewer_assigned .toast-card__icon {
  background: rgba(34, 197, 94, 0.15);
  color: #22C55E;
}

/* Task Created */
.toast-card--task_created .toast-card__icon {
  background: rgba(34, 197, 94, 0.15);
  color: #22C55E;
}

/* Schedule */
.toast-card--schedule_executed .toast-card__icon,
.toast-card--schedule_set .toast-card__icon {
  background: rgba(14, 165, 233, 0.15);
  color: #0EA5E9;
}

/* Failed */
.toast-card--meeting_transcription_failed .toast-card__icon,
.toast-card--meeting_summary_failed .toast-card__icon {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

/* Meeting */
.toast-card--meeting_transcription_completed .toast-card__icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

/* Admin */
.toast-card--admin_ping .toast-card__icon {
  background: rgba(236, 72, 153, 0.15);
  color: #EC4899;
}

/* Feedback Reply */
.toast-card--feedback_reply .toast-card__icon {
  background: rgba(99, 102, 241, 0.15);
  color: #6366F1;
}

/* Sensitive Review */
.toast-card--sensitive_review_required .toast-card__icon {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

/* New Message */
.toast-card--reviewer_new_message .toast-card__icon {
  background: rgba(59, 130, 246, 0.15);
  color: #3B82F6;
}

/* Archived */
.toast-card--contributor_archived .toast-card__icon {
  background: rgba(107, 114, 128, 0.15);
  color: #6B7280;
}
