/* Popup Overlay */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.popup-overlay[style*="display: block"] {
  display: flex !important;
}

/* Popup Card */
.popup-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  animation: popupSlideIn 0.2s ease;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Popup Sizes */
.popup-sm {
  max-width: 400px;
}

.popup-md {
  max-width: 600px;
}

.popup-lg {
  max-width: 850px;
}

.popup-xl {
  max-width: 1400px;
}

/* Popup with fixed height (for popups containing tables) */
.popup-fixed-height {
  height: 90vh;
  max-height: 90vh;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
}

.popup-fixed-height .popup-body {
  flex: 1;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
}

.popup-fixed-height .popup-body .popup-table-container {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  min-height: 0;
}

.popup-fixed-height .popup-body .popup-table-container .std-table {
  margin: 0;
}

.popup-fixed-height .popup-body .popup-table-container .std-table td,
.popup-fixed-height .popup-body .popup-table-container .std-table th {
  font-size: 12px;
  padding: 6px 8px;
}

/* Popup Header */
.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #eee;
}

.popup-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.popup-close {
  font-size: 18px;
  color: #999;
  cursor: pointer;
  transition: color 0.2s;
}

.popup-close:hover {
  color: #333;
}

.popup-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: #888;
  font-weight: 400;
}

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

/* Popup Footer */
.popup-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  column-gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid #eee;
}

/* Result Popup (success toast) */
.result-popup {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #d4edda;
  border: 1px solid #b8dfc3;
  border-left: 4px solid #28a745;
  border-radius: 8px;
  padding: 14px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  align-items: center;
  column-gap: 10px;
}

.result-popup.okSlideIn {
  display: flex;
  animation: resultSlideIn 0.3s ease;
}

.result-popup.errorSlideIn {
  display: flex;
  background-color: #fee2e2;
  border: 1px solid #fca5a5;
  border-left: 4px solid #dc2626;
  animation: resultSlideIn 0.3s ease;
}

.result-popup.errorSlideIn .result-popup-icon {
  color: #dc2626;
}

.result-popup.errorSlideIn .result-popup-text {
  color: #dc2626;
}

.result-popup.okSlideIn .result-popup-icon {
  color: #28a745;
}

.result-popup.okSlideIn .result-popup-text {
  color: #28a745;
}

.result-popup-icon {
  color: #28a745;
  font-size: 16px;
}

.result-popup-text {
  font-size: 13px;
  color: #333;
  font-weight: 500;
}

@keyframes resultSlideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
