/* Chat Interface Styles */
.hero-visual.chat-active {
  padding: 0;
  min-height: 600px;
  height: auto;
  display: flex;
  flex-direction: column;
}

.hero-visual.chat-active .energy-ring-visual {
  display: none;
}

.hero-visual.chat-active .hero-visual-content {
  display: none;
}

/* Chat container inside hero-visual */
.chat-container {
  display: none;
  width: 100%;
  flex: 1;
  flex-direction: column;
}

.chat-container.active {
  display: flex;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.chat-wrapper {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Chat box - covers entire wrapper */
.chat-box {
  width: 100%;
  flex: 1;
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode .chat-box {
  background: var(--dark);
  border: 1px solid #444;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat header */
.chat-header {
  padding: 1.5rem 2rem;
  background: var(--yellow);
  color: var(--dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.chat-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
}

.chat-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--dark);
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.chat-close:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: rotate(90deg);
}

/* Chat messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #f9f9f9;
}

body.dark-mode .chat-messages {
  background: var(--darker);
}

.chat-message {
  display: flex;
  gap: 1rem;
  max-width: 80%;
  animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message.assistant {
  align-self: flex-start;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.message-avatar.user {
  background: var(--yellow);
  color: var(--dark);
}

.message-avatar.assistant {
  background: transparent;
  color: var(--white);
  padding: 5px;
}

body.dark-mode .message-avatar.assistant {
  background: transparent;
}

.message-content {
  background: white;
  padding: 1rem 1.2rem;
  border-radius: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  line-height: 1.6;
}

body.dark-mode .message-content {
  background: var(--dark);
  color: var(--white);
  border: 1px solid #444;
}

.chat-message.user .message-content {
  background: var(--yellow);
  color: var(--dark);
}

.message-content p {
  margin: 0;
}

/* Typing indicator */
.typing-indicator {
  display: none;
  gap: 0.3rem;
  padding: 1rem 1.2rem;
  background: white;
  border-radius: 15px;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.dark-mode .typing-indicator {
  background: var(--dark);
  border: 1px solid #444;
}

.typing-indicator.active {
  display: flex;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray);
  animation: typingBounce 1.4s infinite;
}

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

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

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* Chat input area */
.chat-input-area {
  padding: 1.5rem 2rem;
  background: white;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 1rem;
  align-items: center;
}

body.dark-mode .chat-input-area {
  background: var(--dark);
  border-top: 1px solid #444;
}

.chat-input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  font-size: 1rem;
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: all 0.2s;
  background: #f9f9f9;
}

body.dark-mode .chat-input {
  background: var(--darker);
  border-color: #444;
  color: var(--white);
}

.chat-input:focus {
  border-color: var(--yellow);
  background: white;
}

body.dark-mode .chat-input:focus {
  background: var(--dark);
}

.chat-send-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--yellow);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(255, 213, 0, 0.4);
}

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

.chat-send-btn svg {
  width: 24px;
  height: 24px;
  fill: var(--dark);
}

/* Responsive */
@media (max-width: 768px) {
  .chat-box {
    width: 95%;
    height: 90vh;
    border-radius: 15px;
  }

  .chat-header {
    padding: 1rem 1.5rem;
  }

  .chat-messages {
    padding: 1rem;
  }

  .chat-input-area {
    padding: 1rem;
  }

  .chat-message {
    max-width: 90%;
  }

  .chat-energy-ring {
    width: 60px;
    height: 60px;
  }
}
