/* =============================
   Root Variables
============================= */
:root {
  /* Text Colors */
  --color-green:  #32a87f;
  --color-gray:   #9a9c9b;
  --color-light:  #e1ebe6;
  --color-white:  #fafafa;

  /* Background Colors */
  --bg-green: #32a87f;
  --bg-gray:  #9a9c9b;
  --bg-light: #e1ebe6;
  --bg-white: #fafafa;

  /* Font Sizes */
  --font-xxsmall: 9px;
  --font-small:   11px;
  --font-medium:  13px;
  --font-big:     14px;

  /* Icon Size */
  --icon-size: 16px;

  /* Modal border */
  --modal-border: rgb(69, 68, 68);

  /* Noisy background */
  --bg-noisy: 
    repeating-radial-gradient(circle at 0 0, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 2px),
    radial-gradient(circle at 20% 30%, #2a2a2a, #1a1a1a 60%),
    linear-gradient(120deg, #1f1f1f, #262626, #1c1c1c);

  /* Badge */
  --badge-size: 16px;
  --badge-color: var(--color-white);
  --badge-bg: rgba(252, 7, 7, 0.914);
  --badge-font: var(--font-xxsmall);
  --badge-border-radius: 50%;
  --badge-animation-duration: 0.3s;
}

/* =============================
   Reset
============================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background: rgba(32, 32, 32, 0.95);
}
#nick-top {
  font-weight: bold;
  color: #0cbb98; /* blue */
  font-size: var(--font-small);

}
/* presence/user list styles */
.user-nick { padding: 4px 6px; list-style: none; }
.user-nick--online { color: #0f8a0f; font-weight: 600; }
.user-nick--idle { color: #666; opacity: 0.8; }
.user-nick--away { color: #484848; opacity: 0.7; }
.user-nick--offline { color: #999; opacity: 0.6; }

/* top nick and room */
.top-nick { font-weight: 700; }
.room-name { color: #666; font-style: italic; }

/* message parts */
.message.system-message { background: rgb(253, 250, 250); color: #333; display:flex; align-items:center; padding:6px 8px; border-radius:4px; margin:4px 0; }
.system-avatar { width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; margin-right:6px; font-size:14px; }
.message-nick.system-nick { font-weight:700; margin-right:6px; }
.message-content.system-content { color:#af1212; }

/* small separator */
.user-list-sep { font-style: italic; color: #f1efef; padding-top: 6px; padding-bottom: 4px; }
#room {
  font-weight: bold;
  color: #02968d; /* red */
  font-size: var(--font-small);

}
/* =============================
   Typography
============================= */
.font-xxsmall { font-size: var(--font-xxsmall); }
.font-small   { font-size: var(--font-small); }
.font-medium  { font-size: var(--font-medium); }
.font-big     { font-size: var(--font-big); }

/* =============================
   Icons
============================= */
.icon-size  { font-size: var(--icon-size); }
.icon-color { color: var(--color-gray); }


/* =============================
   Header
============================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: rgba(22, 22, 22, 0.95);
  border-top: 1px solid #adadad;
  border-bottom: 1px solid #010101;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  z-index: 1000;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left .icon-btn, .header-right .icon-btn {
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* =============================
   Notification / Chat Badges
============================= */
.badge-wrapper {
  position: relative;
  display: inline-block;
}

.badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: var(--badge-font);
  font-weight: bold;
  color: var(--badge-color);
  background-color: var(--badge-bg);
  border-radius: var(--badge-border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease-in-out;
}

.badge-pop { transform: scale(1.3); }

/* =============================
   Sidebars
============================= */
.left-sidebar,
.right-sidebar {
  position: fixed;
  top: 50px;
  bottom: 0;
  width: 200px;
  background: var(--bg-noisy);
  backdrop-filter: blur(8px);
  color: var(--color-light);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  padding: 0;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.3);
}

.left-sidebar { left: 0; transform: translateX(-100%); border-radius: 0 8px 8px 0; }
.right-sidebar { right: 0; transform: translateX(100%); border-radius: 8px 0 0 8px; }

.left-sidebar .top-left-sidebar,
.right-sidebar .top-right-sidebar {
  flex: 0 0 12%;
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.left-sidebar .bottom-left-sidebar,
.right-sidebar .bottom-right-sidebar {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.sidebar-header {
  font-size: var(--font-medium);
  margin-bottom: 10px;
  color: var(--color-light);
  font-weight: 600;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  z-index: 998;
  transition: opacity 0.3s ease;
}

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

/* =============================
   Chat Area
============================= */
.chat-container {
  margin-top: 50px;
  margin-left: 0;
  margin-right: 0;
  padding-bottom: 5px;
  height: calc(100vh - 50px);
  display: flex;
  flex-direction: column;
  transition: margin 0.3s ease;
  background: rgba(0, 0, 0, 0.95);
}

.message-background {
  flex: 1;
  overflow-y: auto;
  background: rgba(9, 9, 9, 0.8);
  padding: 3px;
}
.messages {
  color: var(--color-green);

}
/* =============================
   Chat Input
============================= */
.chat-input {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  background: var(--bg-noisy);
  border-radius: 6px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.678);
  flex-shrink: 0;
}

.chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.emoji-btn { font-size: 20px; flex-shrink: 0; }

.input-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}

.input-wrapper input {
  width: 100%;
  padding: 6px 36px 6px 8px;
  border-radius: 6px;
  background: rgba(22, 22, 22, 0.95);
  border-top: 1px solid #adadad;
  border-bottom: 1px solid #010101;
  color: var(--color-light);
  font-size: 16px;
  outline: none;
  transition: border 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}

.input-wrapper input:focus {
  border-color: var(--color-green);
  background: rgba(15, 15, 15, 0.95);
}

.send-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray);
  pointer-events: none;
  transition: color 0.2s ease;
}

.input-wrapper input:focus + .send-btn {
  color: var(--color-green);
  pointer-events: auto;
}

.chat-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.chat-input .icon-size { font-size: var(--icon-size); }
.chat-input .icon-color { color: var(--color-gray); }

/* =============================
   Responsive
============================= */
@media (min-width: 768px) {
  .left-sidebar { transform: translateX(0); }
  .right-sidebar { transform: translateX(0); }
  .header-left .mobile-icon, .header-right .mobile-icon { display: none; }
  .chat-container { margin-left: 200px; margin-right: 200px; }
}

@media (max-width: 767px) {
  .header-left .mobile-icon, .header-right .mobile-icon { display: flex; }
}

/* =============================
   Chat Top Info
============================= */
.chat-top-info {
  padding: 0 0 4px 0;
  font-size: var(--font-small);
  color: var(--color-light);
  background: rgba(30,30,30,0.85);
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.chat-typing {
  padding: 2px 0;
  font-size: var(--font-small);
  color: var(--color-gray);
  min-height: 18px;
  margin-bottom: 2px;
  background: rgba(20,20,20,0.85);
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.chat-top-info span,
.chat-typing span {
  padding-left: 6px;
  display: inline-block; 
}

/* Nick style */
#nick-top {
  font-weight: bold;
  color: #0cbb98; /* blue */

}

/* Room style */
#room {
  font-weight: bold;
  color: #02968d; /* red */

}


/* each message */
.message-background div {
  background: #ffffff;
  color: #e20e0e;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  max-width: 70%;
  width: fit-content;
  word-break: break-word;

  /* nice alignment feel without "own messages" */
  align-self: flex-start;

  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}