/* ========== KONTAINER UTAMA ========== */
#message-container {
  position: fixed;
  top: 20px;                /* Jarak dari atas */
  left: 50%;                /* Tengah layar */
  transform: translateX(-50%);
  z-index: 1050;            /* Di atas elemen lain */
  display: flex;
  flex-direction: column;
  align-items: center;   /* pastikan anak-anaknya rata tengah */
}

/* ========== STYLE DASAR ALERT BOX ========== */
.alert-box {
  position: relative;
  background: #fff;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  width: max-content;
  max-width: 90vw;
  overflow-x: auto;
  font-family: sans-serif;
}

.text-green  { color: #28a745; font-weight: 500; }
.text-red    { color: #dc3545; font-weight: 500; }
.text-yellow { color: #ffc107; font-weight: 500; }

/* ========== WARNA TIPE ALERT ========== */
.alert-box.success { border-left: 4px solid #28a745; }
.alert-box.error   { border-left: 4px solid #dc3545; }
.alert-box.warning { border-left: 4px solid #ffc107; }

/* ========== WARNA PROGRESS TIPE ALERT ========== */
.alert-box.success .progress .progress-fill { background: #28a745; }
.alert-box.error   .progress .progress-fill { background: #dc3545; }
.alert-box.warning .progress .progress-fill { background: #ffc107; }

/* ========== ISI PESAN DAN TOMBOL TUTUP ========== */
.alert-box .message {
  flex: 1;
  color: #333;
  white-space: nowrap;     /* <- ini yang mencegah teks turun ke baris baru */
}
.alert-box .close-btn {
  margin-left: 12px;
  cursor: pointer;
  font-size: 16px;
  color: #999;
}

/* ========== PROGRESS BAR ========== */
.alert-box .progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0,0,0,0.1);
  overflow: hidden;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

.alert-box .progress .progress-fill {
  width: 100%;         /* Mulai penuh, disusutkan oleh JS */
  height: 100%;
  background: #28a745; /* Default: success */
}
