:root {
  --accent: #5865f2;
  --bg: #f6f6fa;
  --sidebar-bg: #ffffff;
  --input-bg: #efefef;
  --border: #ddd;
  --text-dark: #222;
  --text-light: #888;
}
body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
}
header {
  background: var(--accent);
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
nav a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}
.chat-container {
  display: flex;
  max-width: 1200px;
  margin: 2rem auto;
  min-height: 70vh;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 28px #b3b3b343;
  background: #fff;
}
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.sidebar section h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--accent);
}
.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar li {
  margin: 0.5rem 0;
}
.sidebar a.btn {
  display: block;
  background: var(--accent);
  color: #fff;
  margin-top: 1rem;
  padding: 0.5rem 0;
  text-align: center;
  border-radius: 4px;
  text-decoration: none;
}
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
#chatbox.messages {
  flex: 1;
  min-height: 300px;
  max-height: 55vh;
  overflow-y: auto;
  background: #fff;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}
#msgform {
  display: flex;
  gap: 1rem;
  background: var(--input-bg);
  padding: 1rem;
  border-top: 1px solid var(--border);
}
#msgform input[name=msg] {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.7rem;
  font-size: 1rem;
  background: #fff;
}
#msgform input[type=file] {
  flex: 1;
}
#msgform button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.8rem 1.4rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
#msgform button:hover {
  background: #404eed;
}

/* Responsive */
@media (max-width: 900px) {
  .chat-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    gap: 1rem;
  }
  .sidebar section {
    flex: 1;
  }
}
@media (max-width: 600px) {
  header, .chat-container {
    margin: 0;
    border-radius: 0;
  }
  .chat-container {
    box-shadow: none;
  }
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.auth-form {
  background: #fff;
  padding: 2rem 2.2rem;
  border-radius: 6px;
  box-shadow: 0 4px 28px #b3b3b343;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.auth-form h2 {
  color: var(--accent);
  margin-bottom: .3rem;
}
.auth-form input {
  font-size: 1rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  padding: .75rem .9rem;
}
.auth-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: .8rem 1rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}
.auth-form p {
  color: var(--text-light);
  font-size: .98rem;
  text-align: center;
}
.auth-form a { color: var(--accent); text-decoration: underline; }


header nav a {
  color: white; /* Or your theme color */
  text-decoration: none;
  font-weight: bold;
  margin-left: 1rem;
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

header nav a:hover {
  background-color: #444bb7; /* Slightly darker accent */
}


header nav span {
  color: white;
  font-weight: 600;
  margin-right: 15px;
  font-family: Arial, sans-serif;
}
/* ------------------- */

body, html {
  margin: 0; padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f6f6fa;
}
header {
  background: #5865f2;
  color: white;
  padding: 1rem;
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
}
header h1 { margin: 0; }
#headerMenu {
  display: flex; gap: 1rem; flex-wrap: wrap; align-items: center;
}
#headerMenu a {
  color: white;
  font-weight: 600;
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  transition: background 0.2s;
}
#headerMenu a:hover {
  background: #404eed;
}
@media (max-width: 700px) {
  #headerMenu {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding-top: 0.4rem;
  }
  header {
    flex-direction: column;
    align-items: flex-start;
  }
}
.outer-container {
  max-width: 700px;
  margin: 2rem auto;
  background: #fff;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(110,110,160,0.11);
}
@media (max-width: 700px) {
  .outer-container { padding: 0.8rem; }
}
ul {
  list-style: none;
  padding-left: 0;
}
li { margin-bottom: 0.5rem; }



body, html {
  margin: 0; padding: 0; min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f6f6fa;
  color: #222;
}
/* Header styles */
header {
  background: #5865f2;
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  flex-wrap: wrap;
}
header h1 {
  margin: 0; font-weight: 700; letter-spacing: 1px;
}
header nav {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  font-weight: 600;
}
header nav a, header nav span {
  color: white; font-weight: 600; padding: 0.3rem 0.7rem; border-radius: 5px;
  transition: background 0.2s;
}
header nav a:hover {
  background: #404eed; color: #fff; text-decoration: none;
}
/* Hamburger for mobile */
#mobileMenuToggle {
  font-size: 2rem; background: none; border: none; color: white;
  cursor: pointer; margin-left: 1rem; display: none;
}
/* Sidebar */
#sidebar {
  position: fixed; top: 64px; left: 0; width: 270px; height: calc(100% - 64px);
  background: white; border-right: 1px solid #ddd; padding: 1.2rem 1.2rem 1.2rem 1rem;
  overflow-y: auto; transform: translateX(0); transition: transform 0.3s ease; z-index: 1000;
}
#sidebar.hide { transform: translateX(-100%); }
#sidebar.show { transform: translateX(0); }
#sidebar h2 { margin-top: 0; font-weight: 700; font-size: 1.1rem; color: #5865f2; }
#sidebar ul { list-style: none; padding-left: 0; margin: 0 0 1.3rem 0; }
#sidebar li { margin: 0.4rem 0; }
#sidebar ul a { color: #454fcc; font-weight: 500; border-radius: 4px; padding: 0.2rem 0.3rem; }
#sidebar ul a:hover { background: #e0e6fd; }
#sidebar nav { margin-top: 0.8rem; font-weight: 600; }
#sidebar nav a { display: block; margin: 0.3rem 0; color: #5865f2; }
#sidebar nav a:hover { background: #eff2fe; }
#sidebar nav a:last-child { color: #d73838; }
/* Chat Section */
#chatSection {
  margin-left: 270px; padding: 1.5rem 2rem 2rem 2rem;
  min-height: calc(100vh - 64px); box-sizing: border-box;
}
#chatbox {
  border: 1px solid #ccc; height: 350px; max-width: 900px; margin-bottom: 1rem;
  overflow-y: auto; padding: 1rem; border-radius: 8px;
  background: #fff; box-shadow: 0 0 8px rgba(0,0,0,0.05); word-wrap: break-word;
}
#msgform {
  display: flex; max-width: 900px; gap: 0.8rem; align-items: flex-start;
}
#msgform input[name=msg] {
  flex-grow: 1; padding: 0.6rem 1rem; font-size: 1rem; border-radius: 6px; border: 1px solid #ccc;
}
#msgform input[type=file] { width: 180px; }
#msgform button {
  background-color: #5865f2; color: white; border: none; font-weight: 600;
  padding: 0 1.3rem; border-radius: 6px; cursor: pointer; transition: background 0.2s ease;
}
#msgform button:hover { background-color: #404eed; }
/* Responsive styles for mobile */
@media (max-width: 768px) {
  #mobileMenuToggle { display: block; }
  #sidebar { top: 56px; height: calc(100% - 56px); transform: translateX(-100%); box-shadow: 2px 0 6px rgba(0,0,0,0.15); }
  #sidebar.show { transform: translateX(0); }
  #chatSection { margin-left: 0; padding: 1.2rem 0.5rem 1.5rem 0.5rem; }
  #chatbox { height: 220px; max-width: 100vw; box-sizing: border-box; }
  #msgform { max-width: 100vw; padding: 0; }
  #msgform input[type=file] { width: 110px;}
  header { flex-direction: column; align-items: stretch; padding: 1rem 0.7rem 0.7rem 0.7rem;}
  #headerMenu { flex-direction: column; gap: 0.15rem; align-items: flex-start; padding-top: 0.5rem; }
}
a:focus, button:focus, input:focus { outline: 2px solid #5865f2; }

footer {
  width: 100%;
  background-color: #f1f1f1;
  padding: 1rem 0;
  position: fixed;
  bottom: 0;
  left: 0;
  color: #888;
  font-size: 0.9rem;
  text-align: center;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

body {
  margin-bottom: 50px; /* to prevent content overlap with fixed footer */
}



 /* Reset & basics */
  body, html {
    margin: 0; padding: 0; height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  }
  a {
    text-decoration: none;
    color: #5865f2;
  }
  a:hover {
    text-decoration: underline;
  }

  /* Header */
  header {
    background: #5865f2;
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
  }
  header h1 {
    margin: 0;
  }
  header nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
  }
  header nav a, header nav span {
    color: white;
    font-weight: 600;
  }

  /* Mobile menu toggle (hamburger) button */
  #mobileMenuToggle {
    font-size: 1.8rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: none; /* shown only on mobile */
  }

  /* Sidebar */
  #sidebar {
    position: fixed;
    top: 64px; /* header height */
    left: 0;
    width: 280px;
    height: calc(100% - 64px);
    background: #fff;
    border-right: 1px solid #ddd;
    padding: 1rem;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
  }
  #sidebar.hide {
    transform: translateX(-100%);
  }
  #sidebar h2 {
    margin-top: 0;
  }
  #sidebar ul {
    list-style: none;
    padding-left: 0;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
  }
  #sidebar li {
    margin: 0.4rem 0;
  }
  #sidebar nav {
    margin-top: 1rem;
  }
  #sidebar nav a {
    display: block;
    margin: 0.3rem 0;
    font-weight: 600;
    color: #5865f2;
  }

  /* Main content/chat area */
  #chatSection {
    margin-left: 280px;
    padding: 1rem 2rem 2rem 2rem;
  }
  #chatbox {
    border: 1px solid #ccc;
    height: 350px;
    max-width: 900px;
    margin-bottom: 1rem;
    overflow-y: auto;
    padding: 1rem;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 0 8px rgba(0,0,0,0.05);
  }
  #msgform {
    display: flex;
    max-width: 900px;
    gap: 0.8rem;
  }
  #msgform input[name=msg] {
    flex-grow: 1;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid #ccc;
  }
  #msgform input[type=file] {
    width: 180px;
  }
  #msgform button {
    background-color: #5865f2;
    color: white;
    border: none;
    font-weight: 600;
    padding: 0 1.5rem;
    border-radius: 6px;
    cursor: pointer;
  }
  #msgform button:hover {
    background-color: #454fcc;
  }

  /* Responsive - mobile */
  @media (max-width: 768px) {
    #mobileMenuToggle {
      display: block;
    }
    #sidebar {
      top: 56px; /* smaller header padding if needed */
      transform: translateX(-100%);
      height: calc(100% - 56px);
      box-shadow: 2px 0 6px rgba(0,0,0,0.2);
    }
    #sidebar.show {
      transform: translateX(0);
    }
    #chatSection {
      margin-left: 0;
      padding: 1rem 1rem 2rem 1rem;
    }
    #chatbox {
      height: 250px;
      max-width: 100vw;
      box-sizing: border-box;
    }
    #msgform {
      max-width: 100vw;
      padding: 0;
    }
    #msgform input[type=file] {
      width: 100px;
    }

    #mobileMenuToggle {
  display: none;
}

#headerMenu {
  display: flex;
  gap: 15px;
}

@media (max-width: 768px) {
  #mobileMenuToggle {
    display: block;
  }
  #headerMenu {
    display: none; /* initially hide menu on mobile */
    flex-direction: column;
    background: #5865f2;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    padding: 1rem;
    z-index: 1000;
  }
  #headerMenu.show {
    display: flex;
  }
  #headerMenu a, #headerMenu span {
    color: white;
    font-size: 1.1rem;
  }
}

}


.message {
  background: #f4f6fa;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 16px;
  max-width: 75%;
  box-shadow: 0 2px 8px #dde4fa22;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.message-username {
  font-weight: 500;
  font-size: 0.92rem;
  color: #444;
}

.message-content {
  margin: 10px 0 0 0;
  font-size: 1.15rem;
  color: #23272f;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.message-time {
  font-size: 0.8rem;
  margin-top: 8px;
  color: #888;
  text-align: right;
}

