:root {
  --bg-darkest: #0a0a0f;
  --bg-darker: #111118;
  --bg-dark: #1a1a24;
  --bg-medium: #23232f;
  --bg-light: #2d2d3a;
  --bg-lighter: #383848;
  --accent-primary: #ff8c00;
  --accent-secondary: #ff6b00;
  --accent-gradient: linear-gradient(135deg, #ff8c00 0%, #ff6b00 100%);
  --accent-glow: rgba(255, 140, 0, 0.4);
  --text-primary: #ffffff;
  --text-secondary: #b8b8c8;
  --text-muted: #6e6e82;
  --success: #5cffb8;
  --warning: #ffb85c;
  --danger: #ff5c8a;
  --online: #5cffb8;
  --idle: #ffb85c;
  --dnd: #ff5c8a;
  --offline: #6e6e82;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-darkest);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  user-select: none;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-lighter); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

/* Connection Screen */
.connection-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-darkest) 0%, var(--bg-dark) 100%);
}

.connection-card {
  background: var(--bg-darker);
  padding: 40px;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

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

.logo-icon {
  width: 80px;
  height: 80px;
  background: var(--accent-gradient);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.logo-icon-img {
  width: 100px;
  height: 100px;
  margin-bottom: 16px;
  filter: invert(1) drop-shadow(0 4px 20px var(--accent-glow));
}

.logo h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-primary);
}

.logo p {
  color: var(--text-muted);
  margin-top: 4px;
}

.connection-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
  padding: 12px 16px;
  background: var(--bg-dark);
  border: 2px solid var(--bg-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.form-group.checkbox {
  flex-direction: row;
  align-items: center;
}

.form-group.checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-group.checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
}

.btn-primary {
  padding: 14px 24px;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: #000;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.error-message {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  min-height: 20px;
}

/* Main App */
.main-app {
  height: 100vh;
  display: grid;
  grid-template-columns: 72px 240px 1fr;
}

.main-app.voice-active {
  grid-template-columns: 72px 240px 1fr 600px;
}

/* Server List */
.server-list {
  background: var(--bg-darkest);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  overflow-y: auto;
}

.server-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-secondary);
  position: relative;
}

.server-icon:hover {
  border-radius: var(--radius-lg);
  background: var(--accent-primary);
  color: #000;
}

.server-icon.active {
  border-radius: var(--radius-lg);
  background: var(--accent-gradient);
  color: #000;
}

.server-icon::before {
  content: '';
  position: absolute;
  left: -12px;
  width: 4px;
  height: 0;
  background: var(--text-primary);
  border-radius: 0 4px 4px 0;
  transition: height 0.2s;
}

.server-icon:hover::before {
  height: 20px;
}

.server-icon.active::before {
  height: 36px;
}

.server-divider {
  width: 32px;
  height: 2px;
  background: var(--bg-light);
  border-radius: 1px;
  margin: 4px 0;
}

/* Channel Sidebar */
.channel-sidebar {
  background: var(--bg-darker);
  display: flex;
  flex-direction: column;
}

.server-header {
  padding: 16px;
  border-bottom: 1px solid var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.server-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-primary);
}

.channels-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.channel-category {
  padding: 16px 8px 4px 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.channel-category:hover {
  color: var(--text-secondary);
}

.channel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.channel:hover {
  background: var(--bg-medium);
  color: var(--text-secondary);
}

.channel.active {
  background: var(--bg-light);
  color: var(--text-primary);
}

.channel-icon {
  font-size: 18px;
  opacity: 0.7;
}

.channel-name {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

.channel-users {
  font-size: 12px;
  color: var(--text-muted);
}

.channel-edit {
  opacity: 0;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity 0.15s;
}

.channel:hover .channel-edit {
  opacity: 0.6;
}

.channel-edit:hover {
  opacity: 1 !important;
  background: var(--bg-light);
}

/* DM Section */
.dm-section {
  margin-top: 8px;
  border-top: 1px solid var(--bg-medium);
  padding-top: 8px;
}

.dm-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dm-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.dm-unread {
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.encrypted-badge {
  font-size: 10px;
  margin-left: 4px;
}

.no-messages {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  padding: 40px;
}

.no-messages .lock-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.no-messages h3 {
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* Voice Status */
.voice-status {
  background: var(--bg-dark);
  padding: 12px;
  border-top: 1px solid var(--bg-medium);
}

.voice-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: rgba(92, 255, 184, 0.1);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.voice-info .status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.voice-text {
  font-size: 12px;
  color: var(--success);
  font-weight: 500;
}

.channel-name-small {
  font-size: 11px;
  color: var(--text-muted);
}

.voice-controls {
  display: flex;
  gap: 4px;
}

.voice-btn {
  flex: 1;
  padding: 8px;
  background: var(--bg-medium);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
}

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

.voice-btn.active {
  background: var(--danger);
  color: white;
}

.voice-btn.disconnect {
  background: transparent;
}

.voice-btn.disconnect:hover {
  background: var(--danger);
  color: white;
}

/* User Panel */
.user-panel {
  background: var(--bg-darkest);
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

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

.status-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid var(--bg-darkest);
}

.status-indicator.online { background: var(--online); }
.status-indicator.idle { background: var(--idle); }
.status-indicator.dnd { background: var(--dnd); }
.status-indicator.offline { background: var(--offline); }

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

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

.user-tag {
  font-size: 11px;
  color: var(--text-muted);
}

.user-controls {
  display: flex;
  gap: 4px;
}

.user-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

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

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
}

/* Chat Fullscreen Mode */
.main-content.chat-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1500;
  width: 100vw;
  height: 100vh;
}

.main-content.chat-fullscreen .channel-header {
  background: var(--bg-dark);
}

.channel-header {
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--bg-darker);
  display: flex;
  align-items: center;
  gap: 12px;
}

.channel-header .hash {
  font-size: 22px;
  color: var(--text-muted);
}

.channel-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.channel-header .divider {
  width: 1px;
  height: 24px;
  background: var(--bg-lighter);
}

.channel-header .description {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.header-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.header-btn:hover {
  color: var(--text-primary);
}

/* Messages Area */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-group {
  display: flex;
  gap: 16px;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

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

.message-content {
  flex: 1;
  min-width: 0;
}

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

.message-author {
  font-weight: 600;
  font-size: 14px;
}

.message-timestamp {
  font-size: 11px;
  color: var(--text-muted);
}

.message-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  word-wrap: break-word;
}

.message-text code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-darker);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* Message Input */
.message-input-container {
  padding: 0 16px 24px;
}

.message-input-wrapper {
  background: var(--bg-medium);
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-end;
  padding: 4px 4px 4px 16px;
}

.input-actions-left,
.input-actions-right {
  display: flex;
  gap: 4px;
  padding-bottom: 8px;
}

.input-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

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

.message-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  padding: 12px;
  resize: none;
  min-height: 24px;
  max-height: 200px;
}

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

/* Voice Panel */
.voice-panel {
  background: var(--bg-darker);
  border-left: 1px solid var(--bg-dark);
  display: flex;
  flex-direction: column;
}

.voice-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.voice-panel-header h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.video-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.video-tile {
  position: relative;
  background: var(--bg-darkest);
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16/9;
  min-height: 150px;
}

.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-tile .video-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: white;
}

/* Voice panel fullscreen styles */
.voice-panel:fullscreen {
  background: var(--bg-darkest);
  padding: 20px;
}

.voice-panel:fullscreen .voice-panel-content {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 100px);
}

.voice-panel:fullscreen .video-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)) !important;
  gap: 16px !important;
  flex: 1;
  max-height: none !important;
  overflow-y: auto;
  align-content: start;
}

.voice-panel:fullscreen .video-tile {
  min-height: 300px;
  max-height: 50vh;
}

.voice-participants h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.participant {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.participant:hover {
  background: var(--bg-dark);
}

.participant .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.participant .avatar.speaking {
  box-shadow: 0 0 0 3px var(--success);
}

.participant .name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}

.participant .status-icons {
  display: flex;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.participant .status-icons .muted {
  color: var(--danger);
}

.voice-actions {
  padding: 12px;
  background: var(--bg-dark);
  border-top: 1px solid var(--bg-medium);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.action-btn {
  padding: 10px;
  background: var(--bg-medium);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  transition: all 0.15s;
}

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

.action-btn.active {
  background: var(--accent-primary);
  color: #000;
}

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

.action-btn .icon {
  font-size: 20px;
}

.action-btn .label {
  font-size: 10px;
  font-weight: 500;
}

/* PTT Indicator */
.ptt-indicator {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-primary);
  color: #000;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  display: none;
  z-index: 1000;
  animation: pttPulse 1s infinite;
}

.ptt-indicator.active {
  display: block;
}

@keyframes pttPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 10px transparent; }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-light);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideUp 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--accent-primary); }

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

.toast-icon { width: 20px; height: 20px; }
.toast-message { font-size: 14px; }

/* Settings Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-dark);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--bg-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
}

.modal-close:hover {
  background: var(--bg-light);
  color: var(--text-primary);
}

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

.settings-section {
  margin-bottom: 24px;
}

.settings-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bg-medium);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.settings-row label {
  font-size: 14px;
  color: var(--text-secondary);
}

.settings-row input[type="range"] {
  width: 150px;
  accent-color: var(--accent-primary);
}

.settings-row select {
  padding: 8px 12px;
  background: var(--bg-medium);
  border: 2px solid var(--bg-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
}

.settings-row select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--bg-medium);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-secondary {
  padding: 10px 20px;
  background: var(--bg-light);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

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

.btn-danger {
  padding: 10px 20px;
  background: var(--danger);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-danger:hover {
  opacity: 0.9;
}

/* Loading Spinner */
.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--bg-light);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Drag-drop highlight */
.messages-area.drag-highlight {
  background: var(--bg-medium);
  border: 2px dashed var(--accent-primary);
  border-radius: var(--radius-lg);
}

.messages-area.drag-highlight::after {
  content: 'Drop images here';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-primary);
  pointer-events: none;
}

/* Attachment Preview */
.attachment-preview {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: var(--bg-medium);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.attachment-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-dark);
}

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

.remove-attachment {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.8);
  border: none;
  color: white;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.attachment-preview-item:hover .remove-attachment {
  opacity: 1;
}

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

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

.message-attachment {
  max-width: 400px;
  max-height: 300px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
}

.message-attachment img {
  width: 100%;
  height: auto;
  display: block;
}

.message-attachment:hover {
  opacity: 0.9;
}
