:root {
  --ai-bg-main: #0b1d33;
  --ai-bg-secondary: #102a4a;
  --ai-bg-tertiary: #0f2440;
  --ai-accent: #4da3ff;
  --ai-text-main: #eaf2ff;
  --ai-text-muted: #9fb3c8;
  --ai-error: #ff6b6b;
}

.paradise-ai {
  margin: 0;
  background: linear-gradient(180deg, var(--ai-bg-main), #071629);
  color: var(--ai-text-main);
  height: 100vh;
  overflow: hidden;
}

.sidebar-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 1100;
  background: #0b2a4a;
  color: #fff;
  border: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
}

@media (min-width: 769px) {
  .sidebar-toggle {
    display: none;
  }
}

.ai-navbar {
  height: 60px;
  background: var(--ai-bg-secondary);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 9999999;
}

.ai-nav-title {
  font-weight: 600;
  letter-spacing: 0.3px;
}

.ai-layout {
  display: flex;
  height: calc(100vh - 56px);
}

.ai-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 260px;
  background: var(--ai-bg-tertiary);
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 1050;
  margin-top: 60px;
}

.ai-sidebar.collapsed {
  width: 64px;
}

/* Mobile behavior */
@media (max-width: 768px) {
  .ai-sidebar {
    transform: translateX(-100%);
  }

  .ai-sidebar.open {
    transform: translateX(0);
  }
}
@media (min-width: 769px) {
  .paradise-ai.sidebar-collapsed .main {
    margin-left: 72px;
  }
}

.ai-sidebar-item {
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: var(--ai-text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.ai-sidebar-item p {
  color: var(--ai-text-muted);
}

.ai-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ai-text-main);
}

.ai-sidebar.collapsed .ai-label {
  display: none;
}

/* ===== MAIN CHAT AREA ===== */
.ai-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  height: calc(100vh - 60px);
  margin-left: 260px;
}

.ai-sidebar.collapsed ~ .ai-main {
  margin-left: 64px;
}

@media (max-width: 768px) {
  .ai-main {
    margin-left: 0;
  }
}

/* ===== EMPTY STATE ===== */
.ai-empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.typing-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 16px;
  min-height: 38px;
  padding: 2rem;
}

.trust {
  font-size: 14px;
  color: var(--ai-text-muted);
}

/* ===== CHAT RESPONSES ===== */
.chat {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 160px;
  display: none;
}

.message {
  max-width: 780px;
  margin: 0 auto;
}

/* ===== AI Video Embed ===== */
.message.ai.video {
  margin: 1rem auto;
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.video-wrapper:hover {
  transform: scale(1.01);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.message.ai.error {
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 80, 80, 0.3);
  color: #ffb3b3;
}

.ai {
  background: rgba(255, 255, 255, 0.04);
  padding: 18px 20px;
  border-radius: 14px;
  line-height: 1.6;
}
.ai-link {
  color: blue;
}
.ai-link:hover {
  color: darkblue;
  text-decoration: underline;
}
/* ===== LOADING SKELETON ===== */
.skeleton {
  height: 120px;
  background: linear-gradient(90deg, #0f2440, #14335c, #0f2440);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 14px;
  margin-bottom: 24px;
}

@keyframes shimmer {
  0% {
    background-position: 0% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===== INPUT ===== */
.input-wrapper {
  flex-shrink: 0;
  padding: 16px 0 24px;
  background: linear-gradient(
    to top,
    rgba(7, 22, 41, 0.98),
    rgba(7, 22, 41, 0.85),
    transparent
  );
}

.chat-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ai-sidebar.collapsed ~ .ai-main .input-wrapper,
.ai-sidebar.collapsed ~ .ai-main .chat-wrapper {
  left: 64px;
}

.input-box {
  display: flex;
  align-items: center;
  background: var(--ai-bg-secondary);
  border-radius: 14px;
  padding: 12px 14px;
  max-width: 700px;
  margin: 0 auto;
}

.paradise-textarea {
  flex: 1;
  background: transparent;
  border: none;
  resize: none;
  color: var(--ai-text-main);
  font-size: 15px;
  resize: none;
  outline: none;
  max-height: 120px;
}

.ai-send-btn {
  background: var(--ai-accent);
  border: none;
  color: #00142a;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .input-wrapper,
  .chat-wrapper {
    left: 16px;
    right: 16px;
  }
}

@media (max-width: 462px) {
  .typing-title {
    font-size: 1.9rem;
  }
}

/* ===== RELATED GUIDES (LUXURY CARDS) ===== */

#related-guides {
  max-width: 980px;
  margin: 32px auto 0;
  width: 100%;
}
.related-guides {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0;
}
.guides-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ai-text-main);
}

.guides-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}

.guides-row::-webkit-scrollbar {
  height: 6px;
}

.guides-row::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
.guide-card {
  min-width: 220px;
  flex: 0 0 240px;
  scroll-snap-align: start;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02)
  );
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ai-text-main);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.guide-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

.guide-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  margin: 0;
}

.guide-card h4 {
  padding: 12px 14px 14px;
  /* font-size: 0.95rem; */
  line-height: 1.35;
  font-weight: 500;
  padding: 0.75rem;
}

/* ===== AI RESPONSE TYPOGRAPHY ===== */
.message.ai h2,
.message.ai h3,
.message.ai p,
.message.ai ul li {
  color: white;
}

/* ===== CHAT HISTORY ===== */

.ai-chat-history {
  margin-top: 24px;
  padding: 0 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-chat-history-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  font-size: 13px;
  color: var(--ai-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#chatHistoryList {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chat-history-item {
  padding: 4px 5px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--ai-text-muted);
  cursor: pointer;
  transition: background 0.2s ease;
  margin: 0.1rem 0.5rem;
}

.chat-history-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ai-text-main);
}

.chat-history-item.active {
  background: linear-gradient(
    90deg,
    rgba(77, 163, 255, 0.18),
    rgba(77, 163, 255, 0.05)
  );
  color: var(--ai-text-main);
}

.chat-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-sidebar.collapsed .ai-chat-history-header,
.ai-sidebar.collapsed .chat-title {
  display: none;
}

/* NEW CHAT BUTTON */
.ai-new-chat {
  padding: 12px;
}

.new-chat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    rgba(77, 163, 255, 0.18),
    rgba(77, 163, 255, 0.05)
  );
  border: none;
  color: var(--ai-text-main);
  cursor: pointer;
  font-weight: 500;
}

.new-chat-btn:hover {
  background: rgba(77, 163, 255, 0.25);
}

.ai-sidebar.collapsed .new-chat-btn span.ai-label {
  display: none;
}

/* RENAME BUTTON */
.chat-actions {
  opacity: 0.4;
  cursor: pointer;
  margin-left: auto;
}

.chat-history-item:hover .chat-actions {
  opacity: 1;
}

.chat-rename-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 8px;
  padding: 4px 6px;
  color: var(--ai-text-main);
  outline: none;
}
