#chatWidget { font-family: 'Inter', sans-serif; }

.chat-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  background: linear-gradient(135deg, #c9a84c, #e8d18a);
  color: #0f0620;
  border: none;
  border-radius: 50px;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(201,168,76,0.4);
  transition: all 0.3s;
}
.chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(201,168,76,0.5);
}
.chat-toggle-icon { font-size: 1.2rem; }

.chat-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  z-index: 9999;
  width: 360px;
  max-width: calc(100vw - 2rem);
  height: 500px;
  max-height: calc(100vh - 8rem);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 60px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}
.chat-panel.open { display: flex; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-header {
  background: #0f0620;
  color: #fff;
  padding: 1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.chat-header strong { font-size: 0.95rem; }
.chat-status {
  display: block;
  font-size: 0.7rem;
  color: #4ade80;
  font-weight: 400;
  margin-top: 0.1rem;
}
.chat-status::before { content: ''; display: inline-block; width: 6px; height: 6px; background: #4ade80; border-radius: 50%; margin-right: 0.3rem; vertical-align: middle; }
.chat-close {
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 1.5rem; cursor: pointer; padding: 0; line-height: 1;
}
.chat-close:hover { color: #fff; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f8f6f3;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.chat-welcome {
  text-align: center;
  padding: 1.5rem 1rem;
  color: #888;
  font-size: 0.9rem;
}
.chat-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a84c, #e8d18a);
  color: #0f0620;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 0.8rem;
  font-size: 1.2rem;
}

.msg {
  max-width: 85%;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.msg.visitor {
  align-self: flex-end;
  background: linear-gradient(135deg, #c9a84c, #e8d18a);
  color: #0f0620;
  border-bottom-right-radius: 4px;
}
.msg.admin {
  align-self: flex-start;
  background: #fff;
  color: #333;
  box-shadow: 0 1px 5px rgba(0,0,0,0.06);
  border-bottom-left-radius: 4px;
}
.msg .msg-time {
  display: block;
  font-size: 0.65rem;
  opacity: 0.6;
  margin-top: 0.2rem;
}

.chat-start, .chat-input-area {
  display: flex;
  gap: 0.5rem;
  padding: 0.8rem;
  border-top: 1px solid #eee;
  background: #fff;
  flex-shrink: 0;
}
.chat-start input, .chat-input-area input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 0.9rem;
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: border 0.3s;
}
.chat-start input:focus, .chat-input-area input:focus { border-color: #c9a84c; }
.chat-send-btn {
  padding: 0.7rem 1.2rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #c9a84c, #e8d18a);
  color: #0f0620;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}
.chat-send-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(201,168,76,0.3); }

@media (max-width: 480px) {
  .chat-panel {
    right: 0.5rem;
    bottom: 5rem;
    width: calc(100vw - 1rem);
    height: 60vh;
  }
  .chat-toggle { bottom: 1rem; right: 1rem; padding: 0.6rem 1rem; font-size: 0.85rem; }
}
