/* Reset & globals */
body, html {
  margin: 0; padding: 0;
  font-family: sans-serif;
  background: #1a1a1a;
  color: #eee;
}
.top-bar {
  display: flex; align-items: center; padding: 0.5rem 1rem;
  background: #0f121a; color: #fff;
}
.top-bar button {
  background: none; border: none; color: #fff;
  cursor: pointer; margin-right: 1rem;
}
.top-nav { margin-left: auto; display: flex; gap: 1rem; }
.badge {
  background: #e74c3c; border-radius: 12px;
  padding: 0 6px; font-size: 0.8rem; line-height: 1.2;
}

/* Layout */
.chat-container {
  display: flex;
  height: calc(100vh - 3rem);
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: #111;
  display: flex;
  flex-direction: column;
  border-right: 2px solid #333;
}
.sidebar.collapsed { width: 60px; }

/* Users */
.sidebar-section.users {
  padding: 1rem; border-bottom: 1px solid #2e3c4e;
}
#userList { list-style: none; margin: 0; padding: 0; }
.user-entry {
  padding: 0.4rem 0.6rem; border-radius: 4px; cursor: pointer;
}
.user-entry:hover { background: #2e3c4e; }

/* Inbox */
.sidebar-section.inbox {
  padding: 1rem; border-top: 1px solid #2e3c4e;
}
.sidebar-section.inbox h3 {
  cursor: pointer;
  transition: background 0.2s;
}
.sidebar-section.inbox h3:hover {
  background: #2e3c4e;
}
/* Hide preview until opened */
.sidebar-section.inbox ul {
  display: none; list-style: none; margin: 0; padding: 0;
}
.sidebar-section.inbox.open ul { display: block; }
/* Highlight individual items */
#inboxList li {
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  transition: background 0.2s;
}
#inboxList li:hover { background: #2e3c4e; }

/* Blocklist */
.sidebar-section.blocklist {
  cursor: pointer; padding: 1rem; transition: background 0.2s;
}
.sidebar-section.blocklist:hover { background: #2e3c4e; }

/* Main panel */
.main-panel {
  flex: 1; display: flex; flex-direction: column; position: relative;
}
.main-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem; background: #222; border-bottom: 1px solid #444;
}
.thread-controls select {
  background: #333; color: #eee;
  border: none; border-radius: 4px; padding: 0.4rem;
}

/* Chat area */
#chatArea { flex: 1; overflow-y: auto; }
.messages {
  padding: 1rem; background: #1f1f1f;
}
.message {
  margin: 0.5rem 0; padding: 0.75rem;
  background: #2a2a2a; border-radius: 4px;
}
.username {
  color: #00b4d8; font-weight: bold; margin-right: 0.5rem;
}

/* Input bar */
.chat-form {
  display: flex; padding: 0.75rem 1rem;
  background: #222; border-top: 1px solid #333;
  position: sticky; bottom: 0; z-index: 10;
}
.chat-form input {
  flex: 1; padding: 0.75rem; background: #333; color: #eee;
  border: none; border-radius: 4px;
}
.chat-form button {
  margin-left: 0.5rem; padding: 0.75rem 1rem;
  background: #00b4d8; border: none; color: #fff;
  border-radius: 4px; cursor: pointer;
}
.chat-form button:hover { background: #0293b8; }

/* Room List Modal */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); display: flex;
  justify-content: center; align-items: center;
  z-index: 1000;
}
.modal.hidden { display: none; }
.modal-content {
  background: #222; padding: 1rem; border-radius: 6px;
  width: 300px; max-height: 80%; overflow-y: auto;
}
.modal-content h2 {
  margin-top: 0; color: #00b4d8;
}
#roomList {
  list-style: none; margin: 0; padding: 0;
}
#roomList li {
  padding: 0.5rem; cursor: pointer; border-bottom: 1px solid #333;
}
#roomList li:hover { background: #2e3c4e; }
#closeRoomList {
  margin-top: 0.5rem; padding: 0.5rem 1rem;
  background: #00b4d8; color: #fff; border: none;
  border-radius: 4px; cursor: pointer;
}
#closeRoomList:hover { background: #0293b8; }

/* Private‐chat modals */
.private-chat {
  position: absolute;
  top: 100px;
  left: 100px;
  width: 360px;
  height: 380px;
  background: #1f2430;
  border: 1px solid #2e3a49;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);

  /* make it a column flex container */
  display: flex;
  flex-direction: column;

  resize: both;
  /* allow only the messages area to overflow/scroll */
  overflow: hidden;
  user-select: none;
  z-index: 2000;
}

.private-chat.minimized {
  width: auto !important;
  height: auto !important;
}
.private-chat.minimized .messages,
.private-chat.minimized form {
  display: none;
}

/* Header (draggable) */
.private-chat .header {
  background: #2a2f3b;
  padding: 0.75rem 1rem;
  color: #fff;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}
.private-chat .header .controls button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  margin-left: 0.5rem;
  cursor: pointer;
}

/* Messages pane: flex‐grow + scroll */
.private-chat .messages {
  flex: 1 1 auto;
  padding: 0.75rem;
  background: #1f2430;
  overflow-y: auto;
}
/* Scrollbar styling */
.private-chat .messages::-webkit-scrollbar {
  width: 6px;
}
.private-chat .messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}

/* Input form at bottom */
.private-chat form {
  flex: 0 0 auto;      /* never grow, never shrink */
  display: flex;
  padding: 0.5rem 0.75rem;
  background: #2a2f3b;
  border-top: 1px solid #333;
}
.private-chat form input {
  flex: 1;
  padding: 0.5rem;
  background: #333;
  color: #eee;
  border: none;
  border-radius: 4px;
}
.private-chat form button {
  margin-left: 0.5rem;
  padding: 0.5rem 1rem;
  background: #00b4d8;
  border: none;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}
.private-chat form button:hover {
  background: #0293b8;
}
/* Login Box */
/* Add this to your style.css file */
.login-container {
  max-width: 420px;
  margin: 5rem auto;
  padding: 2.5rem;
  background: #252a34;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.login-container h2 {
  text-align: center;
  color: #00b4d8;
  margin: 0 0 2rem 0;
  font-size: 1.8rem;
  font-weight: 600;
}

.login-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #3a404c;
}

.login-tab {
  flex: 1;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  color: #aaa;
  font-weight: 500;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
}

.login-tab.active {
  color: #00b4d8;
  border-bottom-color: #00b4d8;
}

.login-tab:hover:not(.active) {
  color: #eee;
  border-bottom-color: #555;
}

.login-form {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}

.login-form.active {
  display: flex;
}

.login-form input {
  padding: 0.9rem 1rem;
  background: #2e3440;
  color: #eee;
  border: 1px solid #3a404c;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border 0.3s;
}

.login-form input:focus {
  outline: none;
  border-color: #00b4d8;
  box-shadow: 0 0 0 2px rgba(0,180,216,0.2);
}

.login-form button {
  padding: 1rem;
  background: #00b4d8;
  border: none;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s;
  margin-top: 0.5rem;
}

.login-form button:hover {
  background: #0293b8;
  transform: translateY(-1px);
}

.login-form button:active {
  transform: translateY(0);
}

.error {
  color: #ff6b6b;
  text-align: center;
  margin: -1rem 0 1rem 0;
  padding: 0.75rem;
  background: rgba(231, 76, 60, 0.1);
  border-radius: 6px;
  font-size: 0.9rem;
}

.password-hint {
  font-size: 0.8rem;
  color: #777;
  margin-top: -0.75rem;
  margin-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .login-container {
    margin: 2rem auto;
    padding: 1.5rem;
    width: 90%;
  }
  
  .login-tabs {
    flex-direction: column;
    border-bottom: none;
  }
  
  .login-tab {
    border-bottom: none;
    border-left: 2px solid transparent;
    text-align: left;
  }
  
  .login-tab.active {
    border-left-color: #00b4d8;
    border-bottom-color: transparent;
  }
}
/* Logout Button */
.logout-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1rem;
  background: none;
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  margin-left: 0.5rem;
  transition: background 0.2s, transform 0.1s;
}

.logout-btn:hover {
  background: #d62839;
  transform: translateY(-1px);
}

.logout-btn:active {
  transform: translateY(0);
}

.logout-btn .icon {
  margin-right: 0.5rem;
  font-size: 1.1rem;
  display: inline-block;
}
/* Private chat header block button */
.private-chat .header .block-btn {
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 0.9rem;
  margin-right: 0.5rem;
  padding: 0.2rem 0.5rem;
}

.private-chat .header .block-btn:hover {
  background: rgba(255, 107, 107, 0.1);
}

/* Disabled state for blocked users */
.private-chat .pm-form input:disabled,
.private-chat .pm-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Blocklist styles */
.sidebar-section.blocklist {
  padding: 1rem;
  border-top: 1px solid #2e3c4e;
  cursor: pointer;
}

.sidebar-section.blocklist:hover {
  background: #2e3c4e;
}

#blockedList {
  list-style: none;
  margin: 0;
  padding: 0;
}

#blockedList li {
  padding: 0.5rem;
  border-radius: 4px;
  margin: 0.25rem 0;
}

#blockedList li:hover {
  background: #2e3c4e;
}

#blockedList .empty {
  color: #777;
  font-style: italic;
}

#blockedList .error {
  color: #e74c3c;
}

.unblock-btn {
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.unblock-btn:hover {
  background: #c0392b;
}
/* Add to style.css */
/* Room List Modal */
#roomListModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

#roomListModal.hidden {
  display: none;
}

#roomListModal .modal-content {
  background: #252a34;
  padding: 20px;
  border-radius: 8px;
  width: 300px;
  max-height: 80vh;
  overflow-y: auto;
}

#roomListModal h2 {
  margin-top: 0;
  color: #00b4d8;
}

#roomList {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}

#roomList li {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #3a404c;
}

#roomList li:hover {
  background: #2e3c4e;
}

#closeRoomList {
  background: #00b4d8;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
}

/* Private Chat Windows */
#privateChats {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

.private-chat {
  position: absolute;
  width: 350px;
  height: 400px;
  background: #1f2430;
  border: 1px solid #2e3a49;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.private-chat .header {
  padding: 10px;
  background: #2a2f3b;
  color: white;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
}

.private-chat .messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.private-chat .pm-form {
  display: flex;
  padding: 10px;
  background: #2a2f3b;
  border-top: 1px solid #333;
}

.private-chat .pm-form input {
  flex: 1;
  padding: 8px;
  background: #333;
  color: #eee;
  border: none;
  border-radius: 4px;
}

.private-chat .pm-form button {
  margin-left: 8px;
  padding: 8px 12px;
  background: #00b4d8;
  border: none;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}

/* Main Chat Area */
#chatArea {
  flex: 1;
  overflow-y: auto;
  background: #1f1f1f;
}

#chatBox {
  padding: 15px;
}



.timestamp {
  color: #777;
  margin-right: 5px;
  font-size: 0.9em;
}

.username {
  color: #00b4d8;
  font-weight: bold;
  margin-right: 5px;
}

/* User List */
#userList {
  list-style: none;
  padding: 0;
  margin: 0;
}

.user-entry {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-entry:hover {
  background: rgba(0, 180, 216, 0.1);
}

.broadcast-indicator {
  color: #e74c3c;
  animation: pulse 1.5s infinite;
  cursor: pointer;
}

.flood-blocked {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ff4444;
    color: white;
    padding: 10px;
    text-align: center;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-weight: bold;
}

input:disabled, textarea:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}



.message.sending {
    opacity: 0.7;
}

.timestamp {
    color: #999;
    font-size: 0.8em;
}

.username {
    font-weight: bold;
}

.private-chat {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.private-chat.minimized {
    height: 40px;
    overflow: hidden;
}

.private-chat .header {
    background: #333;
    color: white;
    padding: 5px;
    cursor: move;
}

.private-chat .messages {
    height: 200px;
    overflow-y: auto;
    padding: 5px;
}

.private-chat .pm-form {
    display: flex;
    padding: 5px;
}

.private-chat .pm-form input {
    flex-grow: 1;
    margin-right: 5px;
}

.user-entry {
    cursor: pointer;
    padding: 5px;
}

.user-entry:hover {
    background: #f0f0f0;
}

.broadcast-indicator {
    font-size: 0.8em;
}

#flood-block-notice {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4444;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.flood-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}
.flood-alert {
    background: #ff4444;
    color: white;
    padding: 15px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 300px;
}
.flood-icon {
    font-size: 24px;
    margin-right: 15px;
}
.flood-content {
    flex: 1;
}
.flood-title {
    font-weight: bold;
    margin-bottom: 5px;
}
.flood-timer {
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 5px;
}
.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateY(20px); }
}
*/