/* Dynamic Toast - Independent CSS */
/* No Tailwind required! */

/* Container & Positioning */
.di-container {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Position Classes */
.di-pos-top-center {
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
}

.di-pos-top-left {
  top: 24px;
  left: 24px;
  transform: none;
}

.di-pos-top-right {
  top: 24px;
  right: 24px;
  transform: none;
}

.di-pos-bottom-center {
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
}

.di-pos-bottom-left {
  bottom: 24px;
  left: 24px;
  transform: none;
}

.di-pos-bottom-right {
  bottom: 24px;
  right: 24px;
  transform: none;
}

/* Base Toast Styles */
.di-base {
  pointer-events: auto;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1.2);
  background: #000;
  min-width: 120px;
  height: 36px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  position: relative;
  cursor: pointer;
}

.di-base.active {
  min-width: 360px;
  height: 84px;
  border-radius: 38px;
  padding: 0 20px;
  cursor: default;
}

.di-base.idle {
  width: 124px;
  height: 38px;
}

/* Float Animation */
.di-base.idle {
  animation: di-float 3s ease-in-out infinite;
}

@keyframes di-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Pulse Animation */
@keyframes di-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

.di-pulse {
  animation: di-pulse 0.3s ease-out;
}

/* Progress Indicator */
.di-progress-outer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.di-base.active .di-progress-outer {
  opacity: 1;
}

.di-rect-outer {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 2;
  stroke-linecap: round;
}

/* Content Area */
.di-content {
  opacity: 0;
  transition: opacity 0.2s ease;
  display: none;
  width: 100%;
  z-index: 10;
  align-items: center;
  justify-content: space-between;
}

.di-base.active .di-content {
  opacity: 1;
  display: flex;
}

/* Idle View (dots) */
.di-idle-view {
  display: flex;
  align-items: center;
  gap: 4px;
}

.di-dot {
  width: 6px;
  height: 6px;
  background: #444;
  border-radius: 50%;
}

/* Close Button */
.di-close-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 20;
}

.di-counter-text {
  font-size: 11px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
}

.di-close-icon {
  position: absolute;
  opacity: 0;
  transform: scale(0.5) rotate(-45deg);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.di-close-btn:hover .di-counter-text {
  opacity: 0;
  transform: scale(0.4);
}

.di-close-btn:hover .di-close-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.di-btn-svg {
  position: absolute;
  transform: rotate(-90deg);
  width: 36px;
  height: 36px;
}

.di-btn-circle {
  fill: none;
  stroke: white;
  stroke-width: 2.5;
  stroke-dasharray: 88;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}

/* Spinner for Loading State */
.di-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border-top-color: #fff;
  animation: di-spin 0.8s linear infinite;
}

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

/* Flexbox utilities for content layout */
.di-content > div {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

#di-icon {
  flex-shrink: 0;
}

#di-icon > div:not(.di-spinner) {
  padding: 8px;
  border-radius: 16px;
}

/* Icon background colors */
.di-icon-success {
  background-color: #10b981;
  padding: 8px;
  border-radius: 16px;
}

.di-icon-error {
  background-color: #f43f5e;
  padding: 8px;
  border-radius: 16px;
}

.di-icon-info {
  background-color: #2563eb;
  padding: 8px;
  border-radius: 16px;
}

/* Text styling */
#di-title {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.025em;
}

#di-msg {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}

/* Text container */
.di-content > div > div:nth-child(2) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Close button container */
.di-content > div > div:last-child {
  margin-left: auto;
}

/* SVG icon styles */
#di-icon svg {
  display: block;
}
