/* ═══════════════════════════════════════════════════════════════════════════
   UNIVERSAL MODAL DIALOG COMPONENT (Dark & Light Theme Synchronized)
   Replaces native browser alert(), confirm(), and prompt()
   ═══════════════════════════════════════════════════════════════════════════ */

.custom-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}

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

.custom-modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card, #161b22);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-main, #f0f6fc);
}

.custom-modal-overlay.active .custom-modal-card {
  transform: scale(1);
}

.custom-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.custom-modal-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: rgba(110, 118, 129, 0.15);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
}

.custom-modal-icon-badge.info {
  background: rgba(56, 139, 253, 0.15);
  border-color: rgba(56, 139, 253, 0.3);
  color: #58a6ff;
}

.custom-modal-icon-badge.success {
  background: rgba(46, 160, 67, 0.15);
  border-color: rgba(46, 160, 67, 0.3);
  color: #3fb950;
}

.custom-modal-icon-badge.warning {
  background: rgba(210, 153, 34, 0.15);
  border-color: rgba(210, 153, 34, 0.3);
  color: #d29922;
}

.custom-modal-icon-badge.danger,
.custom-modal-icon-badge.error {
  background: rgba(218, 54, 51, 0.15);
  border-color: rgba(218, 54, 51, 0.3);
  color: #f85149;
}

.custom-modal-title-wrap {
  flex: 1;
  min-width: 0;
}

.custom-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main, #f0f6fc);
  margin-bottom: 6px;
  line-height: 1.3;
}

.custom-modal-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted, #8b949e);
  word-break: break-word;
  white-space: pre-wrap;
}

.custom-modal-body {
  width: 100%;
}

.custom-modal-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-main, #f0f6fc);
  background: var(--input-bg, rgba(13, 17, 23, 0.8));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.custom-modal-input:focus {
  border-color: var(--border-focus, #58a6ff);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.custom-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.custom-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 38px;
  font-family: inherit;
}

.custom-modal-btn.cancel {
  background: var(--bg-card, #161b22);
  color: var(--text-muted, #8b949e);
}

.custom-modal-btn.cancel:hover {
  background: var(--bg-card-hover, #1f242c);
  color: var(--text-main, #f0f6fc);
  border-color: var(--border-focus, #58a6ff);
}

.custom-modal-btn.confirm {
  background: var(--primary, #238636);
  color: var(--primary-text, #ffffff);
  border-color: transparent;
}

.custom-modal-btn.confirm:hover {
  background: var(--primary-hover, #2ea043);
}

.custom-modal-btn.confirm.danger {
  background: var(--danger, #da3633);
  color: #ffffff;
}

.custom-modal-btn.confirm.danger:hover {
  background: var(--danger-hover, #f85149);
}

@media (max-width: 480px) {
  .custom-modal-card {
    padding: 20px 16px;
    border-radius: 14px;
  }
  .custom-modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .custom-modal-btn {
    width: 100%;
    min-height: 42px;
  }
}
