:root {
  --dc-bg: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
  /* фон панели с градиентом */
  --dc-border: rgba(34, 197, 94, 0.3);
  --dc-shadow: rgba(0, 0, 0, 0.4);
  --dc-text: #e2e8f0;
  --dc-muted: #94a3b8;

  --dc-green: #22c55e;
  /* Основной зелёный */
  --dc-green-hover: #16a34a;
  --dc-green-glow: rgba(34, 197, 94, 0.2);

  --dc-btn-bg: rgba(255, 255, 255, .06);
  --dc-btn-border: rgba(34, 197, 94, 0.2);
  --dc-btn-hover-bg: rgba(34, 197, 94, 0.1);
}

.unsaved-changes-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(calc(100% + 24px));
  width: min(980px, calc(100vw - 32px));
  min-height: 64px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  padding: 0 24px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--dc-text);

  border: 1px solid var(--dc-border);
  border-radius: 16px;

  box-shadow: 
    0 10px 40px var(--dc-shadow),
    0 0 0 1px rgba(34, 197, 94, 0.1),
    0 0 60px rgba(34, 197, 94, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 10000;

  opacity: 0;
  pointer-events: none;

  /* Плавная анимация появления */
  transition:
    transform 400ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 300ms ease,
    box-shadow 300ms ease;
}

.unsaved-changes-bar::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.05));
  border-radius: 16px;
  z-index: -1;
  opacity: 0;
  transition: opacity 300ms ease;
}

.unsaved-changes-bar.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.unsaved-changes-bar.is-visible::before {
  opacity: 1;
}

.unsaved-changes-bar__text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--dc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 10px;
}

.unsaved-changes-bar__text::before {
  content: '⚠️';
  font-size: 18px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.unsaved-changes-bar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.unsaved-btn {
  height: 42px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  outline: none;
  cursor: pointer;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.unsaved-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 250ms ease;
}

.unsaved-btn:hover::before {
  opacity: 1;
}

.unsaved-btn--reset {
  background: rgba(255, 255, 255, 0.05);
  color: var(--dc-muted);
  border-color: var(--dc-btn-border);
}

.unsaved-btn--reset:hover {
  background: var(--dc-btn-hover-bg);
  color: var(--dc-text);
  border-color: rgba(34, 197, 94, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.unsaved-btn--reset:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.unsaved-btn--save {
  background: linear-gradient(135deg, var(--dc-green), var(--dc-green-hover));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--dc-green-glow);
}

.unsaved-btn--save:hover {
  background: linear-gradient(135deg, var(--dc-green-hover), #15803d);
  transform: translateY(-2px);
  box-shadow: 
    0 6px 20px rgba(34, 197, 94, 0.3),
    0 0 30px rgba(34, 197, 94, 0.2);
}

.unsaved-btn--save:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--dc-green-glow);
}

.unsaved-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
}

/* Saving state with spinner */
.unsaved-btn--save.is-saving {
  position: relative;
  padding-right: 44px;
  pointer-events: none;
}

.unsaved-btn--save.is-saving::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: rgba(255, 255, 255, 1);
  animation: dcspin .6s linear infinite;
}

@keyframes dcspin {
  to {
    transform: rotate(360deg);
  }
}

/* Мобильная адаптация */
@media (max-width: 768px) {
  .unsaved-changes-bar {
    bottom: 16px;
    min-height: 56px;
    padding: 0 16px;
    flex-direction: column;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .unsaved-changes-bar__text {
    font-size: 14px;
  }

  .unsaved-changes-bar__actions {
    width: 100%;
    gap: 8px;
  }

  .unsaved-btn {
    flex: 1;
    height: 38px;
    font-size: 13px;
  }
}