/* Blueprint Noir Modal System
 * Styled confirmation dialogs matching the dark duotone aesthetic
 * Usage: Render shared/confirm_modal partial and trigger via Stimulus
 */

/* Modal Overlay (backdrop) */
.modal-overlay {
  /* Positioning */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;

  /* Visual */
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(8px);

  /* Animation */
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Container */
.modal-container {
  /* Positioning */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;

  /* Sizing */
  width: 90%;
  max-width: 480px;

  /* Visual */
  background: rgba(26, 31, 38, 0.95);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(212, 165, 116, 0.2);
  border-radius: var(--radius-lg);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(212, 165, 116, 0.15),
    inset 0 1px 1px rgba(212, 165, 116, 0.1);

  /* Animation */
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.95);
  transition: all var(--transition-base);
  pointer-events: none;
}

.modal-container.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

/* Modal Header */
.modal-header {
  /* Layout */
  padding: 2rem 2rem 1.5rem 2rem;
  border-bottom: 1px solid rgba(212, 165, 116, 0.1);

  /* Visual */
  background: linear-gradient(
    135deg,
    rgba(212, 165, 116, 0.05) 0%,
    rgba(26, 31, 38, 0) 50%
  );
}

/* Modal Icon Container */
.modal-icon {
  /* Layout */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem auto;

  /* Visual */
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid rgba(239, 68, 68, 0.3);
  border-radius: 50%;
}

.modal-icon svg {
  width: 28px;
  height: 28px;
  color: #EF4444;
  stroke-width: 2;
}

/* Modal Title */
.modal-title {
  /* Typography */
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #FFFFFF;
  text-align: center;
  margin: 0;
}

/* Modal Body */
.modal-body {
  /* Layout */
  padding: 1.5rem 2rem;
}

/* Modal Message */
.modal-message {
  /* Typography */
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #D1D5DB;
  text-align: center;
  margin: 0;
}

.modal-item-name {
  color: var(--color-copper-light);
  font-weight: 600;
}

/* Modal Footer */
.modal-footer {
  /* Layout */
  display: flex;
  gap: 1rem;
  padding: 1.5rem 2rem 2rem 2rem;
  border-top: 1px solid rgba(212, 165, 116, 0.1);

  /* Visual */
  background: linear-gradient(
    0deg,
    rgba(212, 165, 116, 0.03) 0%,
    rgba(26, 31, 38, 0) 100%
  );
}

/* Modal Buttons */
.modal-btn {
  /* Layout */
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  /* Spacing */
  padding: 0.875rem 1.5rem;

  /* Typography */
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;

  /* Visual */
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;

  /* Transitions */
  transition: all var(--transition-quick);
}

/* Cancel Button */
.modal-btn-cancel {
  background: rgba(42, 52, 65, 0.6);
  color: #9CA3AF;
  border: 2px solid rgba(156, 163, 175, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.modal-btn-cancel:hover {
  background: rgba(42, 52, 65, 0.8);
  border-color: rgba(156, 163, 175, 0.3);
  color: #D1D5DB;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.modal-btn-cancel:active {
  transform: translateY(0);
}

/* Confirm/Delete Button */
.modal-btn-danger {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.9) 0%,
    rgba(220, 38, 38, 0.9) 100%
  );
  color: #FFFFFF;
  border: 2px solid rgba(239, 68, 68, 0.4);
  box-shadow:
    0 2px 8px rgba(239, 68, 68, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.modal-btn-danger:hover {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 1) 0%,
    rgba(220, 38, 38, 1) 100%
  );
  transform: translateY(-1px);
  box-shadow:
    0 4px 16px rgba(239, 68, 68, 0.5),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.modal-btn-danger:active {
  transform: translateY(0);
}

/* Disabled state */
.modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .modal-container {
    width: 95%;
    max-width: none;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-btn {
    width: 100%;
  }
}
