/* ===== Global Reset ===== */
body {
  font-family: sans-serif;
  background: #121212;
  color: #ffffff;
  margin: 0;
  padding: 0;
  text-align: center;
  animation: fadein 1s ease-in;
}

@keyframes fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Header ===== */
.header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: #1f1f1f;
  gap: 20px;
  flex-wrap: wrap;
}

.logo img {
  height: 80px;
  background: white;
  padding: 10px;
  border-radius: 10px;
}

.title-text {
  text-align: center;
}

.title-text h1,
.title-text h3 {
  margin: 5px 0;
  color: #ffffff;
}

/* ===== Barcode Input ===== */
.barcode-box {
  margin: 20px;
}

.barcode-box input {
  font-size: 24px;
  padding: 10px;
  width: 80%;
  max-width: 400px;
  background: #333;
  color: #fff;
  border: 1px solid #555;
  border-radius: 6px;
}

.barcode-box input:focus {
  outline: none;
  border: 1px solid #FFD700;
  box-shadow: 0 0 10px #FFD700;
}

/* ===== Info Box (Produk) ===== */
.info-box {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 20px auto;
  padding: 20px;
  width: 90%;
  max-width: 800px;
  background: #1e1e1e;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.info-text {
  flex: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  text-align: left;
}


.info-image {
  flex: 1;
  text-align: center;
}

.info-image img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* === Responsive Product Name === */
#productName {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 32px; /* font awal */
  transition: font-size 0.2s ease;
}

.info-text {
  max-width: 100%;
  overflow: hidden;
}

/* ===== Produk Wrapper ===== */
.produk-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  max-width: 100%;
  flex-wrap: wrap;
}

.produk-wrapper img {
  width: 150px;
  height: auto;
  object-fit: contain;
  border: 2px solid #ccc;
  border-radius: 10px;
}

.produk-info {
  flex: 1;
  min-width: 200px;
}

/* ===== Jadwal Sholat ===== */
.jadwal-box {
  margin: 20px auto;
  padding: 10px 20px;
  max-width: 800px;
  background: #2a2a2a;
  border-radius: 10px;
}

.jadwal-box h2 {
  margin-bottom: 10px;
  color: #fff;
}

.jadwal-box ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  font-size: 18px;
}

.jadwal-box li {
  background: #3a3a3a;
  padding: 8px 14px;
  border-radius: 8px;
  box-shadow: 0 0 4px rgba(255,255,255,0.1);
  color: #fff;
}

.jadwal-box li.aktif {
  animation: pulseGlow 2s infinite ease-in-out;
}

/* ===== Highlight Text ===== */
.profile-text {
  color: #FFD700;
  font-weight: bold;
  animation: rainbowGlow 3s infinite;
}

/* ===== Animations ===== */
@keyframes rainbowGlow {
  0% { text-shadow: 0 0 10px red; }
  14% { text-shadow: 0 0 10px orange; }
  28% { text-shadow: 0 0 10px yellow; }
  42% { text-shadow: 0 0 10px green; }
  57% { text-shadow: 0 0 10px blue; }
  71% { text-shadow: 0 0 10px indigo; }
  85% { text-shadow: 0 0 10px violet; }
  100% { text-shadow: 0 0 10px red; }
}

@keyframes glowBoxPerak {
  0%, 100% {
    box-shadow: 
      0 0 10px #C0C0C0,
      0 0 20px #DCDCDC,
      0 0 40px #B0C4DE;
  }
  50% {
    box-shadow: 
      0 0 20px #FFFFFF,
      0 0 30px #E0E0E0,
      0 0 50px #F8F8FF;
  }
}


@keyframes glowPulse {
  0%, 100% {
    text-shadow: 0 0 5px #FFD700, 0 0 10px #FFD700, 0 0 15px #FFD700;
  }
  50% {
    text-shadow: 0 0 10px #ffec8b, 0 0 20px #ffec8b, 0 0 30px #ffec8b;
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 10px #ffeb3b, 0 0 20px #ffeb3b;
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 20px #fff176, 0 0 40px #fff176;
    transform: scale(1.05);
  }
}

@keyframes flashRed {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(255, 0, 0, 0.2); }
}

/* ===== Stok Produk ===== */
#productStock.red.low {
  animation: flashRed 1s infinite;
}

#productStock.red {
  color: red;
  font-weight: normal;
  text-shadow: 0 0 4px #ff0000;
}

#productStock.green {
  color: lightgreen;
  font-weight: normal;
  text-shadow: 0 0 4px #90ee90;
}

/* ===== Center Display & States ===== */
.center-display {
  text-align: center;
}

.center-display img {
  margin: 0 auto;
  display: block;
}

.start-display {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 12px;
  background: #111;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: normal;
  color: white;
  text-shadow: 0 0 10px #FFF;
  box-shadow:
    0 0 10px #C0C0C0,
    0 0 20px #DCDCDC,
    0 0 40px #B0C4DE;
  animation: glowBoxPerak 2.5s ease-in-out infinite;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}

.voucher-display {
  font-size: 1.8rem;
  font-weight: bold;
  color: #FFD700;
  text-shadow: 0 0 10px #FFD700;
  animation: glowPulse 2s infinite;
}

.error-display {
  font-size: 2rem;
  font-weight: bold;
  color: #ff4c4c;
  text-shadow: 0 0 10px #ff4c4c;
  margin-top: 20px;
  text-align: center;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px), (orientation: portrait) {
  body {
    padding: 0 10px;
  }
  .barcode-box input {
    font-size: 18px;
    width: 90%;
  }

  .jadwal-box ul {
    flex-direction: column;
    align-items: center;
  }

  .jadwal-box li {
    width: 80%;
  }

  .info-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .info-text {
    text-align: center;
    width: 100%;
  }

  .info-image img {
    max-width: 100%;
    height: auto;
  }

  .produk-wrapper {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .produk-wrapper img {
    width: 60%;
    max-width: 200px;
  }

  .produk-info {
    width: 100%;
  }
}
