/* GLOBAL RESET & BASE */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #ff7e5f, #feb47b);
}


/*GENERIC UTILITIES */
.hidden {
  display: none;
}

.hidden {
  display: none !important;
}


/* AUTH WRAPPER (LOGIN / REGISTER BACKGROUND) */
#authWrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, #ff7e5f, #feb47b);
}


/*AUTH BOX (CARD) */
#authBox {
  background: white;
  padding: 30px;
  border-radius: 16px;
  width: 300px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  text-align: center;
}

#authBox h2 {
  margin-bottom: 20px;
}


/* AUTH INPUTS */
#authBox input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
  outline: none;
  transition: 0.2s;
}

#authBox input:focus {
  border-color: #667eea;
  box-shadow: 0 0 5px rgba(102,126,234,0.5);
}


/*AUTH BUTTONS */
.auth-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.auth-buttons button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #667eea;
  color: white;
  cursor: pointer;
  transition: 0.2s;
}

.auth-buttons button:hover {
  background: #5a67d8;
}


/*  AUTH TABS */
.auth-tabs {
  display: flex;
  margin-bottom: 15px;
}

.auth-tabs button {
  flex: 1;
  padding: 10px;
  border: none;
  background: #eee;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: 0.2s;
}

.auth-tabs button.active {
  background: #667eea;
  color: white;
  font-weight: bold;
}


/*  AUTH FORM */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form button {
  margin-top: 10px;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #667eea;
  color: white;
  cursor: pointer;
}

.auth-form button:hover {
  background: #5a67d8;
}


/*  MAIN LAYOUT */
#mainContent {
  flex: 1;
  height: 100%;
}


/* CREATE ROOM PANEL */
.create-room-box {
  background: white;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.create-room-box h3 {
  margin: 0;
  font-size: 16px;
}

.create-room-box input {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ccc;
  outline: none;
  transition: 0.2s;
}

.create-room-box input:focus {
  border-color: #667eea;
  box-shadow: 0 0 5px rgba(102,126,234,0.4);
}

.create-room-box button {
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: #667eea;
  color: white;
  cursor: pointer;
  transition: 0.2s;
}

.create-room-box button:hover {
  background: #5a67d8;
}


/* ROOMS LIST */
#rooms {
  list-style: none;
  padding: 0;
  margin: 0;
}

#rooms li {
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  cursor: pointer;
  border-radius: 6px;
  transition: 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#rooms li:hover {
  background: #e0e0e0;
}

#rooms li:active {
  transform: scale(0.98);
}

.delete-room {
  margin-left: 10px;
  cursor: pointer;
}


/* USERS PANEL (LEFT) */
#usersPanel {
  float: left;
  width: 200px;
  height: 70vh;
  overflow-y: auto;

  padding: 12px;
  background: white;
  border-radius: 12px;
  border: 1px solid #eee;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

#usersPanel h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  position: sticky;
  top: 0;
  background: white;
}

#usersList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#usersList li {
  padding: 6px 8px;
  border-radius: 8px;
  margin-bottom: 5px;
  background: #f1f2f6;
  transition: 0.2s;
}

#usersList li:hover {
  background: #e3e6ff;
  cursor: pointer;
}


/*CHAT CONTAINER (CENTER) */
#chatContainer {
  float: left;
  width: calc((100% - 220px) / 3);
  height: 70vh;

  margin: 0 10px;
  background: white;

  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);

  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-active {
  background: white;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}


/*  CHAT HEADER */
#chatContainer h2 {
  padding: 15px;
  margin: 0;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}


/* MESSAGES */
#messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#messages li {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #c3cdf5;
}


/* MESSAGE STRUCTURE */
.msg-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.msg-content {
  flex: 1;
  word-break: break-word;
}

.msg-actions {
  margin-top: 4px;
  font-size: 14px;
}


/* MESSAGE ACTIONS (DELETE / LIKE) */
.delete-msg {
  margin-left: 10px;
  cursor: pointer;
  background: transparent;
  border: none;
  font-size: 16px;
}

.like-btn {
  display: flex;
  align-items: center;
  gap: 4px;

  background: #f1f2f6;
  border: none;
  border-radius: 8px;
  padding: 2px 6px;

  cursor: pointer;
  font-size: 13px;

  transition: 0.2s;
}

.like-btn:hover {
  background: #e3e6ff;
}

.like-btn.liked {
  background: #4CAF50;
  color: white;
  cursor: not-allowed;
  opacity: 0.7;
}


/*  MESSAGE INPUT BOX */
#messageBox {
  border-top: 1px solid #eee;
  padding: 10px;
  display: flex;
  gap: 10px;
}

#message {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ccc;
  outline: none;
}

#messageBox button {
  padding: 10px 15px;
  border: none;
  border-radius: 10px;
  background: #4CAF50;
  color: white;
  cursor: pointer;
}


/* RIGHT PANEL */
#rightPanel {
  float: left;
  width: calc((100% - 220px) * 2/3);
  height: 70vh;

  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);

  display: flex;
  flex-direction: column;
  overflow-y: auto;

  padding: 15px;
}

.owner-name {
  color: #e6b800;
  font-weight: bold;
}

#banPanel {
  background: rgba(255, 0, 0, 0.05);
  border-radius: 8px;
  padding: 8px;
}