/**
 * print-failure-alert.css — styling for print failure modal dialog.
 *
 * Provides:
 *   - Full-screen overlay backdrop with semi-transparent background
 *   - Centered modal box with shadow
 *   - Red header for alert styling
 *   - Content area with printer name and error message
 *   - Action buttons (Retry / Dismiss)
 *
 * Responsive:
 *   - Adapts width and padding on smaller screens
 *   - Touch-friendly button sizes
 */

.print-failure-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998; /* Below toast container (10000) but above all page content */
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.print-failure-modal {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  min-width: 300px;
  max-width: 500px;
  width: calc(100vw - 2rem);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.print-failure-header {
  background-color: #dc2626;
  color: #ffffff;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid #b91c1c;
}

.print-failure-content {
  padding: 1.5rem 1rem;
  text-align: center;
}

.printer-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: #1f2937;
  word-break: break-word;
}

.error-message {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
  word-break: break-word;
  line-height: 1.4;
  font-family: "Courier New", monospace;
}

.print-failure-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-top: 1px solid #e5e7eb;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn-retry,
.btn-dismiss {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 100px;
  touch-action: manipulation;
}

.btn-retry {
  background-color: #2563eb;
  color: #ffffff;
}

.btn-retry:hover:not(:disabled) {
  background-color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-retry:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-retry:disabled {
  background-color: #9ca3af;
  color: #ffffff;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-dismiss {
  background-color: #e5e7eb;
  color: #1f2937;
}

.btn-dismiss:hover:not(:disabled) {
  background-color: #d1d5db;
}

.btn-dismiss:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-dismiss:disabled {
  background-color: #d1d5db;
  color: #6b7280;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Mobile/tablet adjustments */
@media (max-width: 640px) {
  .print-failure-modal {
    min-width: unset;
    width: 90vw;
    max-width: 90vw;
  }

  .print-failure-header {
    font-size: 0.95rem;
    padding: 0.875rem;
  }

  .print-failure-content {
    padding: 1rem;
  }

  .print-failure-actions {
    padding: 0.875rem;
    gap: 0.5rem;
  }

  .btn-retry,
  .btn-dismiss {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    min-width: 90px;
    flex: 1;
  }
}

/* Landscape mode on tablets */
@media (max-height: 500px) {
  .print-failure-modal {
    max-height: 90vh;
    overflow-y: auto;
  }

  .print-failure-content {
    padding: 1rem 0.75rem;
  }
}
