/* Chat Widget */
.chat-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  font-family: var(--font-main);
}

.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
  transition: transform 0.3s, box-shadow 0.3s;
  font-size: 1.5rem;
}

.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(255, 215, 0, 0.6);
}

.chat-box {
  display: none;
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-height: 520px;
  background: #1E1E1E;
  border: 1px solid #2A2A2A;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  flex-direction: column;
}

.chat-box.active {
  display: flex;
}

.chat-header {
  background: linear-gradient(135deg, #1a1200, #0F0F0F);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2A2A2A;
}

.chat-header-title {
  color: #FFD700;
  font-weight: 700;
  font-size: 1rem;
}

.chat-header-subtitle {
  color: #A0A0A0;
  font-size: 0.75rem;
}

.chat-lang-selector {
  display: flex;
  gap: 0.5rem;
}

.chat-lang-btn {
  background: transparent;
  border: 1px solid #2A2A2A;
  color: #A0A0A0;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-lang-btn.active, .chat-lang-btn:hover {
  border-color: #FFD700;
  color: #FFD700;
  background: rgba(255, 215, 0, 0.1);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 280px;
  max-height: 320px;
}

.chat-message {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.4;
  position: relative;
}

.chat-message.incoming {
  align-self: flex-start;
  background: #2A2A2A;
  color: #F0F0F0;
  border-bottom-left-radius: 4px;
}

.chat-message.outgoing {
  align-self: flex-end;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  border-bottom-right-radius: 4px;
}

.chat-message .translation {
  display: block;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-style: italic;
  font-size: 0.8rem;
  opacity: 0.8;
}

.chat-message.outgoing .translation {
  border-top-color: rgba(0,0,0,0.15);
}

.chat-message .lang-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 0.25rem;
  display: block;
}

.chat-input-area {
  padding: 0.75rem;
  border-top: 1px solid #2A2A2A;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chat-input {
  flex: 1;
  background: #121212;
  border: 1px solid #2A2A2A;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #F0F0F0;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.3s;
}

.chat-input:focus {
  border-color: #FFD700;
}

.chat-input::placeholder {
  color: #666;
}

.chat-send-btn {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: transform 0.2s;
}

.chat-send-btn:hover {
  transform: scale(1.1);
}

.chat-typing {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  color: #A0A0A0;
  font-style: italic;
  display: none;
}

.chat-typing.active {
  display: block;
}

/* RTL support for Arabic */
.chat-message[dir="rtl"] {
  text-align: right;
  direction: rtl;
}

/* Responsive */
@media (max-width: 480px) {
  .chat-box {
    width: calc(100vw - 2rem);
    right: -1rem;
    bottom: 70px;
  }
}

@keyframes pulse {
  0% { box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(255, 215, 0, 0.8); transform: scale(1.05); }
  100% { box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4); }
}
