.p2psecret_toolbox {
  display: flex;
  justify-content: center;   /* center horizontal */
  align-items: center;       /* center vertical */
  flex-direction: column;    /* konten ditumpuk vertikal */
  text-align: center;

  padding: 40px 20px;
  margin: 0 auto;

  max-width: 1200px;         /* biar gak kepanjangan di layar besar */
  width: 100%;

  background: linear-gradient(135deg, #f0f8ff 0%, #d6eaf8 100%);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 🔹 Konten di dalam toolbox */
.p2psecret_toolbox > * {
  max-width: 90%;
  margin: 10px 0;
}

/* 🔹 Responsive */
@media (max-width: 768px) {
  .p2psecret_toolbox {
    padding: 25px 15px;
  }
  div#chatSection {
    padding: 10px 0;
  }
}

@media (max-width: 480px) {
  .p2psecret_toolbox {
    padding: 20px 10px;
    border-radius: 10px;
  }
}

.hidden {
  display: none !important;
}

button {
    background: #376b91;
    border: none;
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
button:hover {
  background: #274d68;
}
button:disabled {
    background: #b5b5b5;
    color: #ffffff;
    cursor: not-allowed;
}

/* ====== MAIN CONTAINER ====== */
#chatSection, #hostSection, #guestSection, #roleSelection, #nameSection {
    background: #fff;
    color: #3c3c3c;
    width: 100%;
    max-width: 600px;
    margin-top: 20px;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}
#nameSection input, #joinGroupSection input, #groupInfoSection input {
    padding: 15px 5px;
    border-radius: 15px;
    border: solid 1px #d5d5d5;
    resize: none;
    max-height: 50px;
    margin-bottom: 10px;
    text-align: center;
    font-size: 16px;
}
#roleSelection p {
    margin: 0 0 10px;
}
#groupSelection p {
    color: #000000;
    font-size: 18px;
    margin: 0 0 5px;
}
#groupSelection p span {
    color: #080808;
    margin-left: 5px;
    font-weight: bold;
}

/* ====== USER LIST ====== */
.user-list {
    background: #f7f7f7;
    color: #555;
    width: 100%;
    max-width: 600px;
    margin-top: 10px;
    border-radius: 10px;
    padding: 10px 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: left;
}
.user-list strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #555;
}
.user-item {
  padding: 6px 10px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: #333;
  border-left: 4px solid #25d366;
}
.user-item:last-child {
  margin-bottom: 0;
}

/* Label khusus */
.user-item::after {
  content: attr(data-label);
  font-size: 12px;
  color: #777;
  margin-left: 6px;
  font-style: italic;
}
.user-item.me {
  background: #dcf8c6;
}

/* ====== CHAT BOX ====== */
#chatBox {
    background: #242424 url(../background-UI.jpg);
    height: 300px;
    overflow-y: auto;
    padding: 10px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
}

/* Bubbles */
.chat-bubble {
  max-width: 75%;
  padding: 4px 8px;
  margin: 5px 0;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.chat-self {
  align-self: flex-end;
  background: #cafff5;
  border-bottom-right-radius: 0;
}
.chat-other {
  align-self: flex-start;
  background: #fff;
  border-top-left-radius: 0;
}
.chat-bubble strong {
    font-size: 12px;
    color: #9d4d4d;
    margin-bottom: 2px;
}
.chat-bubble.chat-system {
    width: 100%;
    max-width: none;
    text-align: center;
    background: #ffffff24;
    color: #bfbfbf;
    font-style: italic;
    font-size: 13px;
    border-radius: 0;
    padding: 4px 0;
    box-shadow: none;
    align-self: center;
    margin: 1px 0;
}
.chat-bubble.chat-system.chat-primary {
    background: #fffbe6;
    color: #7a7a7a;
}
/* ====== INPUT ====== */
#messageInput {
  width: calc(100% - 80px);
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid #ccc;
  outline: none;
  font-size: 14px;
}
#messageInput:focus {
  border-color: #25d366;
}

#chatSection button {
  margin-left: 5px;
}

/* ====== ROOM INFO ====== */
#roomInfo, #guestSection, #nameSection {
  display: flex;
  flex-direction: column;  /* susun vertikal */
  align-items: center;     /* rata tengah horizontal */
  text-align: center;
}

#hostRoomId, #guestRoomIdInput, #userNameInput {
  width: 100%;
  max-width: 250px;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 0;
  text-align: center;
  margin-bottom: 10px;
  font-size: 14px;
  resize: none;
}

/* Tombol sejajar */
.room-buttons {
  display: flex;
  gap: 10px;              /* jarak antar tombol */
  justify-content: center;
  width: 100%;
}

#groupIdDisplay {
    background: #fff;
    color: #000;
    margin-bottom: 14px;
    border: solid 1px #d7d7d7;
    border-radius: 8px;
    padding: 3px 8px;
}

/* ====== LOADING BUTTON ====== */
button.loading {
  color: transparent;          /* teks hilang */
  pointer-events: none;
  position: relative;
}

/* Spinner using pseudo-element so we don't need extra markup */
button.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.2em;
  height: 1.2em;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: rgba(0,0,0,0.8);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spin 0.8s linear infinite;
}

/* keyframes */
@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}