/**
 * Custom Modal Styles
 * 
 * Styled modals to replace browser alert() and confirm() dialogs
 */

.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.custom-modal-content {
  background: linear-gradient(135deg, rgba(24, 34, 54, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
  border: 2px solid rgba(var(--color-primary-rgb), 0.3);
  border-radius: var(--radius-lg);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(var(--color-primary-rgb), 0.2);
  min-width: 520px;
  max-width: 900px;
  width: auto;
  max-height: 80vh;
  overflow: visible;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.custom-modal-overlay.show .custom-modal-content {
  transform: scale(1);
}

.custom-modal-header {
  padding: var(--spacing-xl);
  border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

.custom-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
  text-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.5);
}

.custom-modal-body {
  padding: var(--spacing-xl);
  padding-right: calc(var(--spacing-xl) + 8px);
  max-height: 60vh;
  overflow-y: auto;
}

.custom-modal-message {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
}

.custom-modal-footer {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-top: 1px solid rgba(var(--color-primary-rgb), 0.2);
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
}

.custom-modal-footer .btn,
.custom-modal-body .btn {
  min-width: 100px;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Specific styling for copy link button */
#copyLinkBtn {
  flex: 0 0 auto !important;
  min-width: unset !important;
  width: auto !important;
}

.custom-modal-body .btn:focus,
.custom-modal-footer .btn:focus {
  outline: none;
}

.custom-modal-footer .btn-primary,
.custom-modal-body .btn-primary {
  background: linear-gradient(135deg, rgba(0, 168, 255, 0.2) 0%, rgba(0, 168, 255, 0.15) 100%);
  color: #ffffff;
  border: 2px solid rgba(0, 168, 255, 0.6) !important;
  box-shadow: 0 0 20px rgba(0, 168, 255, 0.3);
}

.custom-modal-footer .btn-primary:hover,
.custom-modal-body .btn-primary:hover {
  background: linear-gradient(135deg, rgba(0, 168, 255, 0.3) 0%, rgba(0, 168, 255, 0.25) 100%);
  border-color: rgba(0, 168, 255, 0.8) !important;
  box-shadow: 0 0 30px rgba(0, 168, 255, 0.5);
  transform: translateY(-2px);
}

.custom-modal-footer .btn-secondary,
.custom-modal-body .btn-secondary {
  background: linear-gradient(135deg, rgba(0, 168, 255, 0.15) 0%, rgba(0, 168, 255, 0.1) 100%);
  color: #ffffff;
  border: 2px solid rgba(0, 168, 255, 0.3) !important;
}

.custom-modal-footer .btn-secondary:hover,
.custom-modal-body .btn-secondary:hover {
  background: linear-gradient(135deg, rgba(0, 168, 255, 0.25) 0%, rgba(0, 168, 255, 0.2) 100%);
  border-color: rgba(0, 168, 255, 0.5) !important;
  transform: translateY(-2px);
}

/* Close/Cancel X button (red) */
.custom-modal-footer .btn-close-x,
.custom-modal-body .btn-close-x {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.2) 0%, rgba(220, 53, 69, 0.15) 100%);
  color: #ff6b6b;
  border: 2px solid rgba(220, 53, 69, 0.5) !important;
  min-width: 44px;
  padding: 0.5rem 0.75rem;
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 300;
}

.custom-modal-footer .btn-close-x:hover,
.custom-modal-body .btn-close-x:hover {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.35) 0%, rgba(220, 53, 69, 0.3) 100%);
  border-color: rgba(220, 53, 69, 0.8) !important;
  box-shadow: 0 0 20px rgba(220, 53, 69, 0.4);
  transform: translateY(-2px);
  color: #ff8a8a;
}

/* Responsive */
@media (max-width: 768px) {
  .custom-modal-content {
    min-width: 90vw;
    max-width: 90vw;
  }
}

/* Scrollbar styling */
.custom-modal-body::-webkit-scrollbar {
  width: 8px;
}

.custom-modal-body::-webkit-scrollbar-track {
  background: rgba(24, 34, 54, 0.5);
  border-radius: var(--radius-sm);
}

.custom-modal-body::-webkit-scrollbar-thumb {
  background: rgba(var(--color-primary-rgb), 0.3);
  border-radius: var(--radius-sm);
}

.custom-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--color-primary-rgb), 0.5);
}

