/* GLOBAL */
* {
  font-family: 'Poppins', Arial, sans-serif;
  box-sizing: border-box;
}
body, html {
  padding: 0;
  margin: 0;
  background: #0e0e0e;
  color: #fff;
}
body {
  max-width: 1100px;
  margin: auto;
  padding: 20px;
}

/* HEADER */
h1 {
  text-align: center;
  font-size: 2rem;
  color: #00c6ff;
  margin-bottom: 10px;
}

/* TEMPLATE SELECTOR */
#template-select {
  text-align: center;
  margin-bottom: 15px;
}
#template-select button {
  background: linear-gradient(45deg, #00c6ff, #0072ff);
  border: none;
  padding: 12px 20px;
  margin: 5px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  border-radius: 30px;
  cursor: pointer;
  transition: 0.3s;
}
#template-select button:hover {
  transform: scale(1.05);
}
#template-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
#template-list img {
  width: 140px;
  margin: 10px;
  border-radius: 10px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: 0.3s;
}
#template-list img:hover,
#template-list img.selected {
  border-color: #00c6ff;
  box-shadow: 0 0 15px rgba(0,198,255,0.6);
}

/* CAMERA AREA */
#cam-live {
  width: 100%;
  height: 520px;
  background: black;
  border-radius: 15px;
  object-fit: cover;
  display: none;
}

/* COUNTDOWN */
#countdown {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 140px;
  font-weight: bold;
  color: #00c6ff;
  display: none;
  z-index: 1000;
  animation: pop 0.5s ease;
}
@keyframes pop {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* FLASH EFFECT */
#flash-overlay {
  position: fixed;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 2000;
  transition: opacity 0.2s ease;
}

/* BUTTONS */
#cam-controls {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}
#cam-controls input {
  background: linear-gradient(45deg, #00c6ff, #0072ff);
  border: none;
  padding: 20px;
  margin: 0 10px;
  color: white;
  font-size: 28px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0,198,255,0.4);
  transition: 0.3s;
}
#cam-controls input:hover {
  transform: scale(1.1);
}

/* RESULT IMAGE */
#hasil-img {
  margin-top: 20px;
  text-align: center;
}
#hasil-img img {
  max-width: 90%;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,198,255,0.5);
}

/* RESET BUTTON */
#cam-reset input {
  padding: 12px 25px;
  font-size: 16px;
  background: #ff416c;
  border: none;
  color: white;
  border-radius: 30px;
  cursor: pointer;
  transition: 0.3s;
}
#cam-reset input:hover {
  transform: scale(1.05);
}

/* LOADING OVERLAY */
#loading {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  z-index: 3000;
  justify-content: center;
  align-items: center;
}
#loading img {
  width: 100px;
  height: 100px;
}