/**
 * Standardized Popup/Modal System
 * 
 * This CSS provides consistent styling for all popup types including:
 * - Info popups (blue accent)
 * - Warning popups (yellow accent)  
 * - Error popups (red accent)
 * - Success popups (green accent)
 * - Confirmation dialogs (blue accent)
 *
 * Features:
 * - Responsive design for all screen sizes
 * - Accessibility support with proper ARIA roles
 * - Smooth animations with reduced motion support
 * - Consistent typography and spacing
 * 
 * @version 1.0.0
 */

/* Base overlay container */

.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  background-color: rgba(10, 10, 10, 0.6);
  pointer-events: none;
}

.popup-overlay.is-open {
  display: flex;
  pointer-events: auto;
}

.popup-dialog {
  position: relative;
  max-width: min(480px, 90vw);
  width: 100%;
  padding: var(--spacing-lg);
  border-radius: 0.75rem;
  background-color: var(--surface-color);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.popup-overlay.is-open .popup-dialog {
  transform: scale(1);
  opacity: 1;
}

/* Popup Types */
.popup-dialog--info {
  border-left: 4px solid var(--primary-color);
}

.popup-dialog--warning {
  border-left: 4px solid #ffdd57;
}

.popup-dialog--error {
  border-left: 4px solid var(--danger-color);
}

.popup-dialog--success {
  border-left: 4px solid var(--secondary-color);
}

.popup-dialog--confirm {
  border-left: 4px solid var(--primary-color);
}

/* Icon area for different popup types */
.popup-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: var(--spacing-sm);
}

.popup-dialog--info .popup-icon {
  background-color: rgba(72, 95, 199, 0.1);
  color: var(--primary-color);
}

.popup-dialog--warning .popup-icon {
  background-color: rgba(255, 221, 87, 0.1);
  color: #cc9900;
}

.popup-dialog--error .popup-icon {
  background-color: rgba(241, 70, 104, 0.1);
  color: var(--danger-color);
}

.popup-dialog--success .popup-icon {
  background-color: rgba(0, 209, 178, 0.1);
  color: var(--secondary-color);
}

.popup-dialog--confirm .popup-icon {
  background-color: rgba(72, 95, 199, 0.1);
  color: var(--primary-color);
}

.popup-header {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
}

.popup-content {
  flex-grow: 1;
}

.popup-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
}

.popup-message {
  margin: var(--spacing-sm) 0 0 0;
  line-height: 1.5;
  color: var(--text-color);
}

.popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  justify-content: flex-end;
  margin-top: var(--spacing-md);
}

.popup-actions .button {
  min-width: 8rem;
}

/* Animation for show/hide */
@keyframes popup-fade-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes popup-fade-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .popup-dialog {
    transition-duration: 0.01ms !important;
  }
  
  @keyframes popup-fade-in,
  @keyframes popup-fade-out {
    from, to {
      transform: scale(1);
    }
  }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .popup-overlay {
    padding: var(--spacing-sm);
  }
  
  .popup-dialog {
    padding: var(--spacing-md);
  }
  
  .popup-title {
    font-size: 1.25rem;
  }
  
  .popup-actions {
    flex-direction: column;
  }
  
  .popup-actions .button {
    width: 100%;
    min-width: auto;
  }
}