/* === Dasar === */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  background: #000 url("asset/bg-admin.png") no-repeat center center fixed;
  background-size: cover;
  font-family: 'Segoe UI', sans-serif;
  color: rgb(212, 209, 209);
  margin: 0;
  padding: 0;
  padding-left: 1rem;
  padding-right: 1rem;
}



#adminPanel {
  background: rgba(31, 30, 30, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 1rem;
  padding: 2rem;
  min-width: 320px;
}

.container {
  max-width: 1200px;
  margin: 1rem auto 0 auto;
  box-sizing: border-box;
}


/* === Branding === */
.logo-section {
  text-align: left;
  margin-bottom: 1rem;
}

.logo-img {
  max-width: 180px;
  height: auto;
  margin-bottom: 0.5rem;
  display: inline-block;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.3));
}



.tagline {
  color: #b9b5b5;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

/* === Tombol Umum === */
button {
  background: #9862ca;
  color: rgb(36, 3, 44);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 1rem;
  font-weight: bold;
  transition: background 0.2s;
}

button:hover {
  background-color: #e0c200;
}

/* === Menu Konfigurasi === */
.menu {
  background: #181818;
  color: rgb(187, 173, 173);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  display: none;
}

.menu.show {
  display: block;
}

.config-group {
  margin-top: 1rem;
}

.config-group label {
  display: block;
  margin-bottom: 0.5rem;
}

.config-layout {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.config-column {
  flex: 1;
  min-width: 240px;
}
.config-column textarea {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.config-column input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  border-radius: 5px;
  border: none;
  background: #1f1f1f;
  color: #fff;
}

.config-column label {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.config-column input[type="range"],
.config-column input[type="color"] {
  width: 50px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
}
.config-column input[type="file"] {
  width: 100%;
  margin-top: 0.3rem;
}


/* === Layout Chat === */
.chat-section {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  flex-direction: row;
}

.chat-panel {
  flex: 1;
  background: #181818;
  border-radius: 12px;
  padding: 1rem;
}

.panel-title {
  font-weight: bold;
  color: #2bb681;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.panel-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

/* === Chat Item === */
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem; /* atau 0.8rem kalau mau lebih rapat */
  overflow-y: auto;
  max-height: 512px;
}



.chat-item {
  background: #292828;
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* biar semua mulai dari atas */
  gap: 1rem;                /* beri jarak antara teks dan tombol */
}

.chat-info {
  flex: 1;
  word-break: break-word;
  max-width: 100%;
}

.actions {
  display: flex;
  flex-direction: row;
  flex-shrink: 0; /* ⬅️ mencegah tombol menyusut atau pindah ke bawah */
  align-items: center;
  gap: 0rem;
}


.actions button {
  background: none;
  border: none;
  color: #ffd700;
  font-size: 1.2rem;
  margin-left: 0rem;
  cursor: pointer;
}

.actions button:hover {
  color: red;
}

/* === Login Panel === */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.login-container {
  background: rgba(31, 30, 30, 0.6);      /* transparan gelap */
  backdrop-filter: blur(12px);           /* efek blur */
  -webkit-backdrop-filter: blur(12px);   /* dukungan Safari */
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 400px;
  text-align: center;
  margin: 0 auto;
}


.login-subtitle {
  margin-top: 0.3rem;
  margin-bottom: 1.2rem;
  color: #9e9a9a;
  font-size: 0.9rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.login-container h2 {
  margin-bottom: 1rem;
  color: #c5b142;
}

.login-container input {
  width: 80%;                 /* Lebar dibatasi */
  max-width: 300px;           /* Maksimal lebar */
  padding: 0.5rem;
  margin: 0.5rem auto;        /* Tengah secara horizontal */
  display: block;             /* Agar margin auto berfungsi */
  border: none;
  border-radius: 5px;
  background: #585757;
  color: rgb(221, 213, 213);
}

.username-box {
  width: 30% !important;              /* ⬅️ lebih sempit */
  max-width: 180px;
  padding: 0.4rem;
  margin: 0.5rem auto 0.8rem auto;
  font-size: 1rem;
  text-align: center;
  background: #1a1919 !important;
  color: rgb(114, 110, 110) !important;
  border-radius: 6px;
}

.pin-instruction {
  margin-top: 1rem;      /* ⬅️ lebih dekat ke PIN */
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  color: #c5b142;
  letter-spacing: 1px;
}

.pin-input-group {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 0.3rem;
}

.pin-digit {
  width: 2.2rem !important;
  height: 2.8rem !important;
  font-size: 3rem !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: center;
  border-radius: 5px;
  border: none;
  background: #1a1919 !important;
  color: rgb(14, 184, 105) !important;
}



.error-message {
  color: #ff6666;
  font-size: 0.8rem;
  margin-top: 0.1rem;       /* ⬅️ lebih dekat dengan PIN */
  min-height: 1rem;
}
.toast {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 255, 0, 0.5);
  color: #f3f735;
  padding: 0.6rem 1rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: normal;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.4s ease, top 0.4s ease;
  z-index: 9999;
  max-width: 90%;
  text-align: center;
  border: 2px solid #ffffff80; /* warna putih transparan */
}

.toast.show {
  opacity: 1;
  top: 3rem;
}


/* === Responsif Mobile === */
@media (max-width: 767px) {
  .chat-section {
    flex-direction: column;
  }

  .chat-panel {
    max-width: 100%;
  }
  .config-layout {
    flex-direction: column;
  }
}

.chat-item.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.drop-target {
  outline: 2px dashed #ffd700;
}
.ai-flagged {
  background: rgba(255, 255, 0, 0.05);
  border-left: 3px solid #ffd700;
}

.meta-info::-webkit-scrollbar {
  display: none;
}

.inline-range-label {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.inline-range-label span {
  font-weight: bold;
  margin: 0 0.3rem;
}

.inline-range-label input[type="range"] {
  width: 100%;
  margin-top: 0.3rem;
}

.inline-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.inline-color-row label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  min-width: 100px;
  white-space: nowrap;
}


.inline-color-row input[type="color"] {
  width: 60px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.config-column textarea {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 6px;
  border: none;
  background: #1e1e1e;
  color: #fff;
  resize: none;
  overflow: hidden;
  box-sizing: border-box;
  min-height: 4.5em; /* set awal 3 baris */
  margin-bottom: 1rem;
}


.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.panel-header h4 {
  margin: 0;
  font-size: 1rem;
  color: #f0f0f0;
}

.button-right button {
  margin: 0;
  padding: 0.4rem 0.8rem;
}

.textarea-wrapper {
  position: relative;
}

#landingText {
  font-family: 'Segoe UI', sans-serif; /* Hindari monospace */
  white-space: pre-wrap;               /* Biar tetap wrap */
  word-break: break-word;              /* Biar panjang tetap wrap */
  width: 100%;
  padding: 0.6rem;
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1.4;
  resize: none; /* atau biarkan resize: vertical jika mau bisa manual */
  overflow: hidden;
  min-height: 4.5em;
  height: auto;
  box-sizing: border-box;
}

.char-indicator {
  position: absolute;
  bottom: 6px;
  right: 12px;
  font-size: 0.8rem;
  color: #999;
  font-style: italic;
}

.bg-row {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  margin-top: 0.5rem;
}

#bgPreview {
  width: 120px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 0 6px #0004;
}

.drop-zone {
  flex: 1;
  border: 2px dashed #ccc;
  padding: 1rem;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: center;
  align-items: center;
}

.drop-zone.dragover {
  background: rgba(255, 255, 0, 0.1);
  border-color: #ffd700;
}

.logo-wrapper {
  position: relative;
  width: 180px;
  height: 60px;
  margin: 0 auto; /* agar wrapper di tengah */
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  z-index: 2;
  position: relative;
}

.logo-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 32px;
  height: 32px;
  pointer-events: none; /* agar tidak ganggu klik */
}

.logo-loader::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border: 3px solid #ffd700;
  border-top: 3px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden-logo {
  visibility: hidden;
}
