/* Marvel Chatbot Widget Styling */

#marvel-chat-widget {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 2300;
  width: 60px;
  height: 60px;
  overflow: hidden;
  transition: all 0.3s ease;
  border-radius: 50%;
}

#marvel-chat-widget.open {
  width: 380px;
  height: 600px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.15);
  border-radius: 18px;
  overflow: visible;
}

.marvel-chat-header {
  background: linear-gradient(135deg, #cf9d6c 0%, #9a5d38 100%);
  color: white;
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-radius: 50%;
  user-select: none;
  width: 60px;
  height: 60px;
  min-height: 60px;
  position: relative;
}

#marvel-chat-widget.open .marvel-chat-header {
  border-radius: 18px 18px 0 0;
  height: auto;
  min-height: unset;
  padding: 1.2rem 1.4rem;
  width: 100%;
}

.marvel-chat-title {
  display: none;
  align-items: center;
  gap: 0.8rem;
  font-weight: 700;
  font-size: 1.05rem;
}

#marvel-chat-widget.open .marvel-chat-title {
  display: flex;
}

.marvel-chat-icon {
  font-size: 1.4rem;
}

.marvel-chat-toggle {
  background: none;
  border: 0;
  color: white;
  cursor: pointer;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  font-weight: bold;
  position: static;
  padding: 0;
  margin: 0;
}

#marvel-chat-widget.open .marvel-chat-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.2);
}

.marvel-chat-toggle:hover {
  background: rgba(255,255,255,0.3);
}

.marvel-chat-close {
  font-size: 1.8rem;
  display: block;
}

#marvel-chat-widget.open .marvel-chat-close {
  font-size: 1.3rem;
}

#marvel-chat-widget.open .marvel-chat-toggle:hover {
  background: rgba(255,255,255,0.3);
}

.marvel-chat-body {
  display: none;
  flex-direction: column;
  height: calc(600px - 65px);
  background: #f9f6f2;
  border-radius: 0 0 18px 18px;
}

#marvel-chat-widget.open .marvel-chat-body {
  display: flex;
}

.marvel-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.marvel-chat-message {
  display: flex;
  animation: slideIn 0.3s ease;
}

.marvel-chat-message.user {
  justify-content: flex-end;
}

.marvel-chat-message.bot {
  justify-content: flex-start;
}

.marvel-chat-bubble {
  max-width: 75%;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  line-height: 1.5;
  font-size: 0.95rem;
}

.marvel-chat-message.user .marvel-chat-bubble {
  background: linear-gradient(135deg, #cf9d6c 0%, #9a5d38 100%);
  color: white;
  border-radius: 14px 4px 14px 14px;
}

.marvel-chat-message.bot .marvel-chat-bubble {
  background: white;
  color: #333;
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.05);
}

.marvel-chat-input-area {
  display: flex;
  gap: 0.6rem;
  padding: 1rem;
  background: white;
  border-top: 1px solid rgba(0,0,0,0.06);
  border-radius: 0 0 18px 18px;
}

.marvel-chat-input {
  flex: 1;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.marvel-chat-input:focus {
  border-color: #cf9d6c;
}

.marvel-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #cf9d6c 0%, #9a5d38 100%);
  color: white;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.marvel-chat-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(207,157,108,0.2);
}

.marvel-chat-send:active {
  transform: translateY(0);
}

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

.marvel-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.marvel-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(207,157,108,0.3);
  border-radius: 3px;
}

.marvel-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(207,157,108,0.5);
}

/* Animation */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  #marvel-chat-widget.open {
    width: calc(100vw - 1.5rem);
    height: 70vh;
    bottom: 0.75rem;
    left: 0.75rem;
    max-width: 100%;
    border-radius: 14px;
  }

  .marvel-chat-body {
    height: calc(70vh - 65px);
  }

  .marvel-chat-bubble {
    max-width: 90%;
  }
}

/* Hidden state */
#marvel-chat-widget:not(.open) .marvel-chat-body {
  display: none;
}

#marvel-chat-widget:not(.open) .marvel-chat-header {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 60px;
  height: 60px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#marvel-chat-widget:not(.open) .marvel-chat-header:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(207,157,108,0.25);
}

#marvel-chat-widget:not(.open) .marvel-chat-title {
  display: none;
}

#marvel-chat-widget:not(.open) .marvel-chat-toggle {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #cf9d6c 0%, #9a5d38 100%);
  border-radius: 50%;
  padding: 0;
}

#marvel-chat-widget:not(.open) .marvel-chat-close::before {
  content: '💬';
  position: absolute;
  font-size: 1.6rem;
}

#marvel-chat-widget:not(.open) .marvel-chat-close {
  font-size: 0;
}
