/* === Modal: Nuevo bot === */

/* Overlay animation */
#newBotModal {
  /* Always fixed+flex so it never reflows to top-left during fade-out */
  display: flex !important;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
#newBotModal.flex {
  opacity: 1;
  pointer-events: auto;
}
#newBotModal.hidden {
  display: none !important;
}

/* Panel slides up on open */
#newBotModal .modal-panel {
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e4e4e7;
  box-shadow: 0 8px 40px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.06);
  position: relative;
  overflow: hidden;
  transform: translateY(12px) scale(0.99);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
  opacity: 0;
}
#newBotModal.flex .modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

#newBotModal .modal-accent { display: none; }

#newBotModal .modal-header {
  position: relative;
  z-index: 1;
}
#newBotModal .modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #18181b;
  color: #fff;
  flex-shrink: 0;
}
#newBotModal h3 {
  font-size: 15px;
  font-weight: 700;
  color: #18181b;
  letter-spacing: -0.01em;
}
#newBotModal .modal-header p {
  font-size: 12.5px;
  color: #a1a1aa;
  margin-top: 2px;
  font-weight: 400;
}

#newBotModal .modal-input {
  border-radius: 10px;
  border: 1px solid #e4e4e7;
  background: #fff;
  font-size: 13.5px;
  color: #18181b;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#newBotModal .modal-input:focus {
  border-color: #a1a1aa;
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
  outline: none;
}
#newBotModal .modal-input::placeholder {
  color: #d4d4d8;
}

#newBotModal .modal-options {
  display: grid;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}
#newBotModal .modal-option-card {
  position: relative;
  border-radius: 12px;
  border: 1px solid #e4e4e7;
  background: #fafafa;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
#newBotModal .modal-option-card:hover {
  border-color: #d4d4d8;
  background: #f4f4f5;
}
#newBotModal .modal-option-card.active {
  border-color: #18181b;
  background: #18181b;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
#newBotModal .modal-option-card.active .modal-option-title {
  color: #fff;
}
#newBotModal .modal-option-card.active .modal-option-description {
  color: rgba(255,255,255,0.5);
}
#newBotModal .modal-option-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #18181b;
  color: #fff;
}
#newBotModal .modal-option-card.active .modal-option-icon {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
#newBotModal .modal-option-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#newBotModal .modal-option-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #18181b;
  letter-spacing: -0.01em;
}
#newBotModal .modal-option-description {
  font-size: 11.5px;
  color: #a1a1aa;
  line-height: 1.4;
}
#newBotModal .modal-option-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#newBotModal .modal-actions button {
  border-radius: 10px;
  font-weight: 500;
  font-size: 13px;
  transition: background 0.12s, box-shadow 0.12s, opacity 0.12s;
  cursor: pointer;
  font-family: inherit;
}
#newBotModal .modal-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#newBotModal .modal-actions .modal-secondary {
  border: 1px solid #e4e4e7;
  color: #52525b;
  background: #fff;
}
#newBotModal .modal-actions .modal-secondary:hover {
  background: #f4f4f5;
}
#newBotModal .modal-actions .modal-primary {
  background: #18181b;
  color: #fff;
  border: none;
}
#newBotModal .modal-actions .modal-primary:hover {
  background: #27272a;
}
#newBotModal .modal-error {
  color: #dc2626;
  font-size: 12px;
}
#newBotModal .modal-footer-note {
  font-size: 11px;
  color: #a1a1aa;
}
#newBotModal .modal-gradient-bar { display: none; }
/* === Modal: Auto response type === */
#autoResponseTypeModal {
  transition: opacity 0.25s ease;
}
#autoResponseTypeModal.hidden {
  opacity: 0;
  pointer-events: none;
}
#autoResponseTypeModal .type-modal-panel {
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e4e4e7;
  box-shadow: 0 20px 50px -20px rgba(15, 23, 42, 0.22);
  position: relative;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  max-width: 520px !important;
}
#autoResponseTypeModal.show .type-modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}
#autoResponseTypeModal .type-modal-accent {
  display: none;
}
#autoResponseTypeModal .type-modal-header {
  position: relative;
  z-index: 1;
}
#autoResponseTypeModal .type-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #18181b;
  letter-spacing: -0.01em;
}
#autoResponseTypeModal .type-modal-header p {
  font-size: 13px;
  color: #71717a;
  margin-top: 2px;
}
#autoResponseTypeModal .type-option-card {
  border-radius: 12px;
  border: 1.5px solid #e4e4e7;
  background: #fff;
  box-shadow: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
#autoResponseTypeModal .type-option-card:hover {
  border-color: #a1a1aa;
  transform: none;
  box-shadow: none;
  background: #fafafa;
}
#autoResponseTypeModal .type-option-card.active {
  border-color: #18181b;
  background: #18181b;
  color: #fff;
  box-shadow: none;
}
#autoResponseTypeModal .type-option-card.active .type-option-description {
  color: rgba(255,255,255,0.6);
}
#autoResponseTypeModal .type-option-card.active .type-option-title {
  color: #fff;
}
#autoResponseTypeModal .type-option-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f4f4f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #3f3f46;
  flex-shrink: 0;
}
#autoResponseTypeModal .type-option-icon img {
  width: 26px;
  height: 26px;
}
#autoResponseTypeModal .type-option-card.active .type-option-icon {
  background: rgba(255,255,255,0.15);
  color: #fff;
  box-shadow: none;
}
#autoResponseTypeModal .type-option-title {
  font-size: 13px;
  font-weight: 600;
  color: #18181b;
  margin-bottom: 2px;
}
#autoResponseTypeModal .type-option-description {
  font-size: 12px;
  color: #71717a;
  line-height: 1.4;
}
#autoResponseTypeModal .type-modal-actions button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#autoResponseTypeModal .type-modal-actions .modal-secondary {
  border-radius: 10px;
  border: 1px solid #e4e4e7;
  background: #fff;
  color: #3f3f46;
  font-size: 13px;
}
#autoResponseTypeModal .type-modal-actions .modal-secondary:hover {
  background: #f4f4f5;
}
#autoResponseTypeModal .type-modal-actions .modal-primary {
  border-radius: 10px;
  background: #18181b;
  color: #fff;
  font-size: 13px;
  box-shadow: none;
}
#autoResponseTypeModal .type-modal-actions .modal-primary:not(:disabled):hover {
  background: #27272a;
  box-shadow: none;
}
