:root {
  --deep-bg: #030712;
  --bg-main: #06111f;
  --bg-panel: rgba(255, 255, 255, 0.03);
  --bg-panel-strong: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-main: #f8fafc;
  --text-muted: #8ea3b8;
  --neon-blue: #0ea5e9;
  --neon-purple: #8b5cf6;
  --msg-sent: linear-gradient(135deg, rgba(14,165,233,0.95), rgba(59,130,246,0.90));
  --msg-received: rgba(255,255,255,0.07);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.30);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "Montserrat", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(14,165,233,0.16), transparent 30%),
    radial-gradient(circle at bottom right, rgba(139,92,246,0.14), transparent 32%),
    linear-gradient(180deg, #030712 0%, #06111f 100%);
  color: var(--text-main);
  overflow: hidden;
}

body {
  min-height: 100vh;
}

.app-container {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  height: 100vh;
  width: 100vw;
}

.logo-link {
  display: inline-flex;
  align-items: center;
}

.logo {
  width: 80px;
  height: auto;
  filter: drop-shadow(0 0 12px rgba(14,165,233,0.35));
}

.sidebar {
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
}

.sidebar-header {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.user-profile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
}

.user-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

#current-user-name {
  color: var(--text-main);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
}

.chat-list {
  padding: 14px;
  overflow-y: auto;
}

.chat-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 20px;
  cursor: pointer;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: .2s ease;
}

.chat-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}

.chat-item.active {
  background: rgba(14,165,233,0.10);
  border-color: rgba(14,165,233,0.24);
  box-shadow: inset 0 0 0 1px rgba(14,165,233,0.08);
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.chat-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-name {
  font-weight: 800;
  font-size: 17px;
  color: var(--text-main);
}

.chat-info div {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    radial-gradient(circle at top right, rgba(14,165,233,0.08), transparent 28%),
    linear-gradient(180deg, rgba(3,10,22,1) 0%, rgba(2,7,18,1) 100%);
}

.chat-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(12px);
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chat-header-title h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

#user-count {
  display: inline-block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  max-width: min(72%, 620px);
  display: flex;
  flex-direction: column;
}

.message.sent {
  align-self: flex-end;
}

.message.received {
  align-self: flex-start;
}

.author {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
  padding: 0 4px;
}

.msg-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.message.sent .msg-wrapper {
  flex-direction: row-reverse;
}

.mini-avatar {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(14,165,233,0.85), rgba(139,92,246,0.85));
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.msg-content {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 6px 18px rgba(0,0,0,0.16);
  word-break: break-word;
}

.message.sent .msg-content {
  background: var(--msg-sent);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.message.received .msg-content {
  background: var(--msg-received);
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom-left-radius: 6px;
}

#chat-form {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(10px);
}

.file-upload-label {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  cursor: pointer;
  transition: .2s ease;
  flex-shrink: 0;
}

.file-upload-label:hover {
  color: var(--neon-blue);
  background: rgba(14,165,233,0.10);
}

#chat-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 12px 4px;
  outline: none;
  font-size: 15px;
}

#chat-input::placeholder {
  color: var(--text-muted);
}

#send-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--neon-blue), #2563eb);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .2s ease;
  flex-shrink: 0;
  box-shadow: 0 10px 24px rgba(14,165,233,0.24);
}

#send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(14,165,233,0.28);
}

.search-bar,
.search-inner,
#search-input,
.chat-sep,
#pm-chat-list {
  display: none;
}

.mobile-menu-btn {
  display: none;
}

@media (max-width: 768px) {
  .app-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .chat-header {
    padding: 14px 16px;
  }

  .chat-header-title h3 {
    font-size: 18px;
  }

  .messages-area {
    padding: 14px 12px;
  }

  .message {
    max-width: 88%;
  }

  .msg-content {
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 16px;
  }

  #chat-form {
    padding: 10px 12px 12px;
  }

  .chat-input-area {
    gap: 8px;
    padding: 8px;
    border-radius: 16px;
  }

  .file-upload-label,
  #send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  #chat-input {
    font-size: 16px;
    padding: 10px 4px;
  }
}




#chat-form {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#chat-input {
  display: block !important;
}

.chat-input-area {
  display: flex !important;
}


html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.app-container {
  height: 100vh;
}

.main-chat {
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.messages-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

#chat-form {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 5;
}