﻿/* ===== Layout ===== */

/* Auto-login Indicator - Blur Overlay */
.auto-login-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  opacity: 1;
  visibility: visible;
  display: block !important; /* Override base .hidden class */
  transition: opacity 0.6s ease-out, backdrop-filter 0.6s ease-out, visibility 0s 0s;
  pointer-events: none;
}

.auto-login-indicator.hidden {
  opacity: 0;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  visibility: hidden;
  display: block !important; /* Override base .hidden class to allow transitions */
  transition: opacity 0.6s ease-out, backdrop-filter 0.6s ease-out, visibility 0s 0.6s;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn var(--transition);
}

#profileCustomizationModal {
  z-index: 1001;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-6);
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: fadeIn var(--transition);
}

.auth-modal {
  max-width: 400px;
}

.settings-modal-content {
  max-width: 680px;
  width: 95%;
  min-height: 550px;
}

.modal-header {
  margin-bottom: var(--space-4);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-1);
  color: var(--text-primary);
}

.modal-footer {
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
}

#deleteMessageModal .modal-footer,
#blockUserModal .modal-footer {
  justify-content: center;
}

.warning-text {
  color: var(--danger-500);
  font-size: 0.875rem;
  margin-top: var(--space-2);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.auth-form {
  margin-bottom: var(--space-4);
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Settings Specific Styles */
.settings-tabs {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: var(--space-1);
  margin-bottom: var(--space-4);
  border: 1px solid var(--border-color);
}

.settings-tab-btn {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.settings-tab-btn.active {
  background: var(--primary-500);
  color: white;
}

.settings-tab-btn:hover:not(.active) {
  background: var(--bg-accent);
  color: var(--text-primary);
}

.settings-content {
  min-height: 400px;
}

.settings-tab-content {
  display: none;
  animation: fadeIn var(--transition);
}

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

.settings-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Profile Tab Styles */
.profile-info-section {
  margin-bottom: var(--space-4);
}

/* Profile Media Sections Container - Side by side on desktop, stacked on mobile */
.profile-media-sections {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  flex-direction: column;
}

@media (min-width: 768px) {
  .profile-media-sections {
    flex-direction: row;
  }
}

.profile-media-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  text-align: center;
}

.profile-picture-section,
.profile-banner-section {
  flex: 1;
}

.profile-picture-container,
.profile-banner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.profile-picture-preview {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
}

.profile-banner-preview {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
}

.profile-picture-preview img,
.profile-banner-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-picture-preview svg,
.profile-banner-preview svg {
  color: var(--text-secondary);
}

.profile-picture-actions,
.profile-banner-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
}

.profile-picture-hint,
.profile-banner-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.profile-info-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

.profile-info-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-color);
}

.profile-info-item:last-child {
  border-bottom: none;
}

.profile-info-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.profile-info-value {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.tier-benefits {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
}

.tier-benefits-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.tier-benefits-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  font-size: 0.875rem;
  color: var(--text-primary);
}

.benefit-item.available {
  color: var(--success-500);
}

.benefit-item.unavailable {
  color: var(--text-muted);
  opacity: 0.6;
}

/* Settings/Preferences Tab Styles */
.settings-section {
  margin-bottom: var(--space-4);
}

/* About Tab Styles */
.about-section {
  margin-bottom: var(--space-4);
}

.about-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.about-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.about-header .pulse-logo {
  margin-bottom: 0;
}

.about-header h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.about-content {
  padding: var(--space-4);
}

.about-section-block {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.about-section-block:hover {
  background: var(--bg-tertiary);
}

.about-section-block:last-child {
  margin-bottom: 0;
}

.about-section-block h5 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.about-section-block h5 svg {
  flex-shrink: 0;
}

.about-section-block p {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-2);
}

.about-section-block p:last-child {
  margin-bottom: 0;
}

.about-section-block ul {
  list-style: none;
  padding: 0;
  margin-left: var(--space-3);
}

.about-section-block li {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-1);
  position: relative;
}

.warning-block {
  border-color: var(--warning-500);
  border-left-width: 3px;
}

.warning-block h5 {
  color: var(--warning-500);
}

.about-section-block strong {
  color: var(--text-primary);
  font-weight: 600;
}

.about-section-block em {
  color: var(--text-muted);
  font-style: italic;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: var(--space-1);
  margin-bottom: var(--space-4);
}

.tab-btn {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.tab-btn.active {
  background: var(--primary-500);
  color: white;
}

.tab-btn:hover:not(.active) {
  background: var(--bg-accent);
  color: var(--text-primary);
}

.tab-content-container {
  animation: fadeIn var(--transition);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn var(--transition);
}

/* Settings */
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}

.setting-info label {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  display: block;
}

.setting-info p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

/* Main Application */
.app-container {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.friends-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.section-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-tertiary);
}

.section-header h3 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Friend Requests */
.friend-requests-section {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition);
}

.subsection-header:hover {
  background: var(--bg-hover);
}

.subsection-title {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

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

.friend-requests-list {
  margin-top: var(--space-2);
  max-height: 200px;
  overflow-y: auto;
}

.friend-request-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary-500);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  animation: fadeIn var(--transition);
}

.friend-request-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.friend-request-username {
  font-weight: 600;
  color: var(--primary-500);
}

.friend-request-buttons {
  display: flex;
  gap: var(--space-1);
}

.friend-request-btn {
  padding: var(--space-1) var(--space-2);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
}

.accept-btn {
  background: var(--success-500);
  color: white;
}

.accept-btn:hover {
  background: var(--success-600);
}

.deny-btn {
  background: var(--danger-500);
  color: white;
}

.deny-btn:hover {
  background: var(--danger-600);
}

/* Friends List */
.friends-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2) var(--space-4);
}

.friend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  margin-bottom: 2px;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

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

.friend-item.active {
  background: var(--bg-accent);
  color: white;
}

.friend-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

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

.friend-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.friend-username {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.friend-item.active .friend-username {
  color: white;
}

.friend-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.friend-item.active .friend-role {
  color: rgba(255, 255, 255, 0.7);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Header */
.app-header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  flex: 1;
}

.header-left h1 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.username {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Chat Container */
.chat-container {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* Messages Area */
.messages-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
}

/* Messages */
.message {
  display: flex;
  flex-direction: column;
  max-width: 70%;
  position: relative;
  animation: fadeIn var(--transition);
}

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

.message-header {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.message-content {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  word-wrap: break-word;
  white-space: pre-wrap;
  position: relative;
  transition: all var(--transition);
}

.message.own .message-content {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-500);
}

/* Remove borders from own messages with media */
.message.own .message-content:has(img.message-image),
.message.own .message-content:has(.custom-video-player),
.message.own .message-content.sticker-message {
  border: none !important;
  background: transparent !important;
}

.message:hover .message-content {
  background: var(--bg-accent);
}

.message.own:hover .message-content {
  background: var(--primary-600);
}

/* Don't change background on hover for media messages */
.message:hover .message-content:has(img.message-image),
.message:hover .message-content:has(.custom-video-player),
.message:hover .message-content.sticker-message,
.message.own:hover .message-content:has(img.message-image),
.message.own:hover .message-content:has(.custom-video-player),
.message.own:hover .message-content.sticker-message {
  background: transparent !important;
}

.message:hover .message-actions {
  opacity: 1;
}

.message-actions {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  gap: var(--space-1);
}

.message-action-btn {
  padding: var(--space-1);
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.7rem;
  transition: all var(--transition);
}

.message-action-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

.delete-btn {
  background: var(--danger-500);
}

.delete-btn:hover {
  background: var(--danger-600);
}

/* Media Messages */
.message-content:has(img.message-image) {
  padding: 0 !important;
  overflow: hidden;
  border: none !important;
  background: transparent !important;
}

.message-content:has(.custom-video-player) {
  padding: 0 !important;
  overflow: hidden;
  border: none !important;
  background: transparent !important;
}

.message-content.sticker-message {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.message img:not(.sticker-in-chat) {
  max-width: 500px;
  max-height: 350px;
  border-radius: var(--radius-sm);
  border: none !important;
  cursor: pointer;
  transition: opacity var(--transition);
  display: block;
}

.message img:not(.sticker-in-chat):hover {
  opacity: 0.9;
}

/* Custom Video Player */
.custom-video-player {
  position: relative;
  max-width: 500px;
  margin-top: var(--space-1);
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: none !important;
}

.custom-video-player video {
  width: 100%;
  height: auto;
  display: block;
  max-height: 350px;
  cursor: pointer;
}

/* Browser fullscreen */
.custom-video-player:fullscreen {
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.custom-video-player:fullscreen video {
  max-width: 100%;
  max-height: calc(100vh - 50px);
  object-fit: contain;
}

.custom-video-player:fullscreen .video-controls {
  max-width: 90%;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  padding: 16px 24px;
  gap: 8px;
  font-size: 1.5rem;
}

.custom-video-player:fullscreen .video-controls button {
  padding: 8px;
}

.custom-video-player:fullscreen .video-controls button svg {
  width: 32px;
  height: 32px;
}

.custom-video-player:fullscreen .video-progress-wrapper {
  flex: 1;
  max-width: none;
  gap: 4px;
}

.custom-video-player:fullscreen .video-progress-container {
  height: 8px;
}

.custom-video-player:fullscreen .video-time {
  font-size: 1.3rem;
}

.custom-video-player:fullscreen .video-volume-slider {
  width: 8px;
  height: 70px;
}

.custom-video-player:fullscreen .video-volume-slider::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
}

.custom-video-player:fullscreen .video-volume-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
}

.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  font-size: 0.75rem;
}

.custom-video-player:hover .video-controls,
.custom-video-player:fullscreen .video-controls {
  opacity: 1;
  pointer-events: auto;
}

.video-controls button {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.video-controls button svg {
  width: 16px;
  height: 16px;
}

.video-controls button:hover {
  opacity: 0.7;
}

.video-play-pause {
  position: relative;
}

.video-progress-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 60px;
}

.video-progress-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.video-progress-filled {
  height: 100%;
  background: #3b82f6;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.video-time {
  color: white;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  gap: 2px;
  user-select: none;
  white-space: nowrap;
}

.video-volume-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  position: relative;
}

.video-volume-slider {
  width: 4px;
  height: 35px;
  writing-mode: vertical-lr;
  direction: rtl;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.video-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--primary-500);
  border-radius: 50%;
  cursor: pointer;
}

.video-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--primary-500);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Image Lightbox */
.image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.image-lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.image-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 2001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.image-lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 2002;
}

.image-lightbox-close:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* Audio Messages */
.audio-message {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  max-width: 300px;
  margin-top: var(--space-1);
}

.message.own .audio-message {
  background: var(--primary-500);
  border-color: var(--primary-500);
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
}

.audio-play-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--bg-accent);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.message.own .audio-play-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.audio-play-btn:hover {
  background: var(--primary-500);
  color: white;
}

.message.own .audio-play-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.audio-play-btn.playing {
  background: var(--success-500);
  color: white;
}

.audio-duration {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  min-width: 32px;
}

.message.own .audio-duration {
  color: rgba(255, 255, 255, 0.8);
}

.audio-waveform {
  flex: 1;
  height: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

.message.own .audio-waveform {
  background: rgba(255, 255, 255, 0.1);
}

.audio-progress {
  height: 100%;
  background: var(--primary-500);
  border-radius: var(--radius-sm);
  transition: width var(--transition);
  width: 0%;
}

.message.own .audio-progress {
  background: rgba(255, 255, 255, 0.3);
}

/* Document Messages */
.document-message {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  max-width: 300px;
  margin-top: var(--space-1);
}

.message.own .document-message {
  background: var(--primary-500);
  border-color: var(--primary-500);
  color: white;
}

.document-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.message.own .document-icon {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

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

.document-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message.own .document-name {
  color: white;
}

.document-size {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.message.own .document-size {
  color: rgba(255, 255, 255, 0.8);
}

.document-download {
  padding: var(--space-1);
  background: var(--bg-accent);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.message.own .document-download {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.document-download:hover {
  background: var(--primary-500);
  color: white;
}

.message.own .document-download:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Message Input */
.message-input-area {
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.input-container {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  transition: all var(--transition);
}

.input-container:focus-within {
  border-color: var(--primary-500);
}

.upload-btn {
  flex-shrink: 0;
}

.message-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  resize: none;
  min-height: 20px;
  max-height: 120px;
  line-height: 1.5;
  font-family: inherit;
  padding: 2px 0;
}

.message-input:focus {
  outline: none;
}

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

.send-btn {
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  padding: var(--space-2);
}

/* Attachment Preview */
.attachment-preview {
  margin-top: var(--space-2);
  padding: var(--space-2);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.attachment-preview.hidden {
  display: none;
}

.attachment-preview-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--space-2);
}

.attachment-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.attachment-icon {
  flex-shrink: 0;
  color: var(--primary-500);
}

.attachment-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  flex: 1;
}

.attachment-name {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.attachment-remove {
  flex-shrink: 0;
  padding: var(--space-1);
  color: var(--text-muted);
  transition: color var(--transition);
}

.attachment-remove:hover {
  color: var(--danger-500);
}

.attachment-upload-progress {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-2);
}

.attachment-upload-progress.hidden {
  display: none;
}

.upload-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
  border-radius: var(--radius-full);
  transition: width 0.1s linear;
  width: 0%;
}

.upload-progress-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 40px;
  text-align: right;
}

/* Character Counter */
.character-counter {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-1);
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.character-counter.warning {
  color: var(--warning-500);
}

.character-counter.danger {
  color: var(--danger-500);
}

/* User Info Panel */
.user-info-panel {
  width: var(--user-panel-width);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.user-profile {
  padding: var(--space-4);
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.user-profile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.5));
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}

.user-profile[style*="background-image"]::before {
  opacity: 1;
}

.user-profile[style*="background-image"] .user-name,
.user-profile[style*="background-image"] .role-badge {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  color: white;
}

.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--primary-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin: 0 auto var(--space-3);
}

.user-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--text-primary);
}

.user-details {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.detail-value {
  font-weight: 500;
  color: var(--text-primary);
}

.user-actions {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.admin-actions {
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-4);
  margin-top: var(--space-4);
}

.admin-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
  text-align: center;
}

.admin-action-group {
  margin-bottom: var(--space-3);
}

.admin-action-group label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.admin-controls-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.admin-ban-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

/* User List */
.user-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.blocked-user-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--danger-500);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: fadeIn var(--transition);
}

.blocked-username {
  font-weight: 600;
  color: var(--danger-500);
}

.unblock-btn {
  background: var(--success-500);
  color: white;
  border: none;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
}

.unblock-btn:hover {
  background: var(--success-600);
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12);
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: var(--space-3);
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Loading Indicator */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  color: var(--text-secondary);
}

/* Message Display */
.message-display {
  margin-top: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  text-align: center;
  animation: fadeIn var(--transition);
}

.message-display:empty {
  display: none;
}

.message-display.error-message {
  background: var(--bg-tertiary);
  border: 1px solid var(--danger-500);
  color: var(--danger-500);
}

.message-display.success-message {
  background: var(--bg-tertiary);
  border: 1px solid var(--success-500);
  color: var(--success-500);
}

/* Notifications */
.notification-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 400px;
}

.notification {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  box-shadow: var(--shadow-xl);
  animation: slideUp var(--transition);
  position: relative;
  overflow: hidden;
}

.notification::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-500);
}

.notification.success::before {
  background: var(--success-500);
}

.notification.error::before {
  background: var(--danger-500);
}

.notification.warning::before {
  background: var(--warning-500);
}

/* Collapsed State */
.collapsed {
  display: none !important;
}

/* ===== Sticker Picker Styles ===== */
