/**
 * Liquid Chat - Main Styles
 */

@import url('liquid-glass.css');

.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
  flex-shrink: 0;
}

.icon-lg {
  width: 28px;
  height: 28px;
}

.icon-xl {
  width: 60px;
  height: 60px;
}

/* Main Layout Styles */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: -10px;
}

.col {
  flex: 1;
  padding: 10px;
}

.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-form {
  width: 100%;
  max-width: 420px;
}

body.chat-page {
  overflow: hidden;
}

body.chat-page .chat-container {
  height: calc(100dvh - 36px);
  max-height: calc(100dvh - 36px);
}

body.chat-page .chat-main {
  overflow: hidden;
  min-height: 0;
}

body.settings-page .auth-container {
  justify-content: flex-start;
  align-items: stretch;
  padding-top: 40px;
  min-height: calc(100dvh - 80px);
}

body.settings-page .auth-form {
  max-width: min(960px, 100%);
  width: 100%;
}

body.settings-page .form-title {
  text-align: left;
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo img {
  width: 80px;
  height: 80px;
}

/* Header & Navigation */
.app-header {
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 1100;
}

.app-logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.app-logo img {
  width: 36px;
  height: 36px;
  margin-right: 10px;
}

.app-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 20px;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--primary-color);
}

.user-menu {
  position: relative;
}

.user-menu-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.user-menu-toggle:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.user-menu-toggle img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 0;
}

.user-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 220px;
  max-width: min(260px, 90vw);
  background-color: var(--glass-bg);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  padding: 15px;
  display: none;
  z-index: 100;
  border: var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
}

.user-menu-dropdown.active {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 10px;
  transition: background-color 0.2s ease;
  min-height: 40px;
  gap: 10px;
}

.dropdown-item:hover {
  background-color: rgba(16, 185, 129, 0.2);
}

.dropdown-item:focus-visible {
  outline: 2px solid rgba(76, 194, 255, 0.35);
  outline-offset: 2px;
  background-color: rgba(76, 194, 255, 0.15);
}

.dropdown-item i,
.dropdown-item .icon {
  width: 20px;
  height: 20px;
  color: var(--primary-color);
}

/* Auth Forms */
.form-title {
  text-align: center;
  margin-bottom: 30px;
  color: var(--text-color);
}

.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
}

.form-footer a {
  color: var(--primary-color);
  text-decoration: none;
}

.form-error {
  background-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.form-success {
  background-color: rgba(22, 163, 74, 0.2);
  color: #4ade80;
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

/* Profile Page */
.profile-section {
  margin-bottom: 40px;
}

.profile-header {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  gap: 18px;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 24px;
  position: relative;
}

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

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

.profile-info h1 {
  font-size: 1.8rem;
  margin-bottom: 5px;
}

.profile-username {
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 10px;
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
}

.tab {
  flex: 1 1 auto;
  padding: 8px 16px;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  opacity: 0.7;
  text-align: center;
}

.tab:hover {
  opacity: 0.9;
}

.tab.active {
  background: linear-gradient(135deg, rgba(57, 214, 164, 0.95), rgba(116, 242, 197, 0.85));
  color: #0b1224;
  opacity: 1;
  box-shadow: 0 10px 22px rgba(31, 166, 127, 0.25);
}

.tab-content {
  display: none;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 18px;
  padding: 20px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
}

.tab-content.active {
    display: block;
  }

  .chat-sidebar .tabs-row {
    gap: 8px;
    align-items: center;
  }

  .chat-sidebar .tabs-row .tab {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(120, 190, 255, 0.18);
    font-size: 0.9rem;
    letter-spacing: 0.2px;
  }

  .chat-sidebar .tabs-row .tab.active {
    background: linear-gradient(135deg, rgba(57, 214, 164, 0.95), rgba(116, 242, 197, 0.85));
    color: #0b1224;
    opacity: 1;
    box-shadow: 0 10px 22px rgba(31, 166, 127, 0.25);
  }

  .chat-sidebar .tabs-row .tab:hover {
    opacity: 1;
  }

  .chat-sidebar .tab-content {
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    backdrop-filter: none;
  }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 6px;
}

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

.badge-secondary {
  background-color: #e2e8f0;
  color: #64748b;
}

/* Utilities */
.text-center {
  text-align: center;
}

.mt-10 {
  margin-top: 10px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-20 {
  margin-bottom: 20px;
}

.py-10 {
  padding-top: 10px;
  padding-bottom: 10px;
}

.d-block {
  display: block;
}

.d-flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.w-100 {
  width: 100%;
}

.opacity-50 {
  opacity: 0.5;
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(16, 185, 129, 0.1);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-dark);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Emoji Panel */
.emoji-panel {
  position: absolute;
  bottom: 100%;
  left: 0;
  background-color: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 320px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  margin-bottom: 10px;
}

.emoji-item {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 4px;
}

.emoji-item:hover {
  background-color: rgba(16, 185, 129, 0.2);
}

/* Recording indicator */
.recording-indicator {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(255, 59, 48, 0.8);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
}

.recording-indicator .pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: white;
  display: inline-block;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.8);
    opacity: 0.8;
  }
}

.btn.recording {
  color: var(--danger-color);
  animation: pulse 1.5s infinite;
}

/* Chat dropdown menu */
.new-chat {
  position: relative;
}

.chat-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 180px;
  background-color: var(--glass-bg);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  z-index: 1100;
  display: none;
  border: var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
}

.chat-dropdown.active {
  display: block;
}

/* Context menu */
.context-menu {
  position: fixed;
  background-color: var(--glass-bg);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  padding: 10px;
  z-index: 1150;
  display: none;
  min-width: 200px;
  max-width: min(260px, 92vw);
  border: var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 10px;
  color: var(--text-color);
  font-size: 0.9rem;
  gap: 10px;
  min-height: 40px;
}

.menu-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.menu-item:active {
  background-color: rgba(57, 214, 164, 0.2);
}

.menu-item:focus-visible {
  outline: 2px solid rgba(76, 194, 255, 0.35);
  outline-offset: 2px;
}

.menu-item .menu-text {
  flex: 1;
}

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

/* Quick reactions in context menu */
.menu-reactions {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: min(320px, 90vw);
}

.menu-reaction {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.menu-reaction:hover {
  transform: translateY(-1px);
  background: rgba(59, 130, 246, 0.22);
}

/* Reaction picker */
.reaction-picker {
  position: fixed;
  background-color: var(--glass-bg);
  border-radius: 30px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  padding: 10px;
  z-index: 1100;
  display: none;
  flex-wrap: nowrap;
  gap: 8px;
  max-width: min(320px, 90vw);
  border: var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  overflow-x: auto;
}

.reaction-item {
  font-size: 22px;
  padding: 5px;
  cursor: pointer;
  transition: transform 0.2s;
}

.reaction-item:hover {
  transform: scale(1.2);
}

/* Message reactions */
.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.reaction {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 2px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.reaction:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.reaction.mine {
  background-color: rgba(59, 130, 246, 0.35);
  color: #cfe7ff;
}

.reaction.mine:hover {
  background-color: rgba(59, 130, 246, 0.5);
}

.reaction-emoji {
  font-size: 14px;
}

.reaction-count {
  font-size: 12px;
  opacity: 0.8;
}

/* Hover quick reaction bar */
.reaction-quick-bar {
  position: fixed;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 8px;
  display: none;
  gap: 6px;
  z-index: 1100;
  backdrop-filter: blur(10px);
  overflow-x: auto;
  max-width: min(320px, 90vw);
}

.reaction-quick {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.reaction-quick:hover {
  transform: translateY(-1px);
  background: rgba(59, 130, 246, 0.25);
}

/* Reply container */
.reply-container {
  background-color: rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--primary-color);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reply-content {
  flex: 1;
}

.reply-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--primary-color);
}

.reply-text {
  font-size: 14px;
  opacity: 0.8;
}

/* Editing container */
.editing-container {
  background-color: rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--warning-color);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editing-content {
  flex: 1;
}

.editing-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--warning-color);
}

/* Toast notification */
#toast-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 1300;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

#toast-notification.show {
  opacity: 1;
}

/* Chat actions */
.chat-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Message text */
.message-text {
  margin: 0;
  word-break: break-word;
  line-height: 1.5;
}

.chat-messages.content-protected .message-text,
.chat-messages.content-protected .message-origin,
.chat-messages.content-protected .file-card {
  user-select: none;
  -webkit-user-select: none;
}

/* Message with data attributes */
.message {
  position: relative;
}

.message.channel-post {
  justify-content: center;
}

.message.channel-post .message-bubble {
  max-width: min(640px, 100%);
  width: 100%;
  background: rgba(20, 30, 48, 0.75);
  border: 1px solid rgba(120, 190, 255, 0.18);
  border-radius: 18px;
}

.message.channel-post .message-avatar {
  display: none;
}

.message-post-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 8px;
  opacity: 0.8;
}

.message-post-channel {
  font-weight: 600;
  color: var(--accent-color);
}

.message-post-sender {
  opacity: 0.85;
}

/* Message reply info */
.message-reply-info {
  background-color: rgba(16, 185, 129, 0.12);
  border-left: 2px solid var(--primary-color);
  padding: 5px 10px;
  margin-bottom: 5px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.message.incoming .message-reply-info {
  background-color: rgba(34, 197, 94, 0.18);
  color: #fff;
}

.message-reply-info i {
  color: var(--primary-color);
}

.message-reply-info .reply-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.message-reply-info .reply-snippet {
  font-size: 11px;
  opacity: 0.8;
}

.message.highlight .message-bubble {
  animation: highlightPulse 1.2s ease;
  box-shadow: 0 0 0 2px rgba(76, 194, 255, 0.4);
}

@keyframes highlightPulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 194, 255, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(76, 194, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 194, 255, 0); }
}

.message-origin {
  font-size: 0.75rem;
  opacity: 0.75;
  margin-bottom: 6px;
}

/* Message info */
.message-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  opacity: 0.7;
  line-height: 1.2;
  white-space: nowrap;
}

.message-edited {
  font-style: italic;
}

/* Settings Page Styles */
.settings-shell {
  display: flex;
  justify-content: center;
  padding: 24px 0 40px;
}

.settings-panel {
  width: min(980px, 100%);
  padding: 24px;
}

.settings-header-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.settings-header-main p {
  margin: 0;
  opacity: 0.7;
}

.settings-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.settings-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: var(--glass-border);
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text-color);
  text-align: left;
  transition: transform 0.2s ease, background 0.2s ease;
}

.settings-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.settings-card-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-card-icon .icon {
  width: 22px;
  height: 22px;
}

.settings-card-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-card-title {
  font-weight: 600;
}

.settings-card-subtitle {
  font-size: 0.85rem;
  opacity: 0.7;
}

.settings-footer {
  display: flex;
  justify-content: flex-end;
}

.settings-modal {
  width: min(640px, 94vw);
}

.setting-item-column {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.setting-action.full-width {
  width: 100%;
}

.fast-reaction-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fast-reaction-option {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.7);
  cursor: pointer;
  font-size: 18px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.fast-reaction-option.active,
.fast-reaction-option:hover {
  background: rgba(59, 130, 246, 0.35);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

.devices-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.devices-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.45);
}

.device-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.device-name {
  font-weight: 600;
}

.device-detail,
.device-times {
  font-size: 0.8rem;
  opacity: 0.7;
}

.device-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.device-current {
  font-size: 0.75rem;
  color: var(--primary-light);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.settings-empty {
  font-size: 0.85rem;
  opacity: 0.7;
  text-align: center;
  padding: 12px;
}

.settings-section {
  padding: 16px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 12px 28px rgba(7, 12, 24, 0.28);
}

.settings-header h3 {
  margin: 0 0 4px 0;
}

.settings-header p {
  margin: 0 0 12px 0;
  opacity: 0.7;
  font-size: 0.9rem;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-label {
  flex: 1;
}

.setting-label h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
}

.setting-label p {
  margin: 0;
  font-size: 14px;
  opacity: 0.7;
}

.setting-action {
  margin-left: 15px;
}

.setting-value {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Custom Audio Player */
.audio-player-wrapper {
  display: flex;
  align-items: center;
  background: var(--glass-bg);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(16,185,129,0.08);
  padding: 16px 18px 12px 18px;
  gap: 16px;
  min-width: 220px;
  max-width: 350px;
  margin-bottom: 6px;
}
.audio-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: none;
  box-shadow: 0 2px 8px rgba(16,185,129,0.12);
  cursor: pointer;
  transition: background 0.2s;
}
.audio-play-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}
.audio-timer {
  font-size: 1rem;
  color: var(--primary-light);
  min-width: 48px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.audio-seek-bar {
  flex: 1;
  margin: 0 10px;
  appearance: none;
  height: 6px;
  border-radius: 4px;
  background: rgba(16,185,129,0.15);
  outline: none;
  transition: background 0.2s;
}
.audio-seek-bar::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  box-shadow: 0 2px 6px rgba(16,185,129,0.18);
  cursor: pointer;
  border: 2px solid #fff;
}
.audio-seek-bar::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 2px solid #fff;
  cursor: pointer;
}
.audio-seek-bar::-ms-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 2px solid #fff;
  cursor: pointer;
}
.audio-seek-bar:focus {
  outline: none;
  background: rgba(16,185,129,0.25);
}
.audio-duration {
  font-size: 1rem;
  color: var(--light-text);
  min-width: 48px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 20px;
}

.modal .modal-content {
  width: min(520px, 92vw);
  max-height: 82vh;
  overflow: auto;
  padding: 0;
  margin: 0;
  border-radius: 18px;
  background: rgba(18, 24, 40, 0.95);
  box-shadow: 0 24px 60px rgba(7, 12, 24, 0.45);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#new-chat-modal {
  align-items: center;
  justify-content: center;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 16px 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 600px) {
  .modal {
    padding: 12px;
  }

  .modal .modal-content {
    width: 100%;
    max-height: 88dvh;
    border-radius: 16px;
  }

  .menu-item {
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .context-menu {
    max-height: 70vh;
  }

  .reaction-picker {
    padding: 8px 12px;
  }
}

/* Security banner */
.chat-security-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  margin: 12px 20px 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(57, 214, 164, 0.18), rgba(76, 194, 255, 0.12));
  border: 1px solid rgba(116, 242, 197, 0.2);
  box-shadow: 0 18px 40px rgba(10, 18, 30, 0.35);
  flex: 0 0 auto;
}

.chat-security-banner.secure {
  border-color: rgba(116, 242, 197, 0.35);
  box-shadow: 0 20px 45px rgba(20, 60, 45, 0.35);
}

.chat-security-banner .security-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 25, 40, 0.7);
  color: var(--primary-light);
}

.chat-security-banner .security-text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--light-text);
}

.chat-security-banner .security-text span {
  display: block;
  font-size: 0.8rem;
  opacity: 0.8;
}

.chat-security-banner .security-action {
  margin-left: auto;
}

/* Chat topbar */
.chat-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: var(--glass-border);
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(var(--glass-blur));
  flex: 0 0 auto;
}

.pinned-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 20px 0;
  padding: 10px 16px;
  border-radius: 16px;
  background: rgba(16, 24, 40, 0.75);
  border: 1px solid rgba(120, 190, 255, 0.18);
  box-shadow: 0 10px 28px rgba(7, 12, 24, 0.35);
  cursor: pointer;
}

.pinned-banner-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(57, 214, 164, 0.15);
  color: var(--primary-light);
}

.pinned-banner-body {
  flex: 1;
  min-width: 0;
}

.pinned-banner-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
}

.pinned-banner-text {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pinned-banner-close {
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.chat-topbar-avatar.channel-avatar,
.contact-avatar.channel-avatar {
  background: linear-gradient(135deg, rgba(76, 194, 255, 0.35), rgba(57, 214, 164, 0.25));
  color: var(--accent-color);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.channel-avatar .icon {
  width: 20px;
  height: 20px;
}

.channel-badge {
  margin-left: 8px;
  background: rgba(76, 194, 255, 0.2);
  color: var(--accent-color);
}

.chat-input.read-only .chat-input-box {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-input.read-only .chat-input-box input {
  cursor: not-allowed;
}

.chat-topbar-avatar {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgba(20, 30, 48, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--primary-light);
}

.chat-topbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-topbar-info {
  flex: 1;
}

.chat-topbar-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-topbar-subtitle {
  font-size: 0.85rem;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-topbar-actions .btn-icon.active {
  background: rgba(57, 214, 164, 0.25);
  color: var(--primary-light);
}

.chat-topbar.empty .chat-topbar-actions {
  display: none;
}

/* Conversation item enhancements */
.conversation-item {
  position: relative;
}

.pin-indicator {
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--primary-light);
  opacity: 0.7;
  font-size: 0.8rem;
}

.saved-avatar {
  background: rgba(76, 194, 255, 0.2);
  color: var(--accent-color);
  font-size: 1rem;
}

/* Message status ticks */
.message-status {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  font-size: 0.75rem;
  opacity: 0.8;
}

.message.pending .message-bubble {
  opacity: 0.75;
}

.message.failed .message-bubble {
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.new-messages-divider {
  align-self: center;
  margin: 10px 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.new-messages-divider.fade-out {
  opacity: 0;
  transform: translateY(6px);
}

.message-status.pending {
  opacity: 0.6;
}

.message-status.failed {
  color: #f87171;
  opacity: 1;
}

.message-status.read {
    color: #4ade80;
    opacity: 1;
  }

  .message-status .icon {
    width: 14px;
    height: 14px;
  }

  .message-read-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-left: 4px;
  }

/* File message cards */
.file-message-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-placeholder {
  font-size: 0.85rem;
  opacity: 0.7;
}

.file-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.file-card-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.file-card-size {
  font-size: 0.8rem;
  opacity: 0.7;
}

.file-card-download {
  color: var(--primary-light);
  text-decoration: none;
  font-size: 0.85rem;
}

/* Media download cards */
.media-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.media-frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-frame img.image-message,
.media-frame video.video-player {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}

.media-thumb {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  filter: blur(6px) brightness(0.75);
  transform: scale(1.02);
}

.media-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: rgba(3, 7, 18, 0.35);
  backdrop-filter: blur(6px);
  transition: opacity 0.2s ease;
}

.media-overlay.media-overlay-hidden {
  opacity: 0;
  pointer-events: none;
}

.media-status {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(76, 194, 255, 0.18);
  color: var(--primary-light);
}

.media-progress {
  display: none;
  align-items: center;
  gap: 10px;
}

.media-progress-circle {
  --progress: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: conic-gradient(var(--primary-color) calc(var(--progress) * 1%), rgba(255, 255, 255, 0.1) 0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-progress-center {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(10, 16, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.media-progress-text {
  font-size: 0.75rem;
  opacity: 0.8;
  min-width: 54px;
}

.media-download-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.media-download-btn .icon {
  width: 20px;
  height: 20px;
}

.media-retry-btn {
  display: none;
}

.media-upload-card .media-overlay {
  background: rgba(3, 7, 18, 0.55);
}

.upload-progress-overlay {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-progress-text {
  font-size: 0.75rem;
  opacity: 0.8;
}

.upload-retry-btn {
  margin-top: 8px;
}

.upload-file-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.upload-progress-row {
  margin-top: 8px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.upload-progress-row .upload-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  transition: width 0.2s ease;
}

.upload-progress-label {
  margin-top: 6px;
  font-size: 0.75rem;
  opacity: 0.8;
}

.media-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.media-thumb-fallback {
  width: 100%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(148, 163, 184, 0.3);
  color: rgba(226, 232, 240, 0.8);
  backdrop-filter: blur(6px);
}

.media-thumb-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.media-thumb-size {
  font-size: 0.75rem;
  opacity: 0.7;
}

.media-name {
  font-size: 0.9rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.media-size {
  font-size: 0.75rem;
  opacity: 0.7;
}

.audio-player,
.video-player {
  width: 260px;
  max-width: 100%;
}

.custom-player {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audio-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px;
}

.audio-title {
  font-size: 0.85rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.audio-artist {
  font-size: 0.75rem;
  opacity: 0.7;
  overflow-wrap: anywhere;
}

.custom-media-element {
  width: 100%;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.6);
}

.custom-video-player .custom-media-element {
  max-height: 320px;
  object-fit: cover;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.player-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.player-seek {
  flex: 1;
  accent-color: var(--primary-color);
}

.player-time {
  font-size: 0.75rem;
  opacity: 0.75;
  min-width: 90px;
  text-align: center;
}

.player-volume {
  width: 80px;
  accent-color: var(--primary-color);
}

.player-speed {
  width: 44px;
  height: 30px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(76, 194, 255, 0.18);
  color: var(--primary-light);
}

.audio-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audio-frame {
  position: relative;
  border-radius: 16px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.audio-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.audio-tile.is-playing {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.35);
}

.audio-tile-play {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.audio-tile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.audio-tile-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-tile-artist {
  font-size: 0.75rem;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-player {
  position: sticky;
  top: 8px;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin: 6px 16px 10px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.global-player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.global-player-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.global-player-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-player-artist {
  font-size: 0.75rem;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-player-btn,
.global-player-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

@media (max-width: 640px) {
  .global-player {
    margin: 6px 10px 8px;
    padding: 8px 10px;
    gap: 8px;
  }

  .global-player-controls {
    gap: 6px;
  }
}

.audio-placeholder,
.voice-placeholder {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(226, 232, 240, 0.85);
  font-size: 0.9rem;
}

.audio-placeholder-icon,
.voice-placeholder-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(76, 194, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.voice-controls {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
}

.voice-wave {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 36px;
  flex: 1;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 999px;
  padding: 8px 10px;
  overflow: hidden;
  cursor: pointer;
}

.voice-wave span {
  width: 3px;
  border-radius: 2px;
  background: rgba(226, 232, 240, 0.55);
  position: relative;
  z-index: 1;
}

.voice-wave-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(76, 194, 255, 0.35), rgba(76, 194, 255, 0.05));
  z-index: 0;
}

/* Attachment preview */
.attachment-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}

.attachment-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--primary-light);
}

.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-info {
  flex: 1;
}

.attachment-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.attachment-size {
  font-size: 0.75rem;
  opacity: 0.7;
}

.attachment-hint {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-top: 2px;
}

.attachment-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.attachment-send {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.file-caption {
  margin-top: 6px;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* Activity indicator */
.activity-indicator {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--primary-light);
  opacity: 0.9;
}

/* Typing bubble */
.typing-bubble {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 18px 18px 18px 6px;
  background: rgba(20, 28, 48, 0.72);
  border: 1px solid rgba(120, 190, 255, 0.12);
  max-width: 140px;
  width: fit-content;
  margin: 6px 0;
  margin-right: auto;
  box-shadow: 0 10px 24px rgba(7, 12, 24, 0.35);
  align-self: flex-start;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  animation: typingPulse 1.2s infinite ease-in-out;
}

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

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

@keyframes typingPulse {
  0% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-4px);
    opacity: 1;
  }
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
}

/* Upload progress */
.upload-progress {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-progress-bar {
  height: 6px;
  flex: 1;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  width: 0;
  transition: width 0.2s ease;
}

.upload-progress-text {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Member chips */
.member-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.member-chip .btn-icon {
  width: 28px;
  height: 28px;
}

.member-add-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Forward modal */
.forward-modal {
  width: min(420px, 90vw);
}

.forward-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.forward-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  cursor: pointer;
  transition: background 0.2s ease;
}

.forward-item:hover {
  background: rgba(57, 214, 164, 0.15);
}

/* Seen time modal */
.seen-time-modal {
  width: min(360px, 90vw);
}

#seen-time-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--light-text);
}

/* Image viewer modal */
.image-viewer {
  width: min(860px, 94vw);
}

.image-viewer-body {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px 0;
  max-height: 70vh;
  overflow: hidden;
}

#image-viewer-img {
  max-width: 100%;
  max-height: 60vh;
  transform: scale(1);
  transform-origin: center center;
  transition: transform 0.2s ease;
  border-radius: 12px;
}

.image-viewer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Pill options and gaps */
.gap-10 {
  gap: 10px;
}

.pill-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 0.85rem;
}

.pill-option input {
  accent-color: var(--primary-color);
}

@media (max-width: 768px) {
  body.settings-page .auth-container {
    padding-top: 24px;
  }

  body.chat-page .chat-container {
    height: 100dvh;
    max-height: 100dvh;
  }

  .user-menu-toggle span {
    display: none;
  }

  .app-logo span {
    font-size: 1.1rem;
  }

  .profile-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-avatar {
    margin-right: 0;
  }

  .contact-item {
    flex-wrap: wrap;
    gap: 12px;
  }

  .contact-info {
    min-width: 0;
  }

  .settings-panel {
    padding: 18px;
  }

  .settings-categories {
    grid-template-columns: 1fr;
  }

  .chat-security-banner {
    margin: 10px 12px 0;
  }

  .pinned-banner {
    margin: 10px 12px 0;
  }

  .chat-topbar {
    padding: 12px 14px;
  }

  .device-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .device-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .tab {
    flex: 1 1 100%;
  }
}
