/* ILX Live Chat Widget */
.ilx-chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-orange, #e87830);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(232, 120, 48, 0.35);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.ilx-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(232, 120, 48, 0.45);
}
.ilx-chat-bubble-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.6);
}

.ilx-chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100dvh - 48px);
  background: #161b22;
  border: 1px solid rgba(240, 246, 252, 0.10);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.95);
  transition: opacity 0.25s, transform 0.25s;
}
.ilx-chat-panel.ilx-chat-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.ilx-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(240, 246, 252, 0.10);
  background: rgba(13, 17, 23, 0.6);
  backdrop-filter: blur(12px);
}
.ilx-chat-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #f0f6fc;
}
.ilx-chat-close {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.2s;
}
.ilx-chat-close:hover { color: #f0f6fc; }

.ilx-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ilx-chat-messages::-webkit-scrollbar { width: 4px; }
.ilx-chat-messages::-webkit-scrollbar-track { background: transparent; }
.ilx-chat-messages::-webkit-scrollbar-thumb { background: rgba(240, 246, 252, 0.1); border-radius: 2px; }

.ilx-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 10px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.ilx-chat-msg-user {
  align-self: flex-end;
  background: rgba(232, 120, 48, 0.15);
  color: #f0f6fc;
  border-bottom-right-radius: 3px;
}
.ilx-chat-msg-admin {
  align-self: flex-start;
  background: #21262d;
  color: #f0f6fc;
  border-bottom-left-radius: 3px;
}

.ilx-chat-status {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  text-align: center;
  padding: 0;
  height: 0;
  overflow: hidden;
  transition: all 0.2s;
  color: #8b949e;
}
.ilx-chat-status:not(:empty) {
  padding: 6px 16px;
  height: auto;
}
.ilx-chat-status-connecting { color: #d4af37; }
.ilx-chat-status-error { color: #f85149; }

.ilx-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(240, 246, 252, 0.10);
  background: rgba(13, 17, 23, 0.4);
}
.ilx-chat-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(240, 246, 252, 0.10);
  background: #0d1117;
  color: #f0f6fc;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ilx-chat-input:focus {
  border-color: #e87830;
  box-shadow: 0 0 0 2px rgba(232, 120, 48, 0.12);
}
.ilx-chat-input::placeholder { color: #484f58; }
.ilx-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #e87830;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.ilx-chat-send:hover { background: #f28a46; }

@media (max-width: 480px) {
  .ilx-chat-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: calc(100% - env(safe-area-inset-top, 0px));
    max-height: calc(100% - env(safe-area-inset-top, 0px));
    border-radius: 16px 16px 0 0;
  }
  .ilx-chat-header {
    padding: 16px 18px;
    padding-top: max(16px, env(safe-area-inset-top, 16px));
  }
  .ilx-chat-form {
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
  }
  .ilx-chat-send {
    width: 38px;
    height: 38px;
  }
  .ilx-chat-bubble {
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    right: 16px;
    width: 52px;
    height: 52px;
  }
  .ilx-chat-messages {
    padding: 12px;
  }
  .ilx-chat-msg {
    max-width: 90%;
    font-size: 15px;
  }
}
