/* =======================
   Βασικό wrapper / τίτλος
   ======================= */

#rooms-wrapper {
  max-width: 850px;
  margin: 0 auto;
  color: #eee;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Roboto", sans-serif;
}

#rooms-wrapper h3 {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 600;
}

/* =======================
   Search box
   ======================= */

#rooms-wrapper #roomSearch {
  width: 40%;
  min-width: 240px;
  padding: 8px 10px;
  margin-bottom: 15px;
  border-radius: 20px;
  border: 1px solid #333;
  background: #ffffff;
  color: #111;
  outline: none;
  font-weight: 500;
  font-size: 14px;
}

#rooms-wrapper #roomSearch::placeholder {
  color: #777;
}

/* =======================
   Create-box (δημιουργία room)
   ======================= */

#rooms-create-box {
  background: #0f0f0f;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 20px 0 20px 0;
  border: 1px solid #242424;
}

#rooms-create-box .rc-title {
  font-size: 15px;
  color: #ddd;
  margin-bottom: 10px;
  font-weight: 600;
}

#rooms-create-box .rc-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
}

#rooms-create-box .rc-input {
  flex: 1 1 auto;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #050505;
  color: #eee;
  font-size: 14px;
  height: 38px;
}

#rooms-create-box .rc-input::placeholder {
  color: #666;
}

#rooms-create-box .rc-btn-create {
  padding: 0 16px;
  height: 38px;
  border-radius: 8px;
  border: none;
  background: #2980b9;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

#rooms-create-box .rc-btn-create:hover {
  background: #3498db;
}

#rooms-create-box .rc-btn-create:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#rooms-create-box .rc-help {
  margin-top: 10px;
  font-size: 12px;
  color: #aaa;
}

/* Responsive για κινητά */
@media (max-width: 600px) {
  #rooms-create-box .rc-row {
    flex-direction: column;
  }

  #rooms-create-box .rc-btn-create {
    width: 100%;
  }

  #rooms-wrapper #roomSearch {
    width: 100%;
  }
}

/* =======================
   Meta γραμμές (status / uptime)
   ======================= */

#rooms-container .meta {
  font-size: 13px;
  color: #aaa;
  margin: 4px 0 6px 0;
}

#rooms-container .meta .ok {
  color: #2ecc71;
  font-weight: 600;
}

#rooms-container .meta .warn {
  color: #e74c3c;
  font-weight: 600;
}

/* =======================
   Πίνακας rooms
   ======================= */

#rooms-container {
  overflow-x: auto;
}

#rooms-container table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 10px;
  overflow: hidden;
  background: #151515;
  color: #ddd;
  min-width: 360px;
}

#rooms-container th,
#rooms-container td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #222;
  font-size: 14px;
  white-space: nowrap;
}

#rooms-container th {
  background: #202020;
  color: #bbb;
  font-weight: 600;
  font-size: 13px;
}

#rooms-container tr:nth-child(even) {
  background: #181818;
}

#rooms-container tr:hover {
  background: #222;
}

/* Τρέχον room highlight */

#rooms-container .current-room-row {
  background: #102a1a !important;
}

#rooms-container .current-room-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 11px;
  background: #27ae60;
  color: #fff;
  vertical-align: middle;
}

/* Λουκέτο */

#rooms-container .lock-icon {
  color: #f1c40f;
  margin-right: 4px;
}

/* Links, labels */

#rooms-container .roomLink {
  cursor: pointer;
  color: #0af;
  text-decoration: none;
}

#rooms-container .roomLink:hover {
  text-decoration: underline;
}

#rooms-container .userTag {
  color: #4af;
  font-weight: 500;
}

/* =======================
   Κουμπιά ενεργειών
   ======================= */

#rooms-container .room-action-btn {
  padding: 6px 10px;
  margin-left: 6px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

#rooms-container .connect-room-btn {
  background: #27ae60;
  color: #fff;
}

#rooms-container .connect-room-btn:hover:not([disabled]) {
  background: #2ecc71;
}

#rooms-container .connect-room-btn[disabled],
#rooms-container .connect-room-btn[aria-disabled="true"] {
  opacity: 0.7;
  cursor: default;
}

#rooms-container .delete-room-btn {
  background: #c0392b;
  color: #fff;
}

#rooms-container .delete-room-btn:hover {
  background: #e74c3c;
}

/* =======================
   Server controls (Restart / Stop)
   ======================= */

#server-controls {
  margin-bottom: 10px;
}

#server-controls button {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  margin-right: 8px;
}

#server-controls button:first-child {
  /* Restart */
  background: #f39c12;
  color: #fff;
}

#server-controls button:last-child {
  /* Stop */
  background: #c0392b;
  color: #fff;
}

/* =======================
   Modal (λίστα χρηστών ανά room)
   (αν το modal έχει IDs usersModal / modalUserList κτλ)
   ======================= */

#usersModal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;            /* ενεργοποιείται από JS */
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#usersModal .modal-content {
  background: #111;
  border-radius: 12px;
  padding: 16px 18px;
  max-width: 420px;
  width: 90%;
  border: 1px solid #333;
  color: #eee;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

#usersModal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

#usersModal .modal-title {
  font-size: 16px;
  font-weight: 600;
}

#usersModal .modal-close {
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: #bbb;
}

#usersModal .modal-close:hover {
  color: #fff;
}

#usersModal #modalUserList {
  font-size: 14px;
  margin-bottom: 8px;
}

#usersModal #modalLastSync {
  font-size: 12px;
  color: #bbb;
}
