* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --accent-color: #4cc9f0;
  --text-color: #2b2d42;
  --light-text: #f8f9fa;
  --user-message-bg: #4361ee;
  --bot-message-bg: #f1f3f8;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
i {
  font-style: normal;
}
.chat-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 320px;
  max-height: 500px;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  box-shadow: var(--shadow);
  background-color: #fff;
  overflow: hidden;
  transition: var(--transition);
  z-index: 1000;
}

.chat-header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: var(--light-text);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-radius: 16px 16px 0 0;
}

.chat-title {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
}

.chat-toggle {
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  transition: background-color 0.2s ease;
}

.chat-toggle:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.chat-body {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
  max-height: 350px;
  display: none;
  background-color: #f8fafc;
  background-image: radial-gradient(#e2dede 1px, transparent 1px);
  background-size: 20px 20px;
}

.chat-body.active {
  display: block;
}

.message {
  display: table;
  margin-bottom: 14px;
  padding: 6px 10px;
  /* padding-right: 5vw; */
  border-radius: 18px;
  max-width: 85%;
  font-size: 0.95rem;
  line-height: 1.4;
  position: relative;
  animation: fadeIn 0.3s ease-out;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  background-color: white;
  min-width: 11vw !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sender-message {
  background-color: var(--user-message-bg);
  color: white;
  margin-left: auto;
  border-radius: 18px 18px 0px 18px;
}

.receiver-message {
  background-color: var(--bot-message-bg);
  color: var(--text-color);
  margin-right: auto;
  border-radius: 18px 18px 18px 0px;
}

.chat-input {
  display: none;
  padding: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background-color: white;
}

.chat-input.active {
  display: flex;
}

#message-input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  font-size: 0.95rem;
  margin-right: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#message-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.25);
}

#send-button,
.chat-btn {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 24px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 70px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#send-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#send-button:active {
  transform: translateY(1px);
}

.chat-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 1000;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chat-bubble:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.chat-bubble i {
  color: white;
  font-size: 25px;
}

.collapsed {
  transform: scale(0);
  opacity: 0;
}

.expanded {
  transform: scale(1);
  opacity: 1;
}

/* Notification bell styling */
.notification-bell {
  display: inline-block;
  animation: bell-ring 2.5s ease infinite;
  transform-origin: top center;
  font-size: 25px;
}

@keyframes bell-ring {
  0% {
    transform: rotate(0);
  }
  5% {
    transform: rotate(15deg);
  }
  10% {
    transform: rotate(-15deg);
  }
  15% {
    transform: rotate(13deg);
  }
  20% {
    transform: rotate(-13deg);
  }
  25% {
    transform: rotate(11deg);
  }
  30% {
    transform: rotate(-11deg);
  }
  35% {
    transform: rotate(9deg);
  }
  40% {
    transform: rotate(-9deg);
  }
  45% {
    transform: rotate(7deg);
  }
  50% {
    transform: rotate(-7deg);
  }
  55% {
    transform: rotate(5deg);
  }
  60% {
    transform: rotate(-5deg);
  }
  65% {
    transform: rotate(3deg);
  }
  70% {
    transform: rotate(-3deg);
  }
  75% {
    transform: rotate(1deg);
  }
  80% {
    transform: rotate(-1deg);
  }
  85% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(0);
  }
}

/* Notification dot */
.notification-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background-color: #ff3b30;
  border-radius: 50%;
  border: 2px solid white;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.9;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Scrollbar styling */
.chat-body::-webkit-scrollbar {
  width: 6px;
}

.chat-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.chat-body::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
.message-time {
  font-size: 0.75rem;
  color: #888;
  /* margin-top: -8px; */
  text-align: right;
  display: block;
  /* margin-right: -4vw; */
  margin-right: 0;
}
.sender-message .message-time {
  color: #ffffffa3;
}
.date-header {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
  padding: 8px 12px;
  /* background-color: #f1f3f8; */
  border-radius: 12px;
  margin: 10px 0;
  text-align: center;
  /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); */
  animation: fadeIn 0.3s ease-out;
}

.date-header::before {
  content: "📅"; /* You can add an icon if you'd like */
  margin-right: 8px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scroll-btn {
  position: fixed;
  bottom: 15vh;
  left: 50%;
  transform: translate(-50%, -50%);
  /* background-color: var(--primary-color); */
  color: rgb(0, 0, 0);
  font-weight: bolder;
  border: none;
  padding: 10px 14px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.678);
  transition: background-color 0.3s ease;
  z-index: 1001;
}

.scroll-btn:hover {
  background-color: var(--secondary-color);
  color: white;
}

.scroll-btn.hidden {
  display: none;
}
#chat-messages {
  scroll-behavior: smooth;
}
@media (max-width: 768px) {
  .expanded {
    transform: scale(0.8);
  }
  .chat-container {
    right: auto;
  }
  .message-time {
    margin-top: 2px;
  }
}
