/* KingOfPeace Books - Custom Popup System */

/* Popup Overlay */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Popup Container */
.popup-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.popup-overlay.active .popup-container {
  transform: scale(1) translateY(0);
}

/* Popup Header */
.popup-header {
  background: linear-gradient(135deg, #0a4ea1 0%, #1a5fb4 100%);
  color: white;
  padding: 20px 24px;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.popup-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}

.popup-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 18px;
}

.popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Popup Body */
.popup-body {
  padding: 24px;
}

.popup-message {
  color: #374151;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Popup Footer */
.popup-footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.popup-button {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  min-width: 80px;
}

.popup-button-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  color: white;
}

.popup-button-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.popup-button-secondary {
  background: #f3f4f6;
  color: #374151;
}

.popup-button-secondary:hover {
  background: #e5e7eb;
}

.popup-button-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.popup-button-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Popup Types */
.popup-overlay.success .popup-header {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.popup-overlay.warning .popup-header {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.popup-overlay.error .popup-header {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.popup-overlay.info .popup-header {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* Animation for popup entrance */
@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes popupSlideOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
}

.popup-overlay.removing .popup-container {
  animation: popupSlideOut 0.3s ease forwards;
}

/* Responsive Design */
@media (max-width: 480px) {
  .popup-container {
    width: 95%;
    margin: 20px;
  }
  
  .popup-header {
    padding: 16px 20px;
  }
  
  .popup-body {
    padding: 20px;
  }
  
  .popup-footer {
    padding: 0 20px 20px;
    flex-direction: column;
  }
  
  .popup-button {
    width: 100%;
  }
}
