/* EuroWayHub Grok Chatbot — brand: teal #0f6978, navy #113d48, green #5fbd74 */
:root {
  --ewh-teal: #0f6978;
  --ewh-teal-bright: #1aa3b8;
  --ewh-navy: #113d48;
  --ewh-green: #5fbd74;
  --ewh-bg: #f3f7f8;
  --ewh-bot-bubble: #eef3f5;
  --ewh-shadow: 0 12px 40px rgba(17, 61, 72, 0.22);
  --ewh-radius: 20px;
  --ewh-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#grok-toggle {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, var(--ewh-teal-bright), var(--ewh-teal));
  color: #fff;
  cursor: pointer;
  z-index: 99998;
  box-shadow: 0 8px 24px rgba(15, 105, 120, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
}
#grok-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 28px rgba(15, 105, 120, 0.55);
}
#grok-toggle svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}
#grok-toggle .grok-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  background: var(--ewh-green);
  border: 2px solid #fff;
  border-radius: 50%;
  animation: grok-pulse 1.8s ease-in-out infinite;
}
#grok-toggle.is-open {
  display: none;
}
@keyframes grok-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(95, 189, 116, 0.5); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(95, 189, 116, 0); }
}

#grok-chat-widget {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 390px;
  max-width: calc(100vw - 28px);
  height: 560px;
  max-height: calc(100vh - 40px);
  background: #fff;
  border-radius: var(--ewh-radius);
  box-shadow: var(--ewh-shadow);
  font-family: var(--ewh-font);
  z-index: 99999;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
#grok-chat-widget.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.grok-header {
  background: linear-gradient(135deg, var(--ewh-navy) 0%, var(--ewh-teal) 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.grok-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.grok-header-text {
  flex: 1;
  min-width: 0;
}
.grok-header-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}
.grok-online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ewh-green);
  box-shadow: 0 0 0 3px rgba(95, 189, 116, 0.35);
  flex-shrink: 0;
}
.grok-header-sub {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#grok-close {
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  flex-shrink: 0;
}
#grok-close:hover {
  background: rgba(255,255,255,0.22);
}

#grok-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background: var(--ewh-bg);
  -webkit-overflow-scrolling: touch;
}
.grok-msg {
  display: flex;
  margin: 0 0 12px;
}
.grok-msg--user {
  justify-content: flex-end;
}
.grok-msg--bot {
  justify-content: flex-start;
}
.grok-bubble {
  max-width: 88%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.grok-msg--user .grok-bubble {
  background: var(--ewh-teal);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.grok-msg--bot .grok-bubble {
  background: var(--ewh-bot-bubble);
  color: var(--ewh-navy);
  border-bottom-left-radius: 5px;
  box-shadow: 0 1px 2px rgba(17, 61, 72, 0.06);
}
.grok-bubble a.grok-inline-link {
  color: var(--ewh-teal);
  font-weight: 600;
  text-decoration: underline;
}
.grok-msg--user .grok-bubble a.grok-inline-link {
  color: #fff;
}

.grok-tour-card {
  display: block;
  margin: 8px 0;
  padding: 12px 13px;
  background: #fff;
  border: 1px solid #d7e4e8;
  border-radius: 12px;
  text-decoration: none !important;
  color: var(--ewh-navy) !important;
  box-shadow: 0 2px 8px rgba(17, 61, 72, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.grok-tour-card:hover {
  border-color: var(--ewh-teal);
  box-shadow: 0 4px 14px rgba(15, 105, 120, 0.15);
  transform: translateY(-1px);
}
.grok-tour-card__title {
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ewh-navy);
  margin: 0 0 6px;
}
.grok-tour-card__meta {
  font-size: 12.5px;
  color: #5a727a;
  margin: 0 0 2px;
}
.grok-tour-card__price {
  font-size: 14px;
  font-weight: 700;
  color: var(--ewh-teal);
  margin-top: 4px;
}
.grok-tour-card__cta {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ewh-teal);
}

.grok-typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 12px 16px !important;
}
.grok-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8aa3ab;
  animation: grok-dot 1.2s infinite ease-in-out;
}
.grok-typing span:nth-child(2) { animation-delay: 0.15s; }
.grok-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes grok-dot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

#grok-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 10px;
  background: var(--ewh-bg);
  flex-shrink: 0;
}
.grok-chip {
  border: 1px solid #c5d8de;
  background: #fff;
  color: var(--ewh-navy);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.grok-chip:hover {
  background: var(--ewh-teal);
  border-color: var(--ewh-teal);
  color: #fff;
}
#grok-chips.is-hidden {
  display: none;
}

.grok-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e3ecef;
  background: #fff;
  flex-shrink: 0;
  align-items: center;
}
#grok-input {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid #d0dee3;
  border-radius: 999px;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--ewh-navy);
  background: #f8fbfc;
}
#grok-input:focus {
  border-color: var(--ewh-teal);
  box-shadow: 0 0 0 3px rgba(15, 105, 120, 0.12);
}
#grok-send {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--ewh-teal);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
#grok-send:hover {
  background: var(--ewh-navy);
}
#grok-send svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

@media (max-width: 480px) {
  #grok-chat-widget {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  #grok-toggle {
    bottom: 16px;
    right: 16px;
  }
}
