/* NanoMedicine Conference — Chatbot CSS */

#chat-widget {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 400px;
  font-family: Arial, sans-serif;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  overflow: hidden;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* ── Header ── */
.chat-header {
  background: linear-gradient(135deg, #0a1c3e 0%, #1d4ed8 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

.header-logo img { width: 100%; height: 100%; object-fit: cover; }

.header-info { flex: 1; }

.header-info .name {
  font-size: 15px; font-weight: 700;
  color: #fff;
}

.header-info .status {
  font-size: 12px; color: rgba(255,255,255,.8);
  display: flex; align-items: center; gap: 5px; margin-top: 2px;
}

.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #67e8f9; flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(1.3); }
}

.close-btn {
  background: rgba(255,255,255,.15);
  border: none; color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%; cursor: pointer;
  font-size: 20px; display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}

.close-btn:hover { background: rgba(255,255,255,.28); }

/* ── Messages ── */
.chat-messages {
  background: #f0f4ff;
  padding: 16px;
  overflow-y: auto;
  min-height: 120px;
  max-height: 420px;
}

.bot-msg {
  background: #fff; color: #1a1a2e;
  padding: 10px 14px; margin: 0 0 8px 0;
  border-radius: 4px 14px 14px 14px;
  font-size: 14px; line-height: 1.5;
  max-width: 90%;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.user-msg {
  background: #1d4ed8; color: #fff;
  padding: 10px 14px;
  margin: 0 0 8px auto;
  border-radius: 14px 4px 14px 14px;
  font-size: 14px; line-height: 1.5;
  max-width: 90%; text-align: right;
}

/* ── Quick Buttons ── */
.quick-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 8px;
}

.quick-buttons button {
  font-size: 13px;
  font-weight: 600;
  padding: 12px 10px;
  border-radius: 10px;
  border: 2px solid #1d4ed8;
  background: #fff;
  color: #1d4ed8;
  cursor: pointer;
  text-align: center;
}

.quick-buttons button:hover {
  background: #1d4ed8;
  color: #fff;
}

/* ── Form ── */
.chat-form {
  background: #fff;
  padding: 14px 16px 10px;
  border-top: 1px solid #eee;
}

.chat-input {
  width: 100%; border: 1.5px solid #ddd;
  border-radius: 8px; padding: 11px 14px;
  font-size: 14px; margin-bottom: 10px;
  outline: none; box-sizing: border-box;
}

.chat-input:focus { border-color: #1d4ed8; }

/* ── Phone Picker ── */
.phone-row {
  display: flex; gap: 0; margin-bottom: 10px;
  border: 1.5px solid #ddd; border-radius: 8px;
  overflow: visible; position: relative;
}
.phone-row:focus-within { border-color: #1d4ed8; }

.country-trigger {
  display: flex; align-items: center; gap: 4px;
  padding: 0 10px; cursor: pointer;
  border-right: 1.5px solid #ddd;
  background: #f8faff; white-space: nowrap;
  flex-shrink: 0; font-size: 13px; font-weight: 600;
  color: #1d4ed8; border-radius: 6px 0 0 6px;
  user-select: none; height: 44px;
}
.country-trigger:hover { background: #eef2ff; }
.country-trigger .ct-arrow { font-size: 9px; color: #888; }

.country-dropdown {
  position: absolute; bottom: calc(100% + 4px); left: 0;
  width: 270px; max-height: 260px;
  background: #fff; border: 1.5px solid #ddd;
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.13);
  z-index: 99999; display: none; flex-direction: column;
  overflow: hidden;
}
.country-dropdown.open { display: flex; }

.dd-search {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.dd-search input {
  border: none; outline: none; font-size: 13px;
  width: 100%; color: #333;
}

.dd-list { overflow-y: auto; flex: 1; }
.dd-list::-webkit-scrollbar { width: 4px; }
.dd-list::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 4px; }

.dd-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer; font-size: 13px; color: #333;
}
.dd-item:hover { background: #eef2ff; }
.dd-item.active { background: #e0e7ff; font-weight: 600; color: #1d4ed8; }
.dd-item .di-name { flex: 1; }
.dd-item .di-code { color: #888; font-size: 12px; }

.phone-number-input {
  flex: 1; border: none; outline: none;
  padding: 11px 14px; font-size: 14px;
  border-radius: 0 6px 6px 0;
  background: transparent;
}

/* ── Submit Button ── */
.next-btn {
  width: 100%; background: #1d4ed8;
  color: #fff; border: none;
  border-radius: 8px; padding: 13px;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
}

.next-btn:hover { opacity: .9; }

/* ── Powered by ── */
.powered-by {
  text-align: center; font-size: 11px;
  color: #aaa; padding: 8px 0 4px;
}

.powered-by a { color: #1d4ed8; font-weight: 600; text-decoration: none; }

/* ── Toggle Button ── */
#chat-toggle {
  position: fixed; bottom: 20px; right: 20px;
  height: 52px; padding: 0 20px;
  border-radius: 26px; background: #1d4ed8;
  border: none; color: #fff;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(29,78,216,.35);
  display: none; align-items: center;
  justify-content: center; gap: 8px;
  z-index: 9999; white-space: nowrap;
}

@keyframes blink-attention {
  0%   { box-shadow: 0 4px 20px rgba(29,78,216,.35), 0 0 0 0 rgba(29,78,216,.5); transform: scale(1); }
  50%  { box-shadow: 0 4px 20px rgba(29,78,216,.35), 0 0 0 14px rgba(29,78,216,0); transform: scale(1.06); }
  100% { box-shadow: 0 4px 20px rgba(29,78,216,.35), 0 0 0 0 rgba(29,78,216,.5); transform: scale(1); }
}
#chat-toggle.blink {
  animation: blink-attention 1.6s ease-in-out infinite;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  #chat-widget {
    width: 92%; right: 4%; left: 4%;
    bottom: 70px; border-radius: 16px;
  }
  #chat-toggle {
    right: 10px; bottom: 10px;
    font-size: 13px; padding: 0 14px; height: 46px;
  }
  .chat-header { padding: 12px; }
  .header-logo { width: 36px; height: 36px; }
  .header-info .name  { font-size: 13px; }
  .header-info .status { font-size: 11px; }
  .bot-msg, .user-msg { font-size: 13px; padding: 9px 12px; max-width: 100%; }
  .chat-messages { padding: 12px; }
  .chat-form { padding: 12px; }
  .chat-input { font-size: 13px; padding: 10px 12px; }
  .next-btn { padding: 12px; font-size: 14px; }
  .quick-buttons { gap: 6px; }
  .quick-buttons button { font-size: 12px; padding: 7px 10px; }
  .country-dropdown { width: 240px; }
}
