/* Chat Widget Styles */
.chat-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  font-family: inherit;
}

.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background 0.3s;
}

.chat-toggle:hover {
  transform: scale(1.05);
  background: var(--primary-dark);
}

.chat-toggle svg {
  width: 30px;
  height: 30px;
}

.chat-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  max-height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}

.chat-widget.open .chat-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.chat-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.chat-header p {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.9;
}

.chat-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
}

.chat-close svg {
  width: 20px;
  height: 20px;
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 250px;
}

.msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
}

.msg-clinic {
  background: white;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.msg-user {
  background: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 5px rgba(var(--primary-rgb), 0.2);
}

.chat-input {
  display: flex;
  padding: 12px;
  background: white;
  border-top: 1px solid #eee;
}

.chat-input input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

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

.chat-input button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 8px;
  margin-left: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-input button svg {
  width: 24px;
  height: 24px;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.quick-reply-btn {
  background: #eef2f6;
  border: 1px solid #dce4ec;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  transition: background 0.2s;
}

.quick-reply-btn:hover {
  background: #dce4ec;
}

@media (max-width: 768px) {
  .chat-widget {
    bottom: 160px !important;
    right: 16px !important;
  }
  .chat-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    transform: translateY(100%);
  }
  .chat-widget.open .chat-panel {
    transform: translateY(0);
  }
  .chat-messages {
    min-height: 200px;
  }
  .chat-pinned-replies {
    gap: 6px !important;
    padding: 10px 8px !important;
  }
  .quick-reply-btn {
    font-size: 11px !important;
    padding: 5px 8px !important;
  }
  .chat-close {
    background: #e53935;
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .chat-close svg {
    width: 24px;
    height: 24px;
  }
}
