* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

*:focus, *:active {
  outline: none !important;
  box-shadow: none !important;
}

:root {
  --crimson: #8B1A1A;
  --crimson-dark: #5C0F0F;
  --crimson-dim: rgba(139, 26, 26, 0.18);
  --crimson-border: rgba(139, 26, 26, 0.4);
  --gray-dark: #1c1c1c;
  --gray-mid: #2a2a2a;
  --gray-light: #3a3a3a;
  --text-main: #d6d6d6;
  --text-dim: rgba(214, 214, 214, 0.4);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--gray-dark);
  color: var(--text-main);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ===================== MENU ===================== */
.menu-wrapper {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1000;
}

.menu-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gray-mid);
  border: 1px solid var(--crimson-border) !important;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.3s;
}

.menu-btn:hover {
  background: var(--crimson-dim);
}

.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--crimson);
  border-radius: 2px;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 52px;
  left: 0;
  background: var(--gray-mid);
  border-radius: 12px;
  overflow: hidden;
  min-width: 200px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.7), 0 0 0 1px var(--crimson-border);
  flex-direction: column;
}

.dropdown-menu.open {
  display: flex;
}

.dropdown-item {
  padding: 12px 18px;
  color: var(--text-main);
  background: none;
  border: none !important;
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  display: block;
}

.dropdown-item:hover {
  background: var(--crimson-dim);
  color: #ff6b6b;
}

/* ===================== HERO ===================== */
.hero-section {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.4s;
}

.hero-section.hidden {
  opacity: 0;
  pointer-events: none;
}

.hero-text {
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  color: var(--text-main);
  text-align: center;
  font-weight: 400;
  padding: 0 24px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  max-width: 500px;
}

/* ===================== CHAT AREA ===================== */
.chat-area {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 80px;
  overflow-y: auto;
  padding: 80px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-area::-webkit-scrollbar { width: 4px; }
.chat-area::-webkit-scrollbar-track { background: transparent; }
.chat-area::-webkit-scrollbar-thumb { background: var(--crimson-dark); border-radius: 4px; }

/* ===================== MESSAGES ===================== */
.message {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.6;
  animation: msgIn 0.25s ease;
}

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

.message.user {
  background: var(--gray-light);
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.07) !important;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

[dir="ltr"] .message.user {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 18px;
}

.message.bot {
  background: var(--gray-mid);
  color: var(--text-main);
  border: 1px solid var(--crimson-border) !important;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

[dir="ltr"] .message.bot {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 18px;
}

.message a {
  color: #c46060;
  word-break: break-all;
}

/* ===================== SUGGESTIONS ===================== */
.suggestions-box {
  position: fixed;
  bottom: 80px;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--gray-mid);
  border-top: 1px solid var(--crimson-border);
  z-index: 500;
  display: none;
  flex-direction: column;
}

.suggestions-box.visible { display: flex; }

.suggestion-item {
  padding: 12px 20px;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text-main);
  border-bottom: 1px solid rgba(139,26,26,0.15);
  transition: background 0.2s, color 0.2s;
}

.suggestion-item:hover {
  background: var(--crimson-dim);
  color: #ff8080;
}

/* ===================== INPUT BAR ===================== */
.input-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: var(--gray-mid);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-top: 1px solid var(--crimson-border);
  z-index: 600;
}

.chat-input {
  flex: 1;
  background: var(--gray-dark);
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 24px;
  padding: 12px 18px;
  font-size: 0.95rem;
  transition: border-color 0.3s;
}

.chat-input:focus {
  border-color: var(--crimson) !important;
}

.chat-input::placeholder { color: var(--text-dim); }

.send-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--crimson-dark), var(--crimson));
  border: none !important;
  color: #f0d0d0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s, opacity 0.2s;
}

.send-btn:hover { transform: scale(1.08); opacity: 0.9; }
.send-btn svg { width: 20px; height: 20px; }

/* ===================== RTL/LTR ===================== */
[dir="ltr"] .menu-wrapper { left: auto; right: 16px; }
[dir="ltr"] .dropdown-menu { left: auto; right: 0; }
[dir="ltr"] .dropdown-item { text-align: right; }
[dir="ltr"] .chat-input { direction: ltr; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 600px) {
  .message { max-width: 88%; font-size: 0.9rem; }
}
