/* Chatbot Styles for Cipher Cloud Consulting */

.chatbot-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  font-family: "Montserrat", sans-serif;
}

/* Chat Toggle Button */
.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 191, 255, 0.3);
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 191, 255, 0.4);
}

.chat-notification {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #ff4444;
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  animation: pulse 2s infinite;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Chat Window */
.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 500px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
}

.chat-window.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

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

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

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

.chat-status {
  font-size: 12px;
  opacity: 0.8;
}

.chat-actions {
  display: flex;
  gap: 8px;
}

.chat-action-btn {
  background: none;
  border: none;
  color: white;
  font-size: 14px;
  cursor: pointer;
  padding: 5px;
  border-radius: 3px;
  transition: background 0.2s;
}

.chat-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background: #f8f9fa;
}

.message {
  display: flex;
  margin-bottom: 15px;
  align-items: flex-start;
  gap: 8px;
}

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.bot-avatar {
  background: var(--primary-color);
  color: white;
}

.user-avatar {
  background: #6c757d;
  color: white;
}

.message-content {
  background: white;
  padding: 12px 15px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 280px;
  word-wrap: break-word;
}

.bot-message .message-content {
  background: white;
}

.user-message {
  flex-direction: row-reverse;
}

.user-message .message-content {
  background: var(--primary-color);
  color: white;
}

.user-message .message-avatar {
  background: var(--secondary-color);
}

/* Message Content Styling */
.message-content p {
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.message-content li {
  margin-bottom: 4px;
  font-size: 14px;
}

/* Contact Form Section */
.contact-form-section {
  padding: 20px;
  background: white;
  border-top: 1px solid #eee;
}

.contact-form-header h4 {
  margin: 0 0 5px 0;
  color: var(--secondary-color);
  font-size: 16px;
}

.contact-form-header p {
  margin: 0 0 15px 0;
  color: #666;
  font-size: 13px;
}

.chat-contact-form .form-group {
  margin-bottom: 12px;
}

.chat-contact-form input,
.chat-contact-form textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.chat-contact-form input:focus,
.chat-contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.1);
}

.chat-submit-btn {
  width: 100%;
  padding: 10px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-submit-btn:hover {
  background: var(--secondary-color);
}

/* Chat Input Section */
.chat-input-section {
  padding: 15px;
  background: white;
  border-top: 1px solid #eee;
}

.chat-input-container {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

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

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

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.send-btn:hover {
  background: var(--secondary-color);
}

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.quick-action-btn {
  padding: 6px 12px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 15px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: #666;
}

.quick-action-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Dark Mode Support */
.dark-mode .chat-window {
  background: #2a2a2a;
  color: #ffffff;
}

.dark-mode .chat-messages {
  background: #1f1f1f;
}

.dark-mode .message-content {
  background: #3a3a3a;
  color: #ffffff;
}

.dark-mode .user-message .message-content {
  background: var(--primary-color);
  color: #ffffff;
}

.dark-mode .chat-input-section,
.dark-mode .contact-form-section {
  background: #2a2a2a;
  border-color: #444;
}

.dark-mode .chat-input-container input,
.dark-mode .chat-contact-form input,
.dark-mode .chat-contact-form textarea {
  background: #3a3a3a;
  border-color: #555;
  color: #ffffff;
}

.dark-mode .chat-input-container input:focus,
.dark-mode .chat-contact-form input:focus,
.dark-mode .chat-contact-form textarea:focus {
  border-color: var(--primary-color);
}

.dark-mode .quick-action-btn {
  background: #3a3a3a;
  color: #ffffff;
  border-color: #555;
}

.dark-mode .quick-action-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 480px) {
  .chatbot-widget {
    right: 10px;
    bottom: 10px;
  }

  .chat-window {
    width: calc(100vw - 20px);
    height: 60vh;
    max-height: 400px;
    right: 0;
    bottom: 70px;
  }

  .chat-toggle {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .chat-notification {
    font-size: 10px;
    padding: 4px 8px;
  }
}

/* Animation for new messages */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message {
  animation: slideInUp 0.3s ease-out;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}
