/* Shared alert dialogs, delete dialogs, utility states, and animations */

.app-alert-modal {
  position: fixed;
  inset: 0;
  z-index: 6400;
  display: grid;
  place-items: center;
  padding: 20px;
}

.app-alert-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(4, 10, 18, 0.72);
}

.app-alert-dialog {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100% - 8px));
  border: 1px solid rgba(99, 141, 194, 0.62);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 27, 39, 0.97), rgba(13, 21, 31, 0.97));
  padding: 16px 16px 14px;
  display: grid;
  gap: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
}

.app-alert-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  color: #e2efff;
}

.app-alert-message {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #bdd2ec;
  white-space: pre-wrap;
  word-break: break-word;
}

.app-alert-actions {
  display: flex;
  justify-content: flex-end;
}

.app-alert-ok-btn {
  border: 1px solid rgba(72, 123, 204, 0.66);
  border-radius: 8px;
  background: linear-gradient(180deg, #0a2453, #071f45);
  color: #e7f0ff;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1;
  padding: 9px 18px;
  cursor: pointer;
}

.app-alert-ok-btn:hover {
  border-color: rgba(123, 169, 236, 0.78);
  filter: brightness(1.05);
}

.background-state-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(174, 205, 255, 0.35);
  border-top-color: #aecdff;
  border-radius: 999px;
  animation: bg-spin 0.85s linear infinite;
}

.project-delete-modal {
  position: fixed;
  inset: 0;
  z-index: 6450;
  display: grid;
  place-items: center;
  padding: 20px;
}

.project-delete-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(4, 10, 18, 0.76);
}

.project-delete-dialog {
  position: relative;
  z-index: 1;
  width: min(460px, calc(100% - 8px));
  border: 1px solid rgba(198, 122, 151, 0.48);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(24, 20, 28, 0.98), rgba(18, 13, 20, 0.98));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.45);
  padding: 16px 16px 14px;
  display: grid;
  gap: 10px;
}

.project-delete-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.24;
  color: #ffe7f0;
}

.project-delete-message {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #ecc6d5;
}

.project-delete-status {
  margin: 0;
  min-height: 18px;
  font-size: 0.78rem;
  color: #e7afc5;
}

.project-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.project-delete-cancel-btn,
.project-delete-confirm-btn {
  border-radius: 8px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1;
  padding: 9px 14px;
  cursor: pointer;
}

.project-delete-cancel-btn {
  border: 1px solid rgba(129, 141, 163, 0.62);
  background: rgba(16, 24, 36, 0.84);
  color: #d9e2f0;
}

.project-delete-cancel-btn:hover:not(:disabled) {
  border-color: rgba(165, 179, 203, 0.86);
}

.project-delete-confirm-btn {
  border: 1px solid rgba(174, 72, 112, 0.72);
  background: linear-gradient(180deg, #5f1d34, #4e182c);
  color: #ffe6ef;
}

.project-delete-confirm-btn:hover:not(:disabled) {
  border-color: rgba(212, 119, 155, 0.78);
  filter: brightness(1.06);
}

.project-delete-cancel-btn:disabled,
.project-delete-confirm-btn:disabled {
  opacity: 0.74;
  cursor: wait;
}

/* ── Alert Modal ── */
.ad-alert-modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: section-fade 0.18s ease-out;
}

.ad-alert-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  cursor: default;
}

.ad-alert-dialog {
  position: relative;
  z-index: 1;
  width: 360px;
  max-width: 90vw;
  padding: 28px 24px 20px;
  border-radius: 16px;
  border: 1px solid rgba(129, 141, 163, 0.25);
  background: linear-gradient(170deg, #1c2538, #151c2d);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: rise 0.25s ease-out;
}

.ad-alert-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
}

.ad-alert-icon[data-tone="warning"] {
  background: rgba(245, 166, 35, 0.15);
  border: 1px solid rgba(245, 166, 35, 0.35);
}

.ad-alert-icon[data-tone="error"] {
  background: rgba(220, 60, 60, 0.15);
  border: 1px solid rgba(220, 60, 60, 0.35);
}

.ad-alert-icon[data-tone="info"] {
  background: rgba(80, 140, 240, 0.15);
  border: 1px solid rgba(80, 140, 240, 0.35);
}

.ad-alert-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #e4e8f0;
}

.ad-alert-message {
  margin: 0 0 20px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(200, 210, 228, 0.82);
}

.ad-alert-close-btn {
  display: inline-block;
  min-width: 120px;
  padding: 9px 24px;
  border-radius: 10px;
  border: 1px solid rgba(100, 140, 220, 0.45);
  background: linear-gradient(180deg, #2a3a5c, #1f2e4a);
  color: #d0d8e8;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, filter 0.15s;
}

.ad-alert-close-btn:hover {
  border-color: rgba(140, 175, 240, 0.7);
  filter: brightness(1.1);
}

.is-hidden {
  display: none !important;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes section-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes bg-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes bg-progress-wait {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 32px 0;
  }
}

@keyframes tap {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.995);
  }
  100% {
    transform: scale(1);
  }
}

