/* Tootsie Chat Widget Styles */

.tootsie-chat {
  position: relative;
  max-width: 720px;
  margin: 1rem auto;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tootsie-chat .header {
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  background-image: url('./img/tootsie_header.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  min-height: 60px;
  display: flex;
  align-items: center;
}

.tootsie-chat .msgs {
  padding: 1rem;
  height: 360px;
  overflow: auto;
  background: #fafafa;
}

.tootsie-chat .msg {
  display: flex;
  margin-bottom: 0.6rem;
}

.tootsie-chat .msg.user {
  justify-content: flex-end;
}

.tootsie-chat .msg .bubble {
  max-width: 80%;
  padding: 0.6rem 0.8rem;
  border-radius: 14px;
  line-height: 1.35;
  font-size: 15px;
  white-space: pre-wrap;
}

.tootsie-chat .msg.user .bubble {
  background: #dff1ff;
  border: 1px solid #c4e4ff;
}

.tootsie-chat .msg.bot .bubble {
  background: #fff;
  border: 1px solid #e7e7e7;
}

/* Linkit chat-vastauksissa */
.tootsie-chat .msg.bot .bubble a {
  color: #0073aa;
  text-decoration: underline;
}

.tootsie-chat .msg.bot .bubble a:hover {
  color: #005a87;
}

/* Luettelot chat-vastauksissa */
.tootsie-chat .msg.bot .bubble ul,
.tootsie-chat .msg.bot .bubble ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.tootsie-chat .msg.bot .bubble li {
  margin-bottom: 0.25rem;
}

.tootsie-chat .msg.thinking .bubble {
  opacity: 0.6;
  font-style: italic;
  background: #e8f4fd !important;
  border-color: #b3d9ff !important;
}

/* Loading animaatio */
.tootsie-chat .thinking-dots {
  display: inline-block;
  position: relative;
  width: 20px;
  height: 20px;
}

.tootsie-chat .thinking-dots::after {
  content: '';
  display: block;
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #007bff;
  animation: thinking 1.2s infinite;
}

.tootsie-chat .thinking-dots::before {
  content: '';
  display: block;
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #007bff;
  animation: thinking 1.2s infinite 0.2s;
  left: 12px;
}

.tootsie-chat .thinking-dots span {
  display: block;
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #007bff;
  animation: thinking 1.2s infinite 0.4s;
  left: 24px;
}

@keyframes thinking {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Valmiit kysymykset */
.tootsie-chat .quick-questions {
  padding: 0.75rem;
  border-top: 1px solid #eee;
  background: #f8f9fa;
}

.tootsie-chat .quick-questions h4 {
  margin: 0 0 0.5rem 0;
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.tootsie-chat .quick-questions .buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tootsie-chat .quick-questions button {
  padding: 0.4rem 0.8rem;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  white-space: nowrap;
}

/* Mobiili-optimointi */
@media (max-width: 768px) {
    .tootsie-chat .quick-questions button {
      font-size: 9px !important;
      padding: 0.2rem 0.9rem !important;
    }
  }

.tootsie-chat .quick-questions button:hover {
  background: #f0f0f0;
  border-color: #ccc;
}

.tootsie-chat .quick-questions button:active {
  transform: scale(0.95);
}

/* Valmiit vastaukset - eri väri */
.tootsie-chat .quick-questions button.has-quick-answer {
  background: #e8f5e8;
  border-color: #4caf50;
  color: #2e7d32;
}

.tootsie-chat .quick-questions button.has-quick-answer:hover {
  background: #c8e6c9;
  border-color: #388e3c;
}

.tootsie-chat .form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #eee;
  background: #fff;
}

.tootsie-chat .form input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: 1px solid #ddd !important;
  border-radius: 10px !important;
  outline: none !important;
  box-shadow: none !important;
  background: #fff !important;
  color: #333 !important;
  font-size: 15px !important;
}

.tootsie-chat .form input:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px #2b6cff !important;
  border-color: #2b6cff !important;
}

.tootsie-chat .form button {
  padding: 0.6rem 0.9rem;
  border: 1px solid #1b5cff !important;
  background: #2b6cff !important;
  color: #fff !important;
  border-radius: 10px !important;
  cursor: pointer;
  font-size: 15px !important;
  font-weight: 500 !important;
}

.tootsie-chat .form button:hover {
  filter: brightness(0.96) !important;
  background: #1b5cff !important;
}

.tootsie-chat .form button:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(43, 108, 255, 0.3) !important;
}
