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

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal-dialog {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 8px 16px rgba(0, 0, 0, 0.1);
  max-width: 450px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.95) translateY(-10px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.show .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 28px 28px 20px;
  border-bottom: none;
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  letter-spacing: -0.02em;
}

.modal-body {
  padding: 0 28px 28px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-overlay .modal-content {
  background: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  max-width: none !important;
  width: auto !important;
  max-height: none !important;
}

.modal-message {
  font-size: 16px;
  color: #4b5563;
  line-height: 1.7;
  white-space: pre-wrap;
  font-weight: 400;
}

.modal-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 15px;
  margin-top: 16px;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.modal-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
}

.modal-footer {
  padding: 20px 28px 28px;
  border-top: none;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-button {
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modal-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modal-button-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.modal-button-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

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

.modal-button-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.modal-button-secondary {
  background: #f9fafb;
  color: #6b7280;
  border: 2px solid #e5e7eb;
  box-shadow: none;
}

.modal-button-secondary:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* Alert icon styles */
.modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 28px;
  font-weight: 600;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.modal-icon::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  opacity: 0.1;
}

.modal-icon.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.modal-icon.success::before {
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
}

.modal-icon.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.modal-icon.error::before {
  background: radial-gradient(circle, #ef4444 0%, transparent 70%);
}

.modal-icon.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.modal-icon.warning::before {
  background: radial-gradient(circle, #f59e0b 0%, transparent 70%);
}

.modal-icon.info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.modal-icon.info::before {
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
}

.modal-body.centered {
  text-align: center;
}

.modal-body.custom-content {
  text-align: left;
  padding-top: 8px;
}

.modal-content.scrollable {
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 8px;
}

/* Markdown content styling */
.modal-content.scrollable h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 24px 0 16px 0;
  color: #1a1a1a;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.modal-content.scrollable h1:first-child {
  margin-top: 0;
}

.modal-content.scrollable h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 24px 0 12px 0;
  color: #1a1a1a;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.modal-content.scrollable h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 20px 0 10px 0;
  color: #1a1a1a;
  line-height: 1.4;
}

.modal-content.scrollable h4 {
  font-size: 18px;
  font-weight: 600;
  margin: 16px 0 8px 0;
  color: #1a1a1a;
  line-height: 1.4;
}

.modal-content.scrollable p {
  font-size: 16px;
  line-height: 1.7;
  color: #4b5563;
  margin: 0 0 16px 0;
}

.modal-content.scrollable strong {
  font-weight: 600;
  color: #1a1a1a;
}

.modal-content.scrollable em {
  font-style: italic;
}

.modal-content.scrollable code {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', monospace;
  font-size: 14px;
  color: #dc2626;
}

.modal-content.scrollable pre {
  background: #1f2937;
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
}

.modal-content.scrollable pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e5e7eb;
  font-size: 14px;
  line-height: 1.6;
}

.modal-content.scrollable ul,
.modal-content.scrollable ol {
  margin: 16px 0;
  padding-left: 28px;
}

.modal-content.scrollable li {
  font-size: 16px;
  line-height: 1.7;
  color: #4b5563;
  margin-bottom: 8px;
}

.modal-content.scrollable a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.modal-content.scrollable a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.modal-content.scrollable blockquote {
  border-left: 4px solid #3b82f6;
  background: #f9fafb;
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 8px 8px 0;
}

.modal-content.scrollable blockquote p {
  margin: 0;
  color: #6b7280;
  font-style: italic;
}

.modal-content.scrollable hr {
  border: none;
  border-top: 2px solid #e5e7eb;
  margin: 24px 0;
}

/* Custom scrollbar for modal content */
.modal-content.scrollable::-webkit-scrollbar {
  width: 8px;
}

.modal-content.scrollable::-webkit-scrollbar-track {
  background: #f9fafb;
  border-radius: 10px;
}

.modal-content.scrollable::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 10px;
}

.modal-content.scrollable::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}