/* --- CSS Variables & Design System --- */
:root {
  --bg-primary: #0f111a;
  --bg-secondary: #161824;
  --bg-tertiary: #1e2235;
  --bg-card: #23273e;
  --bg-hover: #2b304d;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --accent-hover: #4f46e5;
  
  --status-online: #10b981;
  --status-idle: #f59e0b;
  --status-urgent: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);

  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Helper Utilities */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- LOGIN SCREEN --- */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 40%),
              radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.12), transparent 40%),
              var(--bg-primary);
}

.login-card {
  width: 100%;
  max-width: 460px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  margin-bottom: 16px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--status-online);
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.logo-area {
  margin-bottom: 24px;
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.logo-area h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.logo-area .tagline {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-alert {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 18px;
}

.connection-alert {
  background-color: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  margin-bottom: 18px;
  line-height: 1.4;
}

.form-group {
  margin-bottom: 18px;
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.flex-1 {
  flex: 1;
}

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.label-hint {
  font-size: 0.75rem;
  color: #818cf8;
  font-weight: normal;
  margin-left: 4px;
}

.label-hint code {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  color: #c7d2fe;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 11px 14px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.92rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.toggle-pass-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
}

.toggle-pass-btn:hover {
  opacity: 1;
}

.avatar-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.avatar-option {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.avatar-option:hover {
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.avatar-option.selected {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.25);
  box-shadow: 0 0 0 2px var(--accent-primary);
}

.btn-primary {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  margin-top: 8px;
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.quick-presets {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.preset-title {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.preset-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.chip:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: rgba(99, 102, 241, 0.4);
}

.login-footer {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* --- MAIN CHAT LAYOUT --- */
.chat-wrapper {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-primary);
}

.mobile-header {
  display: none;
}

/* SIDEBAR */
.sidebar {
  width: 280px;
  min-width: 280px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
}

.team-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-logo {
  width: 38px;
  height: 38px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.team-info h2 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
}

.team-status-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-indicator-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--status-online);
}

.sidebar-section {
  padding: 16px 14px 6px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 0 8px 8px;
}

.badge {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
}

.channel-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.channel-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}

.channel-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-main);
}

.channel-btn.active {
  background-color: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  font-weight: 600;
}

.channel-hash {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dim);
}

.channel-btn.active .channel-hash {
  color: var(--accent-primary);
}

.unread-pill {
  margin-left: auto;
  background-color: var(--accent-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.team-roster-section {
  flex: 1;
  overflow-y: auto;
}

.users-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  transition: background 0.15s;
}

.user-item:hover {
  background-color: var(--bg-hover);
}

.avatar-circle-sm {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  position: relative;
  flex-shrink: 0;
}

.online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--status-online);
  border: 1.5px solid var(--bg-secondary);
}

.user-info-sm {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name-line {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.user-role-badge {
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* User Card Footer */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
  background: rgba(0,0,0,0.15);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  border: 1px solid var(--border-color);
}

.user-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.edit-name-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.edit-name-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-main);
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.connection-pill .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--status-online);
  animation: pulse 2s infinite;
}

.logout-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.logout-btn:hover {
  background-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* MAIN CHAT AREA */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--bg-primary);
  overflow: hidden;
}

.chat-header {
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-secondary);
}

.active-channel-meta {
  display: flex;
  flex-direction: column;
}

.channel-heading {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hash-symbol {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.channel-heading h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.channel-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  color: var(--text-dim);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.82rem;
  font-family: inherit;
  width: 140px;
}

.action-icon-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.action-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

/* MESSAGES LIST */
.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-messages-container::-webkit-scrollbar {
  width: 6px;
}

.chat-messages-container::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages-container::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

/* Message Item */
.message-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: fadeIn 0.15s ease-out;
}

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

.message-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.message-body {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.sender-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.role-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.message-time {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.message-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 2px 14px 14px 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-main);
  word-break: break-word;
}

.message-row.is-me .message-content {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.35);
}

/* System Message */
.message-row.system-msg {
  align-self: center;
  justify-content: center;
  width: 100%;
  margin: 6px 0;
}

.system-msg-inner {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

/* Attached Image in Message */
.message-image-wrapper {
  margin-top: 8px;
}

.message-image {
  max-width: 320px;
  max-height: 240px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.2s;
  display: block;
}

.message-image:hover {
  transform: scale(1.02);
}

/* Reactions */
.reactions-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.reaction-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.76rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.reaction-chip:hover {
  border-color: var(--accent-primary);
  background: var(--bg-hover);
}

.add-reaction-btn {
  background: transparent;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
  padding: 2px 4px;
}

.message-row:hover .add-reaction-btn {
  opacity: 1;
}

/* Quick Reaction Selector Popup on message */
.reaction-quick-menu {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-full);
  padding: 4px 8px;
  display: flex;
  gap: 4px;
  z-index: 10;
}

.reaction-quick-menu button {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 4px;
  transition: transform 0.1s;
}

.reaction-quick-menu button:hover {
  transform: scale(1.25);
}

/* TYPING INDICATOR */
.typing-indicator {
  padding: 6px 24px;
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dots-animation {
  display: inline-flex;
  gap: 3px;
}

.dots-animation span {
  width: 4px;
  height: 4px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}

.dots-animation span:nth-child(2) { animation-delay: 0.2s; }
.dots-animation span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-4px); }
}

/* ATTACHMENT PREVIEW */
.attachment-preview-bar {
  padding: 8px 24px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-item {
  position: relative;
  display: inline-block;
}

.preview-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.preview-item button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--status-urgent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* CHAT INPUT AREA */
.chat-input-wrapper {
  padding: 12px 24px 18px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

#chat-form {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  transition: border-color 0.2s;
}

#chat-form:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.input-controls-left {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-bottom: 6px;
}

.icon-tool-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.15s;
}

.icon-tool-btn:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.emoji-dropdown-wrapper {
  position: relative;
}

.quick-emoji-palette {
  position: absolute;
  bottom: 45px;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  z-index: 20;
}

.quick-emoji-palette button {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  padding: 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.quick-emoji-palette button:hover {
  background: var(--bg-hover);
}

#message-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.4;
  max-height: 140px;
  padding: 6px 4px;
}

#message-input::placeholder {
  color: var(--text-dim);
}

.send-btn {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, transform 0.1s;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.send-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.send-btn:active {
  transform: translateY(0);
}

.input-helper-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 6px;
  padding-left: 4px;
}

/* IMAGE MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.modal-box {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.modal-box img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

.modal-close-btn {
  position: absolute;
  top: -40px;
  right: 0;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 16px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
  }

  .sidebar {
    position: fixed;
    top: 56px;
    left: -280px;
    bottom: 0;
    z-index: 50;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    left: 0;
  }

  .chat-wrapper {
    flex-direction: column;
  }

  .chat-main {
    height: calc(100vh - 56px);
  }

  .chat-header {
    padding: 0 16px;
    height: 52px;
  }

  .search-box {
    display: none;
  }

  .chat-messages-container {
    padding: 14px 16px;
  }

  .chat-input-wrapper {
    padding: 10px 16px;
  }

  .users-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 60;
    display: flex;
    justify-content: flex-end;
  }

  .users-overlay-content {
    width: 260px;
    background: var(--bg-secondary);
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
  }

  .users-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
  }

  .users-list-mobile {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
}
