/* ============================================================
   KRISHNARAJ ENTERPRISES — WIDGETS (widgets.css)
   International enquiry pop-up and chat assistant. Loaded without
   blocking page rendering; both are created by JavaScript.
   ============================================================ */
:root { --bg-light-grey: #F3F5F7; }
/* ke.css keeps these hidden until this file (loaded without blocking) arrives */
.chat-widget-wrapper { visibility: visible; }
/* ============================================================

/* ============================================================
   INTERNATIONAL ENQUIRY POPUP MODAL
   ============================================================ */
.intl-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(3, 26, 54, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.intl-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.intl-modal-dialog {
  background-color: #FFFFFF;
  border-radius: var(--radius-lg);
  border-top: 4px solid var(--orange);
  box-shadow: 0 24px 60px rgba(3, 26, 54, 0.35);
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

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

.intl-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-light-grey);
  border: 1px solid var(--border-color);
  color: var(--navy-deep);
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.intl-modal-close:hover {
  background-color: var(--orange);
  color: #FFFFFF;
  border-color: var(--orange);
  transform: rotate(90deg);
}

.intl-modal-header {
  padding: 32px 32px 20px 32px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, rgba(243, 106, 33, 0.03) 0%, transparent 100%);
}

.intl-modal-badge {
  display: inline-flex;
  align-items: center;
  background-color: var(--orange-subtle);
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  margin-bottom: 10px;
}

.intl-modal-title {
  color: var(--navy-deep);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px 0;
}

.intl-modal-subtitle {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.5;
  margin: 0;
  max-width: 65ch;
}

.intl-modal-body {
  padding: 24px 32px 32px 32px;
}

.intl-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}

.intl-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.intl-form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy-deep);
}

.intl-form-label .req {
  color: var(--orange);
}

.intl-form-input,
.intl-form-select,
.intl-form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-body);
  background-color: #FFFFFF;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
}

.intl-form-input:focus,
.intl-form-select:focus,
.intl-form-textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(243, 106, 33, 0.15);
}

.intl-form-input.is-invalid,
.intl-form-select.is-invalid,
.intl-form-textarea.is-invalid {
  border-color: #DC3545;
  background-color: #FFF8F8;
}

.intl-form-textarea {
  resize: vertical;
  min-height: 80px;
}

.intl-trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background-color: var(--bg-light-grey);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 18px;
  margin-bottom: 22px;
}

.intl-trust-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-body);
  line-height: 1.4;
}

.intl-trust-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.intl-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.intl-form-status-box {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 18px;
}

.intl-form-status-box.success {
  background-color: #E8F7EE;
  border: 1px solid #28A745;
  color: #155724;
}

.intl-form-status-box.error {
  background-color: #FDE8E8;
  border: 1px solid #DC3545;
  color: #721C24;
}

/* ============================================================
   INDUSTRIAL ENGINEERING CHATBOT WIDGET
   ============================================================ */
.chat-widget-wrapper {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 2100;
  font-family: inherit;
}

.chat-toggle-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #FFFFFF;
  border: 2px solid rgba(243, 106, 33, 0.4);
  box-shadow: 0 8px 26px rgba(3, 26, 54, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.chat-toggle-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 32px rgba(243, 106, 33, 0.35);
  border-color: var(--orange);
}

.chat-toggle-btn .chat-toggle-icon-open {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.chat-toggle-btn .chat-toggle-icon-close {
  display: none;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
}

.chat-toggle-btn.is-active .chat-toggle-icon-open { display: none; }
.chat-toggle-btn.is-active .chat-toggle-icon-close { display: flex; }

.chat-status-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #28A745;
  border: 2px solid #FFFFFF;
}

.chat-teaser-bubble {
  position: absolute;
  bottom: 68px;
  right: 0;
  background-color: var(--navy-deep);
  color: #FFFFFF;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(3, 26, 54, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.chat-teaser-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 22px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--navy-deep);
}

.chat-teaser-bubble.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.chat-teaser-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0 0 4px;
  line-height: 1;
}

.chat-teaser-close:hover { color: #FFFFFF; }

.chat-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 380px;
  height: 520px;
  max-height: calc(100vh - 120px);
  background-color: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(3, 26, 54, 0.28);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2200;
}

.chat-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chat-panel-header {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #FFFFFF;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--orange);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.chat-avatar-icon { font-size: 1rem; }

.chat-avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #28A745;
  border: 1.5px solid var(--navy-deep);
}

.chat-header-title {
  color: #FFFFFF;
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.chat-header-status {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.7);
  display: block;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-action-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: all var(--transition-fast);
}

.chat-action-btn:hover {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.12);
}

.chat-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background-color: var(--bg-light-grey);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  display: flex;
  gap: 8px;
  width: 100%;
}

.chat-msg-bot {
  align-items: flex-start;
}

.chat-msg-user {
  justify-content: flex-end;
}

.chat-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--navy-deep);
  color: var(--orange);
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.chat-msg-bot .chat-msg-bubble {
  background-color: #FFFFFF;
  color: var(--text-body);
  padding: 12px 14px;
  border-radius: 12px 12px 12px 2px;
  font-size: 0.835rem;
  line-height: 1.45;
  box-shadow: 0 2px 6px rgba(3, 26, 54, 0.05);
  border: 1px solid var(--border-light);
  max-width: 86%;
}

.chat-msg-bot .chat-msg-bubble p {
  margin: 0 0 6px 0;
}

.chat-msg-bot .chat-msg-bubble p:last-child {
  margin-bottom: 0;
}

.chat-msg-user .chat-msg-bubble {
  background-color: var(--orange);
  color: #FFFFFF;
  padding: 10px 14px;
  border-radius: 12px 12px 2px 12px;
  font-size: 0.835rem;
  font-weight: 500;
  max-width: 82%;
  box-shadow: 0 2px 6px rgba(243, 106, 33, 0.2);
}

.chat-link {
  color: var(--orange);
  font-weight: 700;
  text-decoration: underline;
}

.chat-link:hover { color: var(--navy-deep); }

.chat-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  padding-top: 6px;
}

.chat-chip {
  background-color: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--navy-deep);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chat-chip:hover {
  background-color: var(--navy-deep);
  color: #FFFFFF;
  border-color: var(--navy-deep);
  transform: translateY(-1px);
}

.chat-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background-color: #FFFFFF;
  border-radius: 12px;
  width: fit-content;
  margin-left: 34px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.chat-typing-indicator span {
  width: 6px;
  height: 6px;
  background-color: var(--orange);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out both;
}

.chat-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.chat-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.chat-panel-footer {
  padding: 10px 12px;
  background-color: #FFFFFF;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-input-field {
  flex: 1;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: 9px 12px;
  font-size: 0.835rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast);
}

.chat-input-field:focus {
  border-color: var(--orange);
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background-color: var(--orange);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background-color: var(--orange-hover);
  transform: scale(1.05);
}

/* Chatbot Lead Intake Form */
.chat-lead-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--bg-light-grey);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-sm);
}

.chat-lead-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-lead-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--navy-deep);
}

.chat-lead-label .req {
  color: var(--orange);
}

.chat-lead-input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text-body);
  background-color: #FFFFFF;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
}

.chat-lead-input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(243, 106, 33, 0.15);
}

.chat-lead-error-text {
  color: #DC3545;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 6px;
  background-color: #FFF2F2;
  border-radius: var(--radius-xs);
  border: 1px solid #FFD6D6;
}

.chat-lead-submit-btn {
  width: 100%;
  justify-content: center;
  font-size: 0.8rem;
  padding: 8px 12px;
  margin-top: 4px;
}

.chat-input-field:disabled {
  background-color: #F4F6F9;
  cursor: not-allowed;
  color: #999999;
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}


/* ---- Mobile adjustments ---- */
@media (max-width: 767px) {
  .intl-modal-overlay { padding: 12px !important; }
  .intl-form-grid { grid-template-columns: minmax(0, 1fr); }
  .intl-trust-strip { grid-template-columns: minmax(0, 1fr); }
  .intl-modal-header, .intl-modal-body { padding-left: 18px; padding-right: 18px; }
  .chat-teaser-bubble { display: none !important; }
  .chat-widget-wrapper { right: 14px !important; bottom: 76px !important; }
  .chat-panel { position: fixed !important; left: 8px !important; right: 8px !important; bottom: 8px !important; width: auto !important; max-height: calc(100svh - 24px) !important; }
}
