:root {
  --bg: #0f1012;
  --panel: #1b1d22;
  --text: #e0e0e0;
  --accent: #ff3b30; /* audio-focused accent */
  --accent-soft: #ff7b70;
  --danger: #d9534f;
  --rec: #ff3b30;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #222633 0, #0f1012 45%, #050608 100%);
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Layout */

#sidebar {
  width: 260px;
  background: linear-gradient(180deg, #191b22, #111217);
  display: flex;
  flex-direction: column;
  border-right: 1px solid #262932;
  box-shadow: 0 0 15px rgb(0 0 0 / 45%);
}

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Profile box */

#profile-box {
  padding: 20px;
  background: #20222b;
  border-bottom: 1px solid #272a36;
  text-align: center;
}

#my-username {
  font-weight: 600;
  color: var(--accent-soft);
  cursor: pointer;
  font-size: 1.05rem;
}

.sub-text {
  font-size: 0.75rem;
  color: #8f93a2;
  margin-top: 4px;
}

/* Sidebar lists */

.section-title {
  padding: 12px 15px 4px;
  font-weight: 600;
  color: #9da0af;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.section-hint {
  padding: 0 15px 6px;
  font-size: 0.7rem;
  color: #6e7281;
}

.section-hint code {
  font-size: 0.7rem;
  background: #22242c;
  padding: 1px 4px;
  border-radius: 3px;
}

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

.item {
  padding: 10px 15px;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.item:hover {
  background: #272a35;
}

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

.item.pm-active {
  border-left: 4px solid var(--rec);
  background: #332b2b;
}

/* Site header in main */

#site-header {
  padding: 14px 20px 6px;
  border-bottom: 1px solid #272a36;
  background: radial-gradient(circle at top left, rgb(255 59 48 / 18%), transparent 55%);
}

#site-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

#site-header p {
  margin: 6px 0 8px;
  font-size: 0.9rem;
  color: #b5b8c7;
}

#site-header ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.8rem;
  color: #8f93a2;
}

#site-header li {
  margin-bottom: 2px;
}

.highlight-mic {
  color: var(--accent-soft);
  font-weight: 600;
}

/* Chat history & messages */

#chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 80%;
  padding: 9px 10px;
  border-radius: 10px;
  background: #262834;
  position: relative;
  box-shadow: 0 1px 3px rgb(0 0 0 / 40%);
}

.message.self {
  align-self: flex-end;
  background: linear-gradient(135deg, #ff5e52, #ff3b30);
}

.message.private {
  background: #3f2435;
  border: 1px solid #f44;
}

.message .meta {
  font-size: 0.72rem;
  color: #a8abbc;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

/* use modern property instead of deprecated word-wrap */
.message .text {
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

/* Report / delete button */

.report-btn {
  opacity: 0.35;
  cursor: pointer;
  margin-left: 10px;
  transition: 0.2s;
}

.report-btn:hover {
  opacity: 1;
  color: var(--danger);
}

/* Like button */

.like-btn {
  opacity: 0.8;
  cursor: pointer;
  margin-left: 10px;
  transition: 0.12s;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 0.9rem;
  color: #ffd0d0;
}

.like-btn .like-count {
  font-size: 0.85rem;
  color: #ffecec;
}

.like-btn:hover {
  transform: scale(1.06);
  opacity: 1;
}

.like-btn.liked {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(255,59,48,0.35);
}

/* Input area */

#input-area {
  padding: 12px 18px;
  background: #191b22;
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid #272a36;
}

input[type="text"] {
  flex: 1;
  padding: 9px 10px;
  border-radius: 5px;
  border: 1px solid #3a3d4a;
  background: #101118;
  color: white;
  font-size: 0.9rem;
}

input[type="text"]::placeholder {
  color: #686c7d;
}

button {
  padding: 9px 13px;
  background: #2f89ff;
  border: none;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

button:hover {
  background: #2271d8;
}

button.recording {
  background: var(--rec);
  animation: pulse 1.5s infinite;
}

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

/* Emphasize mic button */

#mic-btn {
  background: var(--accent);
  box-shadow: 0 0 10px rgb(255 59 48 / 55%);
}

#mic-btn:hover {
  background: #e13229;
}

/* Username modal */

#username-modal {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #181920;
  padding: 26px 26px 22px;
  border-radius: 10px;
  width: 320px;
  text-align: center;
  box-shadow: 0 10px 30px rgb(0 0 0 / 70%);
}

.modal-content h3 {
  margin: 0 0 6px;
}

.modal-subtitle {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: #a2a6b5;
}

.modal-content input[type="text"] {
  width: 100%;
}

/* Files & media */

.file-preview {
  display: block;
  max-width: 220px;
  max-height: 220px;
  margin-top: 6px;
  border-radius: 4px;
}

a:has(.file-preview) {
  text-decoration: none;
  outline: none;
  border: none;
  cursor: pointer;
}

.file-link {
  display: inline-block;
  margin-top: 4px;
  color: #4da3ff;
  text-decoration: none;
  font-size: 0.85rem;
}

audio {
  margin-top: 4px;
  max-width: 100%;
}

/* PM exit button */

#exit-pm {
  background: #555c6a;
  font-size: 0.8rem;
  padding: 5px 10px;
  display: none;
}

/* PM alert animation on usernames */

.pm-alert {
  animation: pm-blink 1s ease-in-out infinite;
}

@keyframes pm-blink {
  0% {
    background-color: #332b2b;
    color: #fff;
  }
  50% {
    background-color: #ff3b30;
    color: #fff;
  }
  100% {
    background-color: #332b2b;
    color: #fff;
  }
}

/* Big PM alert bubble */

.pm-bubble {
  max-width: 80%;
  margin: 5px auto;
  padding: 12px 14px;
  border-radius: 8px;
  background: #3b2d00;
  border: 1px solid #ffbf66;
  color: #ffe0a0;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 0 10px rgb(255 191 102 / 30%);
}

.pm-bubble:hover {
  background: #4b3a00;
}

.pm-bubble strong {
  color: #ffd27f;
}

/* Scrollbar tweaks (optional, nicer feel) */

#chat-history::-webkit-scrollbar,
.list::-webkit-scrollbar {
  width: 8px;
}

#chat-history::-webkit-scrollbar-thumb,
.list::-webkit-scrollbar-thumb {
  background: #353847;
  border-radius: 4px;
}

#chat-history::-webkit-scrollbar-track,
.list::-webkit-scrollbar-track {
  background: transparent;
}