/* Yomi Chatbot Styles */
/* The Fifth Anomaly - Threshold Guardian Interface */

:root {
  --yomi-pink: #FF69B4;
  --yomi-cyan: #00F5FF;
  --yomi-dark: #1a1a1a;
  --yomi-darker: #0a0a0a;
  --yomi-glow: rgba(255, 105, 180, 0.3);
  --yomi-shadow: rgba(0, 0, 0, 0.7);
}

/* Chat Container */
.yomi-chat-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Chat Bubble */
.yomi-chat-bubble {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--yomi-pink) 0%, var(--yomi-cyan) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--yomi-glow);
  transition: all 0.3s ease;
  position: relative;
  animation: yomi-pulse 3s ease-in-out infinite;
}

.yomi-chat-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px var(--yomi-glow);
}

.yomi-bubble-icon {
  font-size: 22px;
  color: white;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yomi-bubble-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--yomi-pink) 0%, var(--yomi-cyan) 100%);
  opacity: 0;
  animation: yomi-pulse-ring 2s ease-out infinite;
}

/* Attention-grabbing pulse */
.yomi-pulse-attention {
  animation: yomi-attention 1s ease-in-out 3;
}

/* Chat Window */
.yomi-chat-window {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 600px;
  max-height: calc(100vh - 40px);
  background: var(--yomi-darker);
  border-radius: 16px;
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 8px 40px var(--yomi-shadow);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.yomi-chat-window::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(135deg, var(--yomi-pink), var(--yomi-cyan));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.yomi-chat-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.yomi-chat-header {
  padding: 16px;
  background: linear-gradient(135deg, rgba(255, 105, 180, 0.1), rgba(0, 245, 255, 0.1));
  border-bottom: 1px solid rgba(255, 105, 180, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 14px 14px 0 0;
}

.yomi-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.yomi-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--yomi-pink), var(--yomi-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1;
}

.yomi-header-text {
  flex: 1;
}

.yomi-name {
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--yomi-pink), var(--yomi-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.yomi-status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.yomi-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yomi-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Pinned Message */
.yomi-pinned-message {
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(255, 105, 180, 0.15), rgba(0, 245, 255, 0.15));
  border-bottom: 1px solid rgba(255, 105, 180, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.yomi-pinned-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.yomi-pinned-content {
  flex: 1;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
}

.yomi-pinned-content a {
  color: var(--yomi-cyan);
  text-decoration: underline;
}

.yomi-unpin-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.yomi-unpin-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Messages Area */
.yomi-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--yomi-darker);
}

.yomi-messages::-webkit-scrollbar {
  width: 6px;
}

.yomi-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.yomi-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--yomi-pink), var(--yomi-cyan));
  border-radius: 3px;
}

/* Message Bubbles */
.yomi-message {
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 80%;
  word-wrap: break-word;
  animation: yomi-message-appear 0.3s ease;
}

.yomi-message-user {
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid rgba(0, 245, 255, 0.3);
  color: white;
  align-self: flex-end;
  margin-left: auto;
}

.yomi-message-yomi {
  background: rgba(255, 105, 180, 0.1);
  border: 1px solid rgba(255, 105, 180, 0.3);
  color: rgba(255, 255, 255, 0.9);
  align-self: flex-start;
}

/* Streaming message indicator */
.yomi-streaming {
  position: relative;
}

.yomi-streaming::after {
  content: '▋';
  animation: yomi-cursor-blink 1s step-end infinite;
  color: var(--yomi-pink);
  margin-left: 2px;
}

/* Glitch Effect */
.yomi-glitch {
  display: inline-block;
  animation: yomi-text-glitch 0.5s ease-in-out;
  color: var(--yomi-cyan);
  text-shadow: 0 0 5px var(--yomi-cyan);
}

/* Typing Indicator */
.yomi-typing {
  opacity: 0.7;
}

.yomi-typing-dots {
  display: inline-flex;
  gap: 2px;
}

.yomi-typing-dots span {
  animation: yomi-typing-bounce 1.4s infinite;
}

.yomi-typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.yomi-typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* Input Area */
.yomi-input-container {
  padding: 16px 16px 8px 16px;
  background: var(--yomi-dark);
  border-top: 1px solid rgba(255, 105, 180, 0.2);
  display: flex;
  gap: 8px;
}

.yomi-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: white;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.yomi-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--yomi-pink);
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
}

.yomi-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.yomi-send-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: linear-gradient(135deg, var(--yomi-pink), var(--yomi-cyan));
  color: white;
  border-radius: 12px;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.yomi-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px var(--yomi-glow);
}

.yomi-send-btn:active {
  transform: scale(0.95);
}

/* Character Counter */
.yomi-char-counter {
  padding: 0 16px 12px 16px;
  background: var(--yomi-dark);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  text-align: right;
  transition: color 0.2s ease;
  border-radius: 0 0 14px 14px;
}

.yomi-char-counter #yomi-char-count {
  transition: color 0.2s ease;
}

/* Animations */
@keyframes yomi-pulse {
  0%, 100% {
    box-shadow: 0 4px 20px var(--yomi-glow);
  }
  50% {
    box-shadow: 0 4px 30px rgba(255, 105, 180, 0.5);
  }
}

@keyframes yomi-pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes yomi-attention {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

@keyframes yomi-message-appear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes yomi-typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-5px);
  }
}

@keyframes yomi-text-glitch {
  0%, 100% {
    transform: translate(0);
    opacity: 1;
  }
  20% {
    transform: translate(-2px, 2px);
    opacity: 0.8;
  }
  40% {
    transform: translate(2px, -2px);
    opacity: 0.8;
  }
  60% {
    transform: translate(-2px, -2px);
    opacity: 0.8;
  }
  80% {
    transform: translate(2px, 2px);
    opacity: 0.8;
  }
}

@keyframes yomi-cursor-blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .yomi-chat-window {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    bottom: 10px;
    right: 10px;
    border-radius: 12px;
  }

  .yomi-chat-bubble {
    bottom: 10px;
    right: 10px;
  }

  .yomi-message {
    max-width: 85%;
  }
}
