/**
 * Confirm Dialog Styles
 * Purpose: Modal dialog animations and styling
 * Author: BUILDER
 * Date: 2025-01-09
 */

/* Dialog Container */
.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.confirm-dialog[hidden] {
  display: none;
}

/* Backdrop with fade animation */
.confirm-dialog__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: confirm-dialog-fade-in 0.2s ease-out;
}

.confirm-dialog[hidden] .confirm-dialog__backdrop {
  animation: confirm-dialog-fade-out 0.15s ease-out;
}

/* Container for centering */
.confirm-dialog__container {
  position: relative;
  width: 100%;
  max-width: 420px;
  animation: confirm-dialog-scale-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-dialog[hidden] .confirm-dialog__container {
  animation: confirm-dialog-scale-out 0.15s ease-out;
}

/* Content card */
.confirm-dialog__content {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* Header */
.confirm-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.confirm-dialog__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
}

.confirm-dialog__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s ease;
}

.confirm-dialog__close:hover {
  background-color: #f3f4f6;
  color: #374151;
}

.confirm-dialog__close:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Body */
.confirm-dialog__body {
  padding: 1.25rem 1.5rem;
}

.confirm-dialog__message {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #4b5563;
}

/* Footer */
.confirm-dialog__footer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.25rem;
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

/* Buttons */
.confirm-dialog__btn {
  flex: 1;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.confirm-dialog__btn:focus {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #3b82f6;
}

/* Cancel button */
.confirm-dialog__btn--cancel {
  background-color: #ffffff;
  border-color: #d1d5db;
  color: #374151;
}

.confirm-dialog__btn--cancel:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

/* Confirm button - Primary */
.confirm-dialog__btn--primary {
  background-color: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
}

.confirm-dialog__btn--primary:hover {
  background-color: #2563eb;
  border-color: #2563eb;
}

/* Confirm button - Danger */
.confirm-dialog__btn--danger {
  background-color: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.confirm-dialog__btn--danger:hover {
  background-color: #b91c1c;
  border-color: #b91c1c;
}

/* Confirm button - Success */
.confirm-dialog__btn--success {
  background-color: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}

.confirm-dialog__btn--success:hover {
  background-color: #15803d;
  border-color: #15803d;
}

/* Animations */
@keyframes confirm-dialog-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes confirm-dialog-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes confirm-dialog-scale-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes confirm-dialog-scale-out {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .confirm-dialog__backdrop,
  .confirm-dialog__container {
    animation: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .confirm-dialog__content {
    background: #1f2937;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  }

  .confirm-dialog__header {
    border-bottom-color: #374151;
  }

  .confirm-dialog__title {
    color: #f9fafb;
  }

  .confirm-dialog__close {
    color: #9ca3af;
  }

  .confirm-dialog__close:hover {
    background-color: #374151;
    color: #d1d5db;
  }

  .confirm-dialog__message {
    color: #d1d5db;
  }

  .confirm-dialog__footer {
    background-color: #111827;
    border-top-color: #374151;
  }

  .confirm-dialog__btn--cancel {
    background-color: #374151;
    border-color: #4b5563;
    color: #d1d5db;
  }

  .confirm-dialog__btn--cancel:hover {
    background-color: #4b5563;
    border-color: #6b7280;
  }
}