/* --- Messenger Inspired Variables --- */
:root {
  --messenger-blue: #0084ff;
  --bg-gray: #f0f2f5;
  --surface-white: #ffffff;
  --text-dark: #050505;
  --text-gray: #65676b;
  --bubble-gray: #e4e6eb;
  --error-red: #fa3e3e;
  --font-main: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--surface-white);
  color: var(--text-dark);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header & Navigation --- */
header {
  padding: 10px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: var(--surface-white);
  position: sticky;
  top: 0;
  z-index: 10;
}

nav ul {
  display: flex;
  justify-content: flex-end;
  list-style: none;
  gap: 20px;
}

nav a {
  text-decoration: none;
  color: var(--messenger-blue);
  font-weight: 600;
  font-size: 0.9rem;
}

/* --- Main Layout --- */
#main {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 50px); /* Adjust based on header height */
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* --- Chat Area --- */
.chat {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--surface-white);
}

.message {
  max-width: 70%;
  align-self: flex-start;
  background-color: var(--bubble-gray);
  padding: 8px 12px;
  border-radius: 18px;
  position: relative;
}

/* Style for Member-only details */
.message .info {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--text-gray);
}

.message .author {
  font-weight: bold;
}

.message .text {
  font-size: 0.95rem;
  line-height: 1.4;
}

.userMessage {
  align-self: flex-end;
  background-color: var(--messenger-blue);
  color: white;
}

.userMessage .info,
.userMessage .author {
  color: #ffffffcc;
}

/* --- Send Message Snippet (Bottom Bar) --- */
#send-message {
  padding: 15px 20px;
  background: var(--surface-white);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

#send-message form {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#send-message textarea {
  flex: 1;
  background-color: var(--bg-gray);
  border: none;
  border-radius: 20px;
  padding: 10px 15px;
  resize: none;
  height: 40px;
  font-family: inherit;
  outline: none;
}

#send-message button {
  border-radius: 20px;
}
/* --- Auth Pages (Sign Up / Log In) --- */
#sign-up,
#log-in,
#be-member,
main:not(#main) {
  max-width: 400px;
  margin: 100px auto;
  text-align: center;
  padding: 20px;
}

h1 {
  margin-bottom: 20px;
  font-size: 1.5rem;
  color: var(--messenger-blue);
}

h3 {
  margin-bottom: 20px;
  font-size: 1.2rem;
  color: var(--text-gray);
}
#sign-up h1,
#log-in h1 {
  font-size: 2rem;
  margin: 20px auto;
}

form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background-color: var(--bg-gray);
  font-size: 1rem;
}

button[type="submit"] {
  background-color: var(--messenger-blue);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
}

button[type="submit"]:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.auth-footer {
  margin-top: 20px;
  font-size: 0.9rem;
}

/* --- Error Styling --- */
.error {
  color: var(--error-red);
  font-size: 0.8rem;
  text-align: left;
  margin-top: -8px;
  margin-bottom: 5px;
}
#error {
  text-align: center;
}
#error h1 {
  font-size: 1.2rem;
  margin: 30px auto;
  color: var(--error-red);
}

/* --- Membership Page Specifics --- */
#be-member h1 p {
  font-size: 0.9rem;
  color: var(--text-gray);
  margin-top: 5px;
}

#be-member small {
  color: var(--text-gray);
  display: block;
  margin-top: 5px;
  margin-bottom: 10px;
}

.confirm h1 {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 30px auto;
  padding: 30px;
  color: var(--messenger-blue);
}

.confirm a {
  display: inline-block;
  padding: 12px 20px;
  background-color: var(--messenger-blue);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
}
