:root {
  --gradient-start: #20B2AA;
  --gradient-end: #48D1CC;
  --text-color: white;
  --shadow-color: rgba(0, 0, 0, 0.2);
}

@keyframes gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes loading {
  0% { transform: scale(0.3); opacity: 0; }
  20% { transform: scale(1.5); opacity: 0.8; }
  40% { transform: scale(1.2); opacity: 1; }
  60% { transform: scale(1.4); opacity: 1; }
  80% { transform: scale(1.2); opacity: 0.9; }
  100% { transform: scale(2); opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes soundBar {
  0% { height: 10px; }
  50% { height: 40px; }
  100% { height: 10px; }
}

@keyframes wave {
  0%, 100% { height: 8px; }
  50% { height: 15px; }
}

@keyframes mustacheTalk {
  0% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-3px) scale(1.05); }
  50% { transform: translateY(3px) scale(0.95); }
  75% { transform: translateY(-2px) scale(1.03); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes bowtieSpin {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(5deg); }
  50% { transform: rotate(-5deg); }
  75% { transform: rotate(3deg); }
  100% { transform: rotate(0deg); }
}

@keyframes talkingAnimation {
  0% { transform: scaleY(1); }
  50% { transform: scaleY(1.2); }
  100% { transform: scaleY(1); }
}

.faceContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  width: 90%;
  max-width: 400px;
  padding: 20px;
  transition: transform 0.3s ease-in-out;
}

.faceContainer.loaded {
  opacity: 1;
  animation: fadeIn 0.5s ease-out forwards;
}

.eyesContainer {
  display: flex;
  gap: clamp(20px, 5vw, 40px);
  margin-bottom: 5px;
}

.eye {
  width: clamp(10px, 3vw, 20px);
  height: clamp(30px, 8vw, 60px);
  background-color: white;
  border-radius: 20px;
  cursor: pointer;
  transform-origin: center center;
  transition: transform 0.1s ease-out;
  box-shadow: 0 0 0 0 rgba(255,255,255,0);
  margin-bottom: 6px;
}

.eye:hover {
  transform: scaleY(0.4) scaleX(1.2);
  box-shadow: 0 0 10px 0 rgba(255, 255, 255, 0.3);
}

.bar {
  width: 4px;
  height: 10px;
  background-color: white;
  border-radius: 3px;
}

.talking .bar {
  animation: soundBar 1s ease-in-out infinite;
}

.buttonContainer {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 1000;
}

.togglePanel {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(5px);
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.togglePanel:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(45deg);
}

.spinner {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.mustache {
  width: 600px;
  height: 350px;
  background: url(./assets/96a6b5d3-19ed-4b2d-a37e-fd968dd2ca8e.png) no-repeat center center;
  background-size: contain;
  margin-top: -30px;
  margin-bottom: -160px;
}

.bowtie {
  width: 220px;
  height: 130px;
  background: url(./assets/bd94a16c-eec5-4631-a492-53996a01dda1.png) no-repeat center center;
  background-size: contain;
}

.mustacheTalking {
  animation: mustacheTalk 0.6s infinite;
}

.bowtieWiggle {
  animation: bowtieSpin 2s ease-in-out infinite;
}

.mustacheBowtieContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -110px;
}

.chatWidgetContainer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.chatToggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--shadow-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.chatToggle:hover {
  transform: scale(1.1);
}

.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 20px;
}

.bar:nth-child(2n) { animation-delay: 0.1s; }
.bar:nth-child(3n) { animation-delay: 0.2s; }

.chatWindow {
  position: fixed;
  bottom: 90px;
  right: 10px;
  width: 320px;
  height: 450px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border-radius: 15px;
  box-shadow: 0 5px 20px var(--shadow-color);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  opacity: 1;
  transform: translateY(0);
  color: var(--text-color);
}

.chatWindow.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.chatHeader {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: var(--text-color);
  padding: 15px;
  border-radius: 15px 15px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.headerContent {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.headerContent h2 {
  margin: 0;
  font-size: 1.2em;
}

.closeBtn {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.chatContent {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
}

.chatContent::-webkit-scrollbar {
  width: 8px;
}

.chatContent::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.chatContent::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.chatContent::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

@media (max-width: 480px) {
  .chatWindow {
    width: calc(100vw - 40px);
    right: 8px;
    bottom: 78px;
  }

  .chatWidgetContainer {
    right: 8px;
    bottom: 8px;
  }
}
