.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.chat-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(42, 180, 220, 0.92) 0%, rgba(42, 201, 241, 0.88) 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(42, 201, 241, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.chat-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(42, 201, 241, 0.35);
}

.chat-toggle svg {
  width: 26px;
  height: 26px;
  fill: rgba(255, 255, 255, 0.95);
  transition: all 0.3s ease;
}

.chat-toggle.active svg.chat-icon {
  display: none;
}

.chat-toggle svg.close-icon {
  display: none;
}

.chat-toggle.active svg.close-icon {
  display: block;
}

.chat-window {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 375px;
  height: 510px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 22px;
  box-shadow: 0 8px 35px rgba(42, 180, 200, 0.18);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
  border: 1px solid rgba(42, 201, 241, 0.18);
}

.chat-window.active {
  display: flex;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-header {
  background: linear-gradient(135deg, rgba(42, 180, 220, 0.92) 0%, rgba(42, 201, 241, 0.88) 100%);
  padding: 18px 20px;
  color: white;
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-avatar {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-header-avatar img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.chat-header-info h3 {
  font-family: "Lexend", sans-serif;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.chat-header-info p {
  font-family: "Open Sans", sans-serif;
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-status-dot {
  width: 7px;
  height: 7px;
  background: rgba(46, 204, 113, 0.9);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: linear-gradient(180deg, #e8f2f2 0%, #e0efef 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-family: "Open Sans", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-message.bot {
  background: rgba(255, 255, 255, 0.95);
  color: #2a4a5a;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 12px rgba(42, 180, 200, 0.1);
  border: 1px solid rgba(42, 201, 241, 0.12);
}

.chat-message.user {
  background: linear-gradient(135deg, rgba(42, 180, 220, 0.9) 0%, rgba(42, 201, 241, 0.85) 100%);
  color: rgba(255, 255, 255, 0.95);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-message.typing {
  display: flex;
  gap: 5px;
  padding: 16px 20px;
}

.chat-message.typing span {
  width: 7px;
  height: 7px;
  background: rgba(42, 201, 241, 0.5);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.chat-message.typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-message.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-3px); opacity: 0.9; }
}

.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #e0efef 0%, #e4f0f0 100%);
  border-top: 1px solid rgba(42, 201, 241, 0.12);
}

.quick-reply-btn {
  font-family: "Open Sans", sans-serif;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(42, 201, 241, 0.2);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: #2a9ab8;
  cursor: pointer;
  transition: all 0.25s ease;
}

.quick-reply-btn:hover {
  background: linear-gradient(135deg, rgba(42, 180, 220, 0.9) 0%, rgba(42, 201, 241, 0.85) 100%);
  color: rgba(255, 255, 255, 0.95);
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(42, 201, 241, 0.2);
}

.chat-input-area {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid rgba(42, 201, 241, 0.12);
}

.chat-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-input {
  font-family: "Open Sans", sans-serif;
  flex: 1;
  padding: 11px 16px;
  border: 1px solid rgba(42, 201, 241, 0.2);
  border-radius: 100px;
  font-size: 14px;
  outline: none;
  transition: all 0.25s ease;
  background: rgba(248, 252, 252, 0.8);
}

.chat-input:focus {
  border-color: rgba(42, 201, 241, 0.5);
  background: white;
  box-shadow: 0 0 0 3px rgba(42, 201, 241, 0.1);
}

.chat-input::placeholder {
  color: #7a9aa8;
}

.chat-send-btn {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, rgba(42, 180, 220, 0.92) 0%, rgba(42, 201, 241, 0.88) 100%);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(42, 201, 241, 0.25);
}

.chat-send-btn svg {
  width: 18px;
  height: 18px;
  fill: rgba(255, 255, 255, 0.95);
}

.chat-contact-form {
  padding: 16px;
  background: linear-gradient(180deg, #e8f2f2 0%, #e0efef 100%);
  display: none;
  flex-direction: column;
  gap: 10px;
}

.chat-contact-form.active {
  display: flex;
}

.chat-contact-form h4 {
  font-family: "Lexend", sans-serif;
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 600;
  color: #2a4a5a;
}

.chat-contact-form p {
  font-family: "Open Sans", sans-serif;
  margin: 0 0 8px;
  font-size: 13px;
  color: #5a7a88;
}

.chat-form-input {
  font-family: "Open Sans", sans-serif;
  padding: 11px 14px;
  border: 1px solid rgba(42, 201, 241, 0.2);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: all 0.25s ease;
  background: rgba(255, 255, 255, 0.95);
}

.chat-form-input:focus {
  border-color: rgba(42, 201, 241, 0.5);
  background: white;
  box-shadow: 0 0 0 3px rgba(42, 201, 241, 0.1);
}

.chat-form-input::placeholder {
  color: #8a9ca4;
}

.chat-form-textarea {
  min-height: 75px;
  resize: none;
  border-radius: 12px;
}

.chat-form-submit {
  font-family: "Open Sans", sans-serif;
  padding: 11px 20px;
  background: linear-gradient(135deg, rgba(42, 180, 220, 0.92) 0%, rgba(42, 201, 241, 0.88) 100%);
  color: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.chat-form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(42, 201, 241, 0.25);
}

.chat-form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-back-btn {
  font-family: "Open Sans", sans-serif;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(42, 201, 241, 0.2);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: #5a7a88;
  cursor: pointer;
  transition: all 0.25s ease;
}

.chat-back-btn:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(42, 201, 241, 0.4);
  color: #2a9ab8;
}

@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 120px);
    max-height: 480px;
    right: -8px;
  }
  
  .chat-widget {
    right: 16px;
    bottom: 16px;
  }
  
  .chat-toggle {
    width: 54px;
    height: 54px;
  }
  
  .chat-toggle svg {
    width: 24px;
    height: 24px;
  }
}
