/* =========================
   Nexa Chat - Phase 1
========================= */

body.nexa-page {
  margin: 0;
  padding: 0;
  background: #0b1020;
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

.nexa-page .nexa-chat {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100vh;
  width: 100%;
  background:
    radial-gradient(circle at top right,
    rgba(108,76,255,.18),
    transparent 40%),
    #0b1020;
}

.nexa-page .chat-header{
  display:flex;
  flex-direction:column;
  padding:22px;
  gap:14px;
  background:#111827;
  border-right:1px solid rgba(255,255,255,.08);
}

.nexa-page .chat-header h1{
  margin:0;
  font-size:34px;
}

.nexa-page .chat-header p{
  margin:0;
  color:#b7bfd6;
}

.nexa-page #newChatButton{
  width:100%;
  padding:14px;
  border:none;
  border-radius:14px;
  background:linear-gradient(135deg,#6c4cff,#8d6bff);
  color:white;
  font-weight:bold;
  cursor:pointer;
}

.nexa-page #logoutButton{
  width:100%;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.08);
  background:#1c2438;
  color:white;
  cursor:pointer;
}

.nexa-page #conversationSearch{
  width:100%;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.08);
  background:#1c2438;
  color:white;
  outline:none;
}
.nexa-page .conversation-search-wrapper {
  position: relative;
  width: 100%;
}

.nexa-page .conversation-search-wrapper #conversationSearch {
  padding-right: 42px;
}

.nexa-page .clear-conversation-search {
  display: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nexa-page .clear-conversation-search:hover {
  color: white;
  background: rgba(139, 92, 246, 0.18);
}

.nexa-page .clear-conversation-search.visible {
  display: flex;
}

.nexa-page .conversation-list{
  flex:1;
  overflow-y:auto;
}
/* ===== Phase 2 ===== */

.nexa-page .chat-box{
    flex:1;
    overflow-y:auto;
    padding:30px;
    display:flex;
    flex-direction:column;
    gap:18px;
}

.nexa-page .chat-input{
    display:flex;
    align-items:center;
    gap:14px;
    padding:20px 30px;
    border-top:1px solid rgba(255,255,255,.08);
    background:#111827;
}

.nexa-page #userInput{
    flex:1;
    min-height:58px;
    max-height:180px;
    resize:none;
    border:none;
    outline:none;
    border-radius:16px;
    padding:18px;
    font-size:16px;
    background:#1c2438;
    color:white;
}

.nexa-page #sendButton{
    width:95px;
    height:58px;
    border:none;
    border-radius:16px;
    background:linear-gradient(135deg,#6c4cff,#8d6bff);
    color:white;
    font-weight:bold;
    cursor:pointer;
}

.nexa-page .message{
    max-width:78%;
    padding:16px 18px;
    border-radius:18px;
    line-height:1.6;
}

.nexa-page .message.user{
    align-self:flex-end;
    background:#6c4cff;
}

.nexa-page .message.ai{
    align-self:flex-start;
    background:#1c2438;
}
/* ===== Main Chat Area Fix ===== */

.nexa-page .nexa-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: transparent;
  overflow: hidden;
}

.nexa-page .nexa-main .chat-box {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nexa-page .nexa-main .chat-input {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 18px 30px 22px;
  background: #111827;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nexa-page .nexa-main #userInput {
  flex: 1;
  width: auto;
  min-height: 56px;
  max-height: 160px;
  padding: 16px 18px;
  resize: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  outline: none;
  background: #1c2438;
  color: white;
  font-size: 16px;
}

.nexa-page .nexa-main #sendButton {
  min-width: 95px;
  height: 56px;
  padding: 0 20px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #6c4cff, #8d6bff);
  color: white;
  font-weight: bold;
  cursor: pointer;
}
/* ===== Final Layout Override ===== */

html,
body.nexa-page {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body.nexa-page {
  display: block;
  overflow: hidden;
}

.nexa-page .nexa-chat {
  width: 100%;
  height: 100vh;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-sizing: border-box;

  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}

/* اسم القائمة الجديد في HTML */
.nexa-page .nexa-sidebar {
  min-width: 0;
  min-height: 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  width: 320px;
flex-shrink: 0;
  box-sizing: border-box;

  background: #111827;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.nexa-page .nexa-brand h1 {
  margin: 0;
  font-size: 34px;
}

.nexa-page .nexa-brand p {
  margin: 5px 0 8px;
  color: #b7bfd6;
}

.nexa-page .conversation-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nexa-page .nexa-main {
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;

  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.nexa-page .nexa-main .chat-box {
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 30px clamp(25px, 5vw, 75px);
  box-sizing: border-box;
  overflow-y: auto;
}

.nexa-page .nexa-main .chat-input {
  width: 100%;
  margin: 0;
  padding: 18px clamp(25px, 5vw, 75px) 22px;
  box-sizing: border-box;
}
/* ===== Message Animation ===== */

.nexa-page .message {
  animation: messageAppear 0.28s ease-out;
  transform-origin: bottom;
}

@keyframes messageAppear {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.nexa-page .message-time {
  margin-top: 7px;
  font-size: 11px;
  opacity: 0.58;
}

.nexa-page .message.user .message-time {
  text-align: right;
}

.nexa-page .message.ai .message-time {
  text-align: left;
}
/* ===== Mobile Layout ===== */

@media (max-width: 768px) {

  .nexa-page .nexa-chat {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
  }

  .nexa-page .nexa-sidebar {
    width: 100%;
    max-width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  .nexa-page .nexa-main {
    flex: 1;
    width: 100%;
    overflow: hidden;
  }

  .nexa-page .chat-box {
    padding: 16px;
  }

  .nexa-page .chat-input {
    padding: 12px;
  }

  .nexa-page #userInput {
    font-size: 16px;
  }

}
@media (max-width: 768px) {
  html,
  body.nexa-page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .nexa-page .nexa-chat,
  .nexa-page .nexa-sidebar,
  .nexa-page .nexa-main,
  .nexa-page .chat-box,
  .nexa-page .chat-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .nexa-page .message {
    max-width: 88%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .nexa-page #userInput {
    min-width: 0;
  }

  .nexa-page #sendButton {
    flex-shrink: 0;
    min-width: 72px;
  }
}
/* ===== Final Mobile Screen Lock ===== */

@media (max-width: 768px) {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html,
  body.nexa-page {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  .nexa-page .nexa-chat {
    position: fixed !important;
    inset: 0 !important;

    width: 100vw !important;
height: 100dvh !important;
    min-width: 0 !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;

    overflow: hidden !important;
  }

  .nexa-page .nexa-sidebar {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 1000 !important;

  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  max-height: 40vh;

    margin: 0 !important;
    padding: 14px !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .nexa-page .nexa-main {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;

  margin: 0 !important;
  padding: 0 !important;

  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  align-self: stretch !important;

  overflow: hidden !important;
}

  .nexa-page .chat-box {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;

    margin: 0 !important;
    padding: 14px !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .nexa-page .chat-input {
  width: 100% !important;
  min-width: 0 !important;

  margin: 0 !important;
  padding: 10px !important;

  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;

  overflow: hidden !important;
}

  .nexa-page #userInput {
  flex: 1 1 180px !important;
  width: auto !important;
  min-width: 150px !important;
  min-height: 64px !important;
  max-height: 160px !important;
}

.nexa-page .selected-file-preview.active {
  flex: 0 0 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 4px 0 !important;
  justify-content: flex-start !important;
}

  .nexa-page #sendButton {
    flex: 0 0 auto !important;
    min-width: 70px !important;
  }

  .nexa-page .message {
    max-width: 88% !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
.mobile-menu-button {
    display: none;
}

@media (max-width: 760px) {
    .mobile-menu-button {
        display: flex;
        position: fixed;
        top: 16px;
        left: 16px;
        width: 44px;
        height: 44px;
        border: none;
        border-radius: 12px;
        background: #8b5cf6;
        color: white;
        font-size: 24px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1000;
        box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    }
}
@media (max-width: 760px) {

    .nexa-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 290px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
    }

    .nexa-sidebar.mobile-open {
        left: 0;
    }

    .nexa-chat-box {
        width: 100%;
    }

    .mobile-menu-button {
        z-index: 1001;
    }
}
@media (max-width: 760px) {
  .nexa-page .nexa-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: -100% !important;
    width: 100% !important;
    max-width: 390px !important;
   height: 100vh !important;
min-height: 100vh !important;
    z-index: 9999 !important;
    pointer-events: none !important;
    overflow: hidden !important;
  }

  .nexa-page .nexa-sidebar.mobile-open {
    left: 0 !important;
    pointer-events: auto !important;
  }

  .nexa-page .conversation-list {
    position: relative !important;
    z-index: 10000 !important;
    height: calc(100dvh - 290px) !important;
    max-height: calc(100dvh - 290px) !important;
    overflow-y: auto !important;
  }

  .nexa-page .conversation-row {
    position: relative !important;
    z-index: 10001 !important;
  }
}
/* ===== Conversation list final layout ===== */

.nexa-page .conversation-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px 30px 30px 30px;
  align-items: center;
  column-gap: 8px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.nexa-page .conversation-item {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: all .2s ease;
}


.nexa-page .conversation-row:hover {
  background: rgba(124, 92, 255, 0.12);
  transition: background 0.2s ease;
}

.nexa-page .conversation-item.active {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-color: rgba(255, 255, 255, 0.2);
}

.nexa-page .rename-conversation,
.nexa-page .delete-conversation {
  width: 30px;
height: 30px;
min-width: 30px;
font-size: 13px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.nexa-page .rename-conversation:hover,
.nexa-page .delete-conversation:hover {
  background: rgba(255, 255, 255, 0.14);
}

.nexa-page .conversation-list {
  width: 100%;
  min-width: 0;
  padding-right: 4px;
}
/* ===== Message Action Buttons ===== */

.regenerate-button,
.copy-button,
.edit-button, 
.like-button,
.dislike-button
{
    height: 30px;
    padding: 0 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
    margin-right: 6px;
}

.regenerate-button:hover,
.copy-button:hover,
.edit-button:hover {
    background: #6c63ff;
}
.message-actions{
    display:flex;
    align-items:center;
    gap:8px;
    margin-top:8px;
    flex-wrap:wrap;
}
.chat-image {
  width: 100%;
  max-width: 280px;
  max-height: 320px;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  margin-bottom: 8px;
}
.chat-file {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 280px;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.chat-file-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.chat-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}
.drop-zone {
    position: absolute;
    inset: 20px;
    display: none;
    justify-content: center;
    align-items: center;
    border: 2px dashed #8b5cf6;
    border-radius: 16px;
    background: rgba(139,92,246,.12);
    color: white;
    font-size: 18px;
    font-weight: 600;
    z-index: 999;
    pointer-events: none;
}

.drop-zone.active {
    display: flex;
}
.selected-file-preview {
  display: none;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 220px;
}

.selected-file-preview.active {
  display: flex;
}

#selectedFileName {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-selected-file {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: white;
  background: rgba(255, 255, 255, 0.14);
  font-size: 18px;
  line-height: 1;
}
.image-preview-container {
  display: none;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
}

.image-preview-container.active {
  display: block;
}

.image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Compact image preview before sending */
.selected-file-preview {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  margin: 0 6px;
  max-width: 220px;
  flex-shrink: 0;
}

.selected-file-preview.active {
  display: flex;
}

.image-preview-container {
  display: none;
  position: relative;
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: 12px;
  overflow: hidden;
  margin: 0;
}

.image-preview-container.active {
  display: block;
}

.image-preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
}

.video-preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: none;
}

#selectedFileName {
  display: none;
}

.remove-selected-file {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  font-size: 11px;
  line-height: 18px;
  border-radius: 50%;
}
/* Welcome screen for a new chat */
.welcome-screen {
  width: min(100%, 520px);
  margin: auto;
  padding: 24px 16px;
  text-align: center;
  color: #ffffff;
}

.welcome-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 30px;
  background: linear-gradient(135deg, #6d4aff, #9b5cff);
  box-shadow: 0 10px 30px rgba(109, 74, 255, 0.28);
}

.welcome-screen h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.welcome-screen p {
  margin: 0 0 20px;
  color: #aeb6cb;
  font-size: 14px;
}

.quick-prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-prompt {
  min-height: 54px;
  padding: 12px;
  border: 1px solid rgba(139, 112, 255, 0.35);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
}

.quick-prompt:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 112, 255, 0.8);
  background: rgba(139, 112, 255, 0.12);
}

@media (max-width: 480px) {
  .welcome-screen {
    padding: 18px 12px;
  }

  .welcome-screen h2 {
    font-size: 21px;
  }

  .quick-prompts {
    grid-template-columns: 1fr;
  }

  .quick-prompt {
    min-height: 48px;
  }
}
/* Animated dots for Nexa is thinking */
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  display: block;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
  animation: typingDot 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingDot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
.nexa-page .pin-conversation {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.nexa-page .pin-conversation:hover {
  transform: translateY(-1px);
  background: rgba(124, 92, 255, 0.22);
}
.nexa-page .conversation-row.pinned {
  padding: 6px;
  border-radius: 12px;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.28);
}

.nexa-page .conversation-row.pinned .conversation-item {
  background: rgba(124, 92, 255, 0.16);
}
.nexa-page .favorite-conversation {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffd54a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.nexa-page .favorite-conversation:hover {
  transform: translateY(-1px);
  background: rgba(255, 213, 74, 0.18);
}
.nexa-page .conversation-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 12px;
}

.nexa-page .conversation-filters button {
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #d8d8e8;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nexa-page .conversation-filters button:hover {
  background: rgba(124, 92, 255, 0.16);
}

.nexa-page .conversation-filters button.active {
  background: rgba(124, 92, 255, 0.3);
  border-color: rgba(124, 92, 255, 0.55);
  color: white;
}
/* Hide conversation action buttons by default */
.conversation-row .rename-conversation,
.conversation-row .pin-conversation,
.conversation-row .favorite-conversation,
.conversation-row .delete-conversation {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Show buttons when hovering over the whole conversation row */
.conversation-row:hover .rename-conversation,
.conversation-row:hover .pin-conversation,
.conversation-row:hover .favorite-conversation,
.conversation-row:hover .delete-conversation {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.conversation-time {
  margin-top: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}
.conversation-row {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.conversation-row .conversation-item {
  flex: 1;
  min-width: 0;
  width: 100%;
  text-align: left;
}

.conversation-time {
  display: block;
  width: 100%;
  margin-top: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: visible;
  direction: ltr;
  text-align: left;
}

/* الأزرار لا تحجز مساحة وهي مخفية */

.conversation-date,
.conversation-time {
  display: block;
  width: 100%;
  font-size: 10px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  overflow: visible;
  text-align: left;
  direction: ltr;
}


.conversation-date {
  margin-top: 4px;
}
.nexa-page .conversation-date {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  min-height: 14px !important;
  overflow: visible !important;
  color: #ffffff !important;
  font-size: 11px !important;
  position: static !important;
}
/* Mobile conversation more button */
.conversation-more {
  display: none;
}

@media (max-width: 768px) {
  .conversation-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

  .conversation-row .rename-conversation,
  .conversation-row .pin-conversation,
  .conversation-row .favorite-conversation,
  .conversation-row .delete-conversation {
    display: none;
  }

  .conversation-row.show-actions .rename-conversation,
  .conversation-row.show-actions .pin-conversation,
  .conversation-row.show-actions .favorite-conversation,
  .conversation-row.show-actions .delete-conversation {
    display: inline-flex;
  }
  .conversation-row.show-actions {
  position: relative;
}

.nexa-page .conversation-row.show-actions .rename-conversation,
.nexa-page .conversation-row.show-actions .pin-conversation,
.nexa-page .conversation-row.show-actions .favorite-conversation,
.nexa-page .conversation-row.show-actions .delete-conversation {
  position: absolute !important;
  right: 4px !important;
  z-index: 20 !important;
}
.nexa-page .conversation-row.show-actions .rename-conversation {
  top: 30px !important;
}

.nexa-page .conversation-row.show-actions .pin-conversation {
  top: 58px !important;
}

.nexa-page .conversation-row.show-actions .favorite-conversation {
  top: 86px !important;
}

.nexa-page .conversation-row.show-actions .delete-conversation {
  top: 114px !important;
}
.nexa-page .conversation-row.show-actions .rename-conversation,
.nexa-page .conversation-row.show-actions .pin-conversation,
.nexa-page .conversation-row.show-actions .favorite-conversation,
.nexa-page .conversation-row.show-actions .delete-conversation {
  width: 28px;
  height: 28px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}
.nexa-page .conversation-row.show-actions::after {
  content: "";
  position: absolute;
  top: 26px;
  right: 0;
  width: 36px;
  height: 120px;
  border-radius: 8px;
  background: rgba(20, 20, 30, 0.92);
  z-index: 19;
}

}
.conversation-group-title {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.7;
  margin: 14px 8px 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
@media (max-width: 760px) {
  .nexa-page .conversation-row {
    column-gap: 5px;
    margin-bottom: 6px;
  }
}

.nexa-page .no-conversations {
  width: 100%;
  padding: 24px 12px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}
.nexa-page .no-conversations {
  text-align: center;
  padding: 28px 10px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
}

.nexa-page .no-conversations-icon {
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.75;
}
.nexa-page .search-results-count {
  padding: 8px 10px 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  text-align: left;
}
.connection-status {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;

  padding: 10px 16px;
  border-radius: 999px;

  background: rgba(239, 68, 68, 0.95);
  color: white;

  font-size: 14px;
  font-weight: 600;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);

  transition: opacity 0.25s ease, transform 0.25s ease;
}

.connection-status.online {
  background: rgba(34, 197, 94, 0.95);
}

.connection-status.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
}

@media (max-width: 600px) {
  .connection-status {
    top: 10px;
    width: calc(100% - 32px);
    max-width: 360px;
    text-align: center;
    font-size: 13px;
  }
}
.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;
  background: rgba(6, 8, 20, 0.72);
  backdrop-filter: blur(8px);
}

.settings-modal.hidden {
  display: none;
}

.settings-panel {
  position: relative;

  width: 100%;
  max-width: 460px;

  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;

  background: rgba(20, 22, 43, 0.98);
  color: white;

  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.settings-panel h2 {
  margin: 0 0 24px;
  font-size: 26px;
}

.settings-close {
  position: absolute;
  top: 14px;
  right: 16px;

  width: 38px;
  height: 38px;

  border: none;
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.08);
  color: white;

  font-size: 24px;
  cursor: pointer;
}

.settings-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 8px;

  margin-bottom: 18px;
}

.settings-section label {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 600;
}

.settings-value {
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;

  background: rgba(255, 255, 255, 0.06);
  color: white;

  overflow-wrap: anywhere;
}
.settings-input {
    width: 100%;
    padding: 13px 14px;
    margin-top: 8px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    background: rgba(255,255,255,.06);
    color: white;
    outline: none;
    box-sizing: border-box;
}

.settings-input::placeholder {
    color: rgba(255,255,255,.45);
}

.settings-button {
    width: 100%;
    margin-top: 12px;
}

.settings-section button:not(.settings-close) {
  width: 100%;
  padding: 13px 16px;

  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;

  background: rgba(124, 58, 237, 0.2);
  color: white;

  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.settings-section button:not(.settings-close):hover {
  background: rgba(124, 58, 237, 0.34);
}

.settings-version {
  padding-top: 8px;
  color: rgba(255, 255, 255, 0.48);
  text-align: center;
  font-size: 12px;
}

@media (max-width: 600px) {
  .settings-panel {
    padding: 24px 18px;
    border-radius: 20px;
  }
}
/* =========================
   Light Theme
========================= */

body.light-theme {
  background: #f5f7fb;
  color: #1f2937;
}

body.light-theme .nexa-sidebar {
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
}

body.light-theme .conversation-row {
  background: #ffffff;
  color: #1f2937;
}

body.light-theme .conversation-row:hover {
  background: #f3f4f6;
}

body.light-theme .chat-box {
  background: #ffffff !important;
  background-image: none !important;
}
body.light-theme .chat-box::before,
body.light-theme .chat-box::after {
  display: none !important;
  background: none !important;
}

body.light-theme .message.assistant {
  background: #f3f4f6;
  color: #111827;
}

body.light-theme .message.user {
  background: #7c3aed;
  color: white;
}

body.light-theme .settings-panel {
  background: #ffffff;
  color: #111827;
}

body.light-theme .settings-value {
  background: #f9fafb;
  color: #111827;
  border-color: #d1d5db;
}

body.light-theme .settings-section label {
  color: #4b5563;
}
/* Fix light theme text and main layout */

body.light-theme .app,
body.light-theme .main-content,
body.light-theme .chat-container,
body.light-theme .chat-area,
body.light-theme .chat-box {
  background: #f5f7fb !important;
  color: #111827 !important;
}

body.light-theme .welcome-message,
body.light-theme .welcome-title,
body.light-theme .welcome-subtitle,
body.light-theme .empty-state,
body.light-theme .empty-state p,
body.light-theme .empty-state h1,
body.light-theme .empty-state h2 {
  color: #111827 !important;
}

body.light-theme textarea,
body.light-theme input {
  background: #ffffff !important;
  color: #111827 !important;
  border-color: #d1d5db !important;
}

body.light-theme textarea::placeholder,
body.light-theme input::placeholder {
  color: #6b7280 !important;
}

body.light-theme button {
  color: #111827;
}

body.light-theme .message.assistant,
body.light-theme .assistant-message {
  background: #ffffff !important;
  color: #111827 !important;
}

body.light-theme .message.user,
body.light-theme .user-message {
  background: #7c3aed !important;
  color: #ffffff !important;
}
body.light-theme .nexa-chat,
body.light-theme .nexa-main,
body.light-theme .chat-box {
  background: #f5f7fb !important;
  color: #111827 !important;
}

body.light-theme .welcome-screen {
  background: transparent !important;
  color: #111827 !important;
}

body.light-theme .welcome-screen h2,
body.light-theme .welcome-screen p {
  color: #111827 !important;
}

body.light-theme .quick-prompt {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #d1d5db !important;
}

body.light-theme .input-area,
body.light-theme .chat-input-container,
body.light-theme .message-input-container {
  background: #ffffff !important;
  border-color: #d1d5db !important;
}
body.light-theme .chat-box {
  background: #f5f7fb !important;
  background-image: none !important;
}

body.light-theme .chat-box::before,
body.light-theme .chat-box::after {
  background: none !important;
  background-image: none !important;
}
/* Conversations - Light Mode */
body.light-theme .nexa-page .conversation-item {
  background: #f3f4f6 !important;
  color: #111827 !important;
  border-color: #e5e7eb !important;
}

body.light-theme .nexa-page .conversation-time {
  color: #6b7280 !important;
}

/* Keep selected conversation purple */
body.light-theme .nexa-page .conversation-item.active {
  background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
  color: #ffffff !important;
  border-color: rgba(124, 92, 255, 0.45) !important;
}

body.light-theme .nexa-page .conversation-item.active .conversation-time {
  color: rgba(255, 255, 255, 0.75) !important;
}
body.light-theme .nexa-page .conversation-row {
  opacity: 1 !important;
}

body.light-theme .nexa-page .conversation-row .conversation-item,
body.light-theme .nexa-page .conversation-row .conversation-item * {
  color: #111827 !important;
  opacity: 1 !important;
}

body.light-theme .nexa-page .conversation-row .conversation-item {
  background: #f3f4f6 !important;
  border: 1px solid #e5e7eb !important;
}

body.light-theme .nexa-page .conversation-row .conversation-item.active,
body.light-theme .nexa-page .conversation-row .conversation-item.active * {
  color: #ffffff !important;
}

body.light-theme .nexa-page .conversation-row .conversation-item.active {
  background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
}

/* Fix conversations in Light Mode */
body.light-theme .conversation-item {
  background: #f3f4f6 !important;
  color: #111827 !important;
  border: 1px solid #e5e7eb !important;
}

body.light-theme .conversation-title {
  color: #111827 !important;
}

body.light-theme .conversation-preview,
body.light-theme .conversation-time,
body.light-theme .conversation-date {
  color: #6b7280 !important;
}

body.light-theme .conversation-item.active {
  background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
  color: #ffffff !important;
}

body.light-theme .conversation-item.active .conversation-title,
body.light-theme .conversation-item.active .conversation-preview,
body.light-theme .conversation-item.active .conversation-time,
body.light-theme .conversation-item.active .conversation-date {
  color: #ffffff !important;
}

/* Code blocks in light theme */

body.light-theme pre,
body.light-theme .code-block,
body.light-theme .message pre,
body.light-theme .assistant-message pre {
  background: #f1f5f9 !important;
  color: #111827 !important;
  border: 1px solid #d1d5db !important;
}

body.light-theme pre code,
body.light-theme .code-block code,
body.light-theme .message code {
  background: transparent !important;
  color: #111827 !important;
}

body.light-theme .code-header,
body.light-theme .code-block-header {
  background: #e5e7eb !important;
  color: #374151 !important;
  border-color: #d1d5db !important;
}

body.light-theme .copy-button,
body.light-theme .copy-code-button {
  background: #ffffff !important;
  color: #374151 !important;
  border: 1px solid #d1d5db !important;
}
body.light-theme .message.ai {
  background: #f3f4f6 !important;
  color: #111827 !important;
  border-color: #d1d5db !important;
}

body.light-theme .message.ai * {
  color: #111827 !important;
}

body.light-theme .message.ai pre,
body.light-theme .message.ai code {
  background: #e5e7eb !important;
  color: #111827 !important;
}
body.light-theme .chat-input {
  background: #ffffff !important;
  border-top: 1px solid #d1d5db !important;
}

body.light-theme #userInput {
  background: #f9fafb !important;
  color: #111827 !important;
  border: 1px solid #d1d5db !important;
}

body.light-theme #userInput::placeholder {
  color: #6b7280 !important;
}
@media (max-width: 768px) {
  .nexa-page .message.ai {
    width: 96% !important;
    max-width: 96% !important;
    box-sizing: border-box;
    align-self: center;
  }

  .nexa-page .message.user {
    max-width: 85% !important;
  }
}
/* Dashboard Statistics */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(138, 92, 246, 0.2);
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: 0.25s;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: #8a5cf6;
  box-shadow: 0 0 18px rgba(138, 92, 246, 0.25);
}

.stat-card h2 {
  font-size: 40px;
  color: #a970ff;
  margin-bottom: 10px;
}

.stat-card p {
  color: #bdbdbd;
  font-size: 15px;
}
/* Modern Dashboard Layout */

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(138, 92, 246, 0.15), transparent 35%),
    #0f1117;
  color: #ffffff;
}

.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.dashboard-layout .sidebar {
  width: 240px;
  padding: 28px 20px;
  background: rgba(17, 20, 29, 0.96);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-layout .logo {
  font-size: 24px;
  font-weight: 800;
  color: #a970ff;
  margin-bottom: 22px;
}

.dashboard-layout .sidebar a {
  color: #d8d8df;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 12px;
  transition: 0.2s;
}

.dashboard-layout .sidebar a:hover {
  color: #ffffff;
  background: rgba(138, 92, 246, 0.15);
}

.dashboard-main {
  flex: 1;
  padding: 28px;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
}

.search-box {
  flex: 1;
  max-width: 520px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  outline: none;
}

.search-box::placeholder {
  color: #8d909a;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #d6d6dc;
}

#logoutButton {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: rgba(138, 92, 246, 0.18);
  color: #ffffff;
  cursor: pointer;
}

.dashboard-main > h1 {
  margin: 0 0 8px;
  font-size: 32px;
}

.dashboard-main > p {
  margin: 0 0 28px;
  color: #9fa2ad;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.stats-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 4px;
}

.stat-card,
.dash-card {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.stat-card {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.stat-card h2 {
  margin: 0 0 8px;
  font-size: 38px;
  color: #a970ff;
}

.stat-card p {
  margin: 0;
  color: #9fa2ad;
}

.dash-card {
  color: #ffffff;
  text-decoration: none;
  transition: 0.22s;
}

.dash-card:hover {
  transform: translateY(-4px);
  border-color: rgba(169, 112, 255, 0.55);
}

.dash-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.dash-card p {
  margin: 0;
  color: #9fa2ad;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .dashboard-layout {
    display: block;
  }

  .dashboard-layout .sidebar {
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .dashboard-layout .logo {
    width: 100%;
    margin-bottom: 6px;
  }

  .dashboard-main {
    padding: 20px;
  }
html,
body {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.dashboard-layout {
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

.dashboard-main {
  overflow-x: hidden;
  overflow-y: visible;
}

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    max-width: none;
  }

  .user-box {
    justify-content: space-between;
  }

  .dashboard-cards,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
.stat-icon {
  font-size: 28px;
  margin-bottom: 14px;
}

.stat-card h2 {
  font-size: 46px;
  font-weight: 700;
  margin: 0 0 8px;
}

.stat-card p {
  margin: 0;
  color: #a8acb8;
  font-size: 14px;
}
/* Analytics Chart */

.analytics-chart {
  grid-column: 1 / -1;
  margin-top: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 24px;
  overflow: hidden;
}

.analytics-chart h3 {
  margin: 0 0 20px;
  font-size: 22px;
  color: #ffffff;
}

#activityChart {
  width: 100%;
  height: 220px !important;
  max-height: 220px;
}
.generated-image-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.generated-image {
  width: 100%;
  max-width: 560px;
  height: auto;
  display: block;
  border-radius: 16px;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 0 20px rgba(138, 92, 246, 0.25);
}

.generated-image:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 35px rgba(138, 92, 246, 0.4);
}

.generated-image:active {
  transform: scale(0.99);
}

@media (max-width: 768px) {
    .generated-image {
        max-width: 100%;
        border-radius: 12px;
    }
}
.generated-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.generated-image-prompt {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.generated-image-prompt-title {
  margin-bottom: 6px;
  color: #c8a8ff;
  font-size: 13px;
  font-weight: 700;
}

.generated-image-prompt-text {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.image-action-button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  padding: 9px 13px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s;
}

.image-action-button:hover {
  background: rgba(138, 92, 246, 0.2);
  border-color: rgba(169, 112, 255, 0.55);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .generated-image-actions {
    gap: 8px;
  }

  .image-action-button {
    flex: 1;
    min-width: 110px;
    text-align: center;
  }

  .generated-image-prompt {
    padding: 10px 12px;
}

.generated-image-prompt-text {
    font-size: 13px;
}
}
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 5, 10, 0.92);
  backdrop-filter: blur(8px);
}

.image-lightbox.show {
  display: flex;
}

.image-lightbox-image {
  max-width: min(1100px, 94vw);
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}

.image-lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.image-lightbox-close:hover {
  transform: scale(1.08);
  background: rgba(138, 92, 246, 0.55);
}

@media (max-width: 768px) {
  .image-lightbox {
    padding: 12px;
  }

  .image-lightbox-image {
    max-width: 96vw;
    max-height: 86vh;
    border-radius: 12px;
  }

  .image-lightbox-close {
    top: 12px;
    right: 12px;
  }
}
@media (max-width: 768px) {
  html,
  body {
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    position: static !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .dashboard-layout {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100svh !important;
    max-height: none !important;
    overflow: visible !important;
    position: relative !important;
  }

  .dashboard-layout .sidebar {
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    position: relative !important;
    overflow: visible !important;
  }

  .dashboard-main {
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    position: relative !important;
    padding: 18px !important;
    touch-action: pan-y !important;
  }
}
@media (max-width: 900px) {
  .dashboard-layout,
  .dashboard-main,
  .dashboard-cards,
  .stats-grid,
  .analytics-chart {
    touch-action: pan-y !important;
  }

  #activityChart,
  .analytics-chart canvas {
    touch-action: pan-y !important;
    pointer-events: none !important;
  }
}
.feedback-floating-btn{
position:fixed;
bottom: 170px;
right: 20px;
left: auto;
z-index:999;
padding:12px 20px;
border:none;
border-radius:14px;
background:#7c3aed;
color:#fff;
font-weight:600;
cursor:pointer;
box-shadow:0 0 20px rgba(124,58,237,.35);
transition:.25s;
}

.feedback-floating-btn:hover{
transform:translateY(-2px);
}

.feedback-modal{
position:fixed;
inset:0;
display:none;
justify-content:center;
align-items:center;
background:rgba(0,0,0,.65);
backdrop-filter:blur(6px);
z-index:1000;
}

.feedback-card{
width:430px;
max-width:92%;
background:#18181b;
border:1px solid rgba(255,255,255,.08);
border-radius:18px;
padding:24px;
position:relative;
}

.feedback-card h2{
margin:0 0 8px;
}

.feedback-card p{
margin-bottom:18px;
opacity:.75;
}

.feedback-card label{
display:block;
margin-top:14px;
margin-bottom:6px;
font-weight:600;
}

.feedback-card textarea,
.feedback-card select{
width:100%;
padding:12px;
background:#27272a;
border:1px solid rgba(255,255,255,.08);
color:white;
border-radius:10px;
}

.feedback-rating{
display:flex;
gap:8px;
margin-top:8px;
}

.feedback-rating button{
font-size:28px;
background:none;
border:none;
color:#666;
cursor:pointer;
}

.feedback-rating button.active{
color:#facc15;
}

.feedback-submit-btn{
width:100%;
margin-top:20px;
padding:13px;
background:#7c3aed;
color:white;
border:none;
border-radius:12px;
font-weight:700;
cursor:pointer;
}

.feedback-close-btn{
position:absolute;
top:12px;
right:14px;
background:none;
border:none;
font-size:28px;
color:white;
cursor:pointer;
}

@media (max-width: 768px) {
  .feedback-modal {
    z-index: 99999 !important;
  }

  .feedback-card {
    position: relative !important;
    z-index: 100000 !important;
    pointer-events: auto !important;
  }

  .feedback-submit-btn {
    position: relative !important;
    z-index: 100001 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
  }
}
/* ===== Feedback Form Polish ===== */

.feedback-form label,
.feedback-title,
.feedback-section h3 {
    color: #f5f5ff;
    font-weight: 600;
}

.feedback-form select,
.feedback-form textarea {
    background: #1d1d22;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.12);
}

.feedback-form select::placeholder,
.feedback-form textarea::placeholder {
    color: #9d9d9d;
}

.feedback-status {
  color: #d7b8ff !important;
  font-weight: 600;
  text-align: center;
  margin-top: 14px;
  min-height: 22px;
  text-shadow: 0 0 8px rgba(139, 92, 246, 0.25);
}

.star {
    color: #55586a;
    transition: .2s;
}

.star.active,
.star.selected {
    color: #FFC83D;
    text-shadow: 0 0 10px rgba(255,200,61,.45);
}

.star:hover {
    color: #FFD95E;
    transform: scale(1.08);
}
/* ===== Feedback Stars Final Style ===== */

.feedback-rating {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 24px;
}

.feedback-rating button {
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  border: none !important;
  padding: 4px !important;
  color: #74798d !important;
  font-size: 46px;
  line-height: 1;
  cursor: pointer;
  transition:
    color 0.2s ease,
    transform 0.2s ease,
    text-shadow 0.2s ease;
}

.feedback-rating button.active {
  color: #facc15 !important;
  transform: scale(1.06);
  text-shadow:
    0 0 8px rgba(250, 204, 21, 0.45),
    0 0 18px rgba(250, 204, 21, 0.22);
}

.feedback-rating button:hover {
  color: #fde047 !important;
  transform: scale(1.1);
}

.feedback-rating button:focus {
  outline: none;
}

.feedback-status {
  color: #d8b4fe !important;
  font-weight: 600;
  text-align: center;
  margin-top: 16px;
  min-height: 24px;
  font-size: 16px;
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}
#latestFeedback {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.latest-feedback-item {
  padding: 16px;
  border: 1px solid rgba(169, 112, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.latest-feedback-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.latest-feedback-stars {
  color: #facc15;
  font-size: 18px;
  letter-spacing: 2px;
}

.latest-feedback-date {
  color: #9ca3af;
  font-size: 12px;
}

.latest-feedback-message {
  color: #f5f5f5;
  margin: 0 0 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.latest-feedback-category {
  display: inline-block;
  color: #d8b4fe;
  background: rgba(169, 112, 255, 0.12);
  border: 1px solid rgba(169, 112, 255, 0.22);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  text-transform: capitalize;
}

@media (max-width: 768px) {
  .latest-feedback-top {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 760px) {
  #mobileMenuButton {
    position: fixed !important;
    top: 16px !important;
    left: 16px !important;
    z-index: 99999 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
  }
}
/* =========================================================
   NEXORA CREDIT BALANCE
========================================================= */

.credit-balance-card {
  width: 100%;
  margin: 14px 0;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #ffffff;
  text-align: left;
  background:
    linear-gradient(
      135deg,
      rgba(124, 58, 237, 0.3),
      rgba(91, 60, 196, 0.14)
    );
  border: 1px solid rgba(167, 139, 250, 0.32);
  border-radius: 14px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.credit-balance-card:hover {
  transform: translateY(-1px);
  border-color: rgba(167, 139, 250, 0.65);
  background:
    linear-gradient(
      135deg,
      rgba(124, 58, 237, 0.4),
      rgba(91, 60, 196, 0.2)
    );
}

.credit-balance-icon {
  width: 37px;
  height: 37px;
  flex: 0 0 37px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  font-size: 19px;
}

.credit-balance-content {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.credit-balance-label {
  overflow: hidden;
  color: #c7bddf;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.credit-balance-value {
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
}

.credit-balance-store-text {
  padding: 5px 8px;
  color: #ddd6fe;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}

html[dir="rtl"] .credit-balance-card {
  text-align: right;
}

@media (max-width: 768px) {
  .credit-balance-card {
    margin: 12px 0;
    padding: 11px 12px;
  }
}