:root {
  --bg-primary: #17212b;
  --bg-secondary: #0e1621;
  --bg-chat: #0e1621;
  --bg-message-out: #2b5278;
  --bg-message-in: #182533;
  --bg-hover: #202b36;
  --bg-active: #2b5278;
  --bg-input: #242f3d;
  --text-primary: #f5f5f5;
  --text-secondary: #708499;
  --text-link: #6ab2f2;
  --accent: #5288c1;
  --accent-hover: #6ba0d6;
  --border: #101921;
  --online: #4dcd5e;
  --danger: #e53935;
  --scrollbar: #3a4654;
  --scrollbar-hover: #4a5664;
  --hint: #708499;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

/* ===== AUTH SCREEN ===== */

.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg-secondary);
}

.auth-container {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 40px;
  width: 360px;
  text-align: center;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.auth-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #3a7bd5);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.auth-logo svg {
  color: white;
}

.auth-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 2px solid transparent;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.auth-input:focus {
  border-color: var(--accent);
}

.auth-input::placeholder {
  color: var(--hint);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}

.auth-btn:hover {
  background: var(--accent-hover);
}

.auth-toggle {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.auth-toggle a {
  color: var(--text-link);
  cursor: pointer;
  text-decoration: none;
  margin-left: 4px;
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 20px;
}

/* ===== MAIN LAYOUT ===== */

.app {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 320px;
  min-width: 320px;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

.sidebar-header {
  display: flex;
  align-items: center;
  padding: 8px 8px 8px 4px;
  height: 56px;
  gap: 4px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--hint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.15s;
}

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

.icon-btn svg {
  width: 24px;
  height: 24px;
}

.search-box {
  flex: 1;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  background: var(--bg-input);
  border: 2px solid transparent;
  border-radius: 22px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--accent);
}

.search-box input::placeholder {
  color: var(--hint);
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hint);
  pointer-events: none;
}

.search-box .search-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 0;
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
}

.conversation-item {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  cursor: pointer;
  gap: 10px;
  transition: background 0.15s;
}

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

.conversation-item.active {
  background: var(--bg-active);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: white;
}

.online-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 14px;
  height: 14px;
  background: var(--online);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

.conversation-info {
  flex: 1;
  min-width: 0;
}

.conversation-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}

.conversation-name {
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-time {
  font-size: 12px;
  color: var(--hint);
  flex-shrink: 0;
  margin-left: 8px;
}

.conversation-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.conversation-preview {
  font-size: 14px;
  color: var(--hint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.unread-badge {
  background: var(--accent);
  color: white;
  border-radius: 12px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
  margin-left: 8px;
}

.group-icon-small {
  display: inline-flex;
  margin-right: 4px;
  color: var(--hint);
  vertical-align: middle;
}

/* ===== CHAT AREA ===== */

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-chat);
  position: relative;
}

.no-chat {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--hint);
}

.no-chat svg { margin-bottom: 16px; opacity: 0.3; }
.no-chat p { font-size: 15px; }

.chat-header {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  height: 56px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.chat-header .avatar { width: 42px; height: 42px; }

.chat-header-info {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.chat-header-name {
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-status {
  font-size: 13px;
  color: var(--hint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-status.online { color: var(--online); }

.chat-actions {
  display: flex;
  gap: 2px;
}

.chat-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--hint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.15s;
}

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

.chat-action-btn svg {
  width: 22px;
  height: 22px;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}

.messages-list {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 65%;
  margin-bottom: 1px;
}

.message.out {
  align-self: flex-end;
}

.message.in {
  align-self: flex-start;
}

.message-bubble {
  padding: 7px 11px 6px;
  border-radius: 12px;
  font-size: 14.5px;
  line-height: 1.35;
  word-wrap: break-word;
  position: relative;
}

.message.out .message-bubble {
  background: var(--bg-message-out);
  border-bottom-right-radius: 4px;
}

.message.in .message-bubble {
  background: var(--bg-message-in);
  border-bottom-left-radius: 4px;
}

.message-sender {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-link);
}

.message-text {
  white-space: pre-wrap;
}

.message-meta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  float: right;
  margin: 4px 0 -4px 8px;
  position: relative;
  top: 4px;
}

.message-time {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  line-height: 1;
}

.message-check {
  color: rgba(255,255,255,0.45);
  display: inline-flex;
}

.message-check.read {
  color: #6fc;
}

.message-check svg {
  width: 16px;
  height: 16px;
}

.message-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.message-file:hover {
  background: rgba(0,0,0,0.25);
}

.message-file-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}

.message-file-icon svg {
  width: 20px;
  height: 20px;
}

.message-file-info { min-width: 0; }

.message-file-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-file-size {
  font-size: 12px;
  color: var(--hint);
}

.message-image {
  max-width: 300px;
  max-height: 300px;
  border-radius: 8px;
  cursor: pointer;
  display: block;
}

.typing-indicator {
  padding: 4px 16px;
  font-size: 13px;
  color: var(--text-link);
  height: 24px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

/* ===== INPUT AREA ===== */

.input-area {
  padding: 6px 10px 10px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
}

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  max-width: 720px;
  margin: 0 auto;
}

.input-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--hint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s, background 0.2s;
}

.input-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.input-btn svg {
  width: 22px;
  height: 22px;
}

.message-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: none;
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 14.5px;
  outline: none;
  max-height: 150px;
  resize: none;
  line-height: 1.4;
  font-family: inherit;
}

.message-input::placeholder {
  color: var(--hint);
}

.send-btn {
  background: var(--accent) !important;
  color: white !important;
  border-radius: 50% !important;
  transition: background 0.2s, transform 0.1s !important;
}

.send-btn:hover {
  background: var(--accent-hover) !important;
}

.send-btn:active {
  transform: scale(0.93);
}

/* ===== ATTACHMENT PREVIEW ===== */

.attachment-preview {
  display: none;
  padding: 8px 12px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
}

.attachment-preview.active {
  display: block;
}

.attachment-preview-inner {
  position: relative;
  display: inline-block;
  max-width: 220px;
  background: var(--bg-input);
  border-radius: 12px;
  padding: 6px;
  margin: 0 auto;
}

.attachment-preview-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.attachment-preview-close svg {
  width: 14px;
  height: 14px;
}

.attachment-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  display: block;
}

.attachment-preview-name {
  font-size: 12px;
  color: var(--hint);
  margin-top: 4px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== EMOJI PICKER ===== */

.emoji-picker {
  display: none;
  background: var(--bg-input);
  border-radius: 12px;
  padding: 8px;
  margin-top: 6px;
  max-height: 250px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}

.emoji-picker.active {
  display: block;
}

.emoji-picker-category {
  font-size: 12px;
  color: var(--hint);
  padding: 4px 4px 2px;
  margin-top: 4px;
}

.emoji-picker-category:first-child {
  margin-top: 0;
}

.emoji-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.emoji-item {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
  border: none;
  background: none;
  transition: background 0.15s;
}

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

/* ===== IMAGE WITH CAPTION ===== */

.message-image-caption {
  display: flex;
  flex-direction: column;
}

.message-image-caption .message-image {
  margin-bottom: 4px;
}

.message-image-caption .message-caption {
  font-size: 14.5px;
  line-height: 1.4;
  word-wrap: break-word;
}

/* ===== SIDE PANEL ===== */

.side-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 100vh;
  background: var(--bg-primary);
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.side-panel.open {
  transform: translateX(0);
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.panel-header {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 8px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.panel-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.panel-back:hover {
  background: var(--bg-hover);
}

.panel-back svg {
  width: 22px;
  height: 22px;
}

.panel-title {
  font-size: 17px;
  font-weight: 600;
  flex: 1;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* ===== PROFILE VIEW ===== */

.profile-section {
  text-align: center;
  padding-bottom: 20px;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 16px;
  position: relative;
  cursor: pointer;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--bg-primary);
  cursor: pointer;
  color: white;
}

.profile-avatar-edit svg {
  width: 18px;
  height: 18px;
}

.profile-name {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-status {
  font-size: 14px;
  color: var(--text-link);
  margin-bottom: 4px;
}

.profile-username {
  font-size: 14px;
  color: var(--hint);
}

.profile-bio {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.profile-field {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.profile-field-label {
  font-size: 12px;
  color: var(--text-link);
  margin-bottom: 4px;
}

.profile-field-value {
  font-size: 15px;
}

.profile-edit-field {
  margin-bottom: 16px;
}

.profile-edit-field label {
  display: block;
  font-size: 13px;
  color: var(--text-link);
  margin-bottom: 6px;
}

.profile-edit-field input,
.profile-edit-field textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg-input);
  border: 2px solid transparent;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.profile-edit-field input:focus,
.profile-edit-field textarea:focus {
  border-color: var(--accent);
}

.profile-edit-field textarea {
  min-height: 80px;
  resize: vertical;
}

.save-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}

.save-btn:hover {
  background: var(--accent-hover);
}

/* ===== MENU ===== */

.menu-items {
  padding: 4px 0;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  gap: 16px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 15px;
  border-radius: 8px;
}

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

.menu-item-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hint);
}

.menu-item-icon svg {
  width: 22px;
  height: 22px;
}

.menu-item-danger { color: var(--danger); }
.menu-item-danger .menu-item-icon { color: var(--danger); }

.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 16px;
}

/* ===== MODAL ===== */

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 24px;
  width: 380px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.modal-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 2px solid transparent;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  margin-bottom: 12px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.modal-input:focus {
  border-color: var(--accent);
}

.modal-input::placeholder {
  color: var(--hint);
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.modal-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-cancel {
  background: var(--bg-input);
  color: var(--text-primary);
}

.btn-cancel:hover {
  background: var(--bg-hover);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* ===== GIFT GRID ===== */

.gift-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.gift-item {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--bg-input);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  gap: 2px;
  padding: 6px;
}

.gift-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.gift-item.selected {
  border-color: var(--accent);
  background: rgba(82, 136, 193, 0.2);
}

.gift-item-icon {
  width: 32px;
  height: 32px;
  color: var(--text-primary);
}

.gift-item-icon svg {
  width: 100%;
  height: 100%;
}

.gift-item-name {
  font-size: 10px;
  color: var(--hint);
  text-align: center;
}

.gift-message-input {
  width: 100%;
  padding: 10px;
  background: var(--bg-input);
  border: none;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  margin-bottom: 12px;
  font-family: inherit;
}

.btn-send-gift {
  background: var(--accent);
  color: white;
}

.btn-send-gift:hover {
  background: var(--accent-hover);
}

/* ===== GIFT NOTIFICATION ===== */

.gift-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 300;
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  animation: giftPop 0.4s ease forwards;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

@keyframes giftPop {
  0% { transform: translate(-50%, -50%) scale(0); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.gift-notification .gift-icon-big {
  margin-bottom: 12px;
}

.gift-notification .gift-icon-big svg {
  width: 72px;
  height: 72px;
}

.gift-notification .gift-from {
  font-size: 16px;
  color: var(--hint);
  margin-bottom: 4px;
}

.gift-notification .gift-name-big {
  font-size: 18px;
  font-weight: 600;
  margin: 4px 0;
}

.gift-notification .gift-msg {
  font-size: 14px;
  color: var(--text-primary);
}

/* ===== CALL SCREEN ===== */

.call-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(14, 22, 33, 0.97);
  z-index: 250;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.call-screen.active {
  display: flex;
}

.call-avatar-wrap {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin-bottom: 20px;
  overflow: hidden;
}

.call-name {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.call-status {
  font-size: 16px;
  color: var(--hint);
  margin-bottom: 40px;
}

.call-actions {
  display: flex;
  gap: 24px;
}

.call-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
  color: white;
}

.call-btn:hover { transform: scale(1.1); }

.call-btn svg {
  width: 28px;
  height: 28px;
}

.call-btn-accept { background: var(--online); }
.call-btn-decline { background: var(--danger); }
.call-btn-mute { background: var(--bg-input); color: var(--text-primary); }
.call-btn-mute.active { background: var(--danger); color: white; }

/* ===== GROUP CALL MEMBERS ===== */

.group-call-members {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  padding: 0 20px;
}

.gcall-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.gcall-member-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent);
}

.gcall-member-self .gcall-member-avatar {
  border-color: var(--online);
}

.gcall-member-name {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* ===== GIFT IN CHAT ===== */

.message-gift-card {
  text-align: center;
  padding: 8px 4px 4px;
  min-width: 160px;
}

.message-gift-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 6px;
  color: var(--accent);
}

.message-gift-icon svg {
  width: 48px;
  height: 48px;
}

.message-gift-text {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 2px;
}

.message-gift-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}

.message-gift-msg {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-style: italic;
}

/* ===== GIFT SHOWCASE IN PROFILE ===== */

.profile-gifts-showcase {
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-input);
  border-radius: 12px;
}

.gift-showcase-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gift-showcase-item {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border-radius: 10px;
  color: var(--accent);
}

.gift-showcase-item svg {
  width: 28px;
  height: 28px;
}

.gift-showcase-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ===== USERS LIST ===== */

.users-list {
  padding: 4px 0;
}

.user-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 8px;
}

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

.user-item-info { flex: 1; min-width: 0; }

.user-item-name {
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-item-status {
  font-size: 13px;
  color: var(--hint);
}

.role-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 4px;
}

.role-admin { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.role-team { background: rgba(82, 136, 193, 0.2); color: var(--text-link); }

/* ===== GIFTS RECEIVED LIST ===== */

.gifts-list {
  padding: 4px 0;
}

.gift-received-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
}

.gift-received-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gift-received-icon svg {
  width: 36px;
  height: 36px;
}

.gift-received-info { flex: 1; min-width: 0; }

.gift-received-from {
  font-size: 14px;
  font-weight: 500;
}

.gift-received-msg {
  font-size: 13px;
  color: var(--hint);
}

.gift-received-time {
  font-size: 12px;
  color: var(--hint);
  flex-shrink: 0;
}

/* ===== DATE SEPARATOR ===== */

.date-separator {
  text-align: center;
  margin: 12px 0;
}

.date-separator span {
  background: rgba(0,0,0,0.3);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--hint);
}

/* ===== MEMBER SELECT ===== */

.member-select-list {
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.member-select-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  gap: 10px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.member-select-item:hover {
  opacity: 0.8;
}

.member-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--hint);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.member-select-item.selected .member-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.member-checkbox svg {
  width: 14px;
  height: 14px;
  color: white;
  opacity: 0;
}

.member-select-item.selected .member-checkbox svg {
  opacity: 1;
}

/* ===== INVITE LINK ===== */

.invite-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 12px 0;
}

.invite-link-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-link);
  word-break: break-all;
  user-select: all;
}

.invite-link-copy {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.invite-link-copy:hover {
  background: var(--accent-hover);
}

/* ===== USER DELETE BTN ===== */

.user-delete-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}

.user-delete-btn:hover {
  background: rgba(229, 57, 53, 0.1);
}

.user-delete-btn svg {
  width: 18px;
  height: 18px;
}

.user-item:hover .user-delete-btn {
  opacity: 1;
}

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

/* Image viewer */
.image-viewer {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.92);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.image-viewer.active {
  display: flex;
}

.image-viewer img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

/* Group info panel */
.group-info-header {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.group-info-members-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-link);
  margin-bottom: 8px;
  padding: 0 4px;
}

/* ===== FAB (Floating Action Button) ===== */

.fab {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: background 0.2s, transform 0.15s;
  z-index: 5;
}

.fab:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.fab svg {
  width: 26px;
  height: 26px;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    min-width: 100%;
    position: absolute;
    z-index: 10;
  }

  .chat-area {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 11;
    display: none;
  }

  .chat-area.mobile-active {
    display: flex;
  }

  .chat-back-btn {
    display: flex !important;
  }

  .side-panel {
    width: 100%;
  }

  .modal {
    width: calc(100% - 32px);
    max-width: 380px;
  }
}

.chat-back-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-back-btn:hover {
  background: var(--bg-hover);
}

.chat-back-btn svg {
  width: 22px;
  height: 22px;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 400;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: transform 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Online status dot for group header */
.members-count {
  font-size: 13px;
  color: var(--hint);
}
