* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

h2 {
  text-align: center;
  margin: 20px 0;
  color: #2c3e50;
  font-size: 2rem;
  font-weight: 700;
  padding-bottom: 10px;
  border-bottom: 3px solid #3498db;
  width: 100%;
  max-width: 800px;
}

h3 {
  text-align: center;
  margin-bottom: 25px;
  color: #3498db;
  font-size: 1.8rem;
  font-weight: 600;
}

/* Step container */
.step {
  background-color: white;
  border-radius: 20px;
  padding: 30px;
  margin: 20px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 800px;
   display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.step > * {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Button styling */
button {
  background: linear-gradient(to right, #3498db, #2980b9);
  color: white;
  border: none;
  padding: 18px 32px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
  margin: 15px 0;
  width: 100%;
  max-width: 400px;
}

button:hover {
  background: linear-gradient(to right, #2980b9, #3498db);
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(52, 152, 219, 0.4);
}

button:active {
  transform: translateY(1px);
}

/* Input styling */
input[type="number"] {
  width: 100%;
  max-width: 400px;
  padding: 18px 25px;
  margin: 25px 0;
  border: 2px solid #ddd;
  border-radius: 50px;
  font-size: 1.4rem;
  text-align: center;
  font-weight: 600;
  color: #2c3e50;
  transition: all 0.3s ease;
}

input[type="number"]:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
}

input[type="number"]::placeholder {
  color: #bbb;
  font-weight: normal;
}

/* QR Display */
#newQR {
  margin: 30px 0;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 20px;
}

/* Video and Camera Elements */
#video, #canvas {
  display: block;
  margin: 0 auto;
  border-radius: 15px;
  border: 4px solid #3498db;
  background: #000;
  max-width: 100%;
  height: auto;
}

#video-title {
  text-align: center;
  margin: 20px 0;
  color: #2c3e50;
  font-weight: 700;
  font-size: 1.6rem;
  width: 100%;
}

/* Sample QR Image */
#sampleQR {
  max-width: 100%;
  height: auto;
  display: none;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  margin: 20px auto;
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
  body {
    padding: 15px;
    justify-content: flex-start;
  }
  
  h2 {
    font-size: 1.8rem;
    padding: 0 10px 10px;
    margin: 15px 0;
  }
  
  h3 {
    font-size: 1.6rem;
    margin-bottom: 20px;
  }
  
  .step {
    padding: 25px 20px;
    border-radius: 15px;
  }
  
  button {
    font-size: 1.4rem;
    padding: 20px;
    max-width: 100%;
  }
  
  input[type="number"] {
    font-size: 1.4rem;
    padding: 20px;
    max-width: 100%;
  }
  
  #video-title {
    font-size: 1.4rem;
    padding: 0 15px;
  }
  
  #video, #canvas {
    max-width: 95%;
  }
}

@media (max-width: 480px) {
  h2 {
    font-size: 1.6rem;
  }
  
  h3 {
    font-size: 1.4rem;
  }
  
  button {
    font-size: 1.3rem;
    padding: 18px;
  }
  
  input[type="number"] {
    font-size: 1.3rem;
    padding: 18px;
  }
  
  #video-title {
    font-size: 1.3rem;
  }
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.step {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Fix untuk video container */
#video {
  display: none;
}

.hidden {
  display: none !important;
}

/* OVERLAY */

   /* Modal style */
    #modal {
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background-color: rgba(0,0,0,0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      display: none;
    }
    #modalContent {
      background: #fff;
      padding: 20px;
      border-radius: 10px;
      max-width: 300px;
      text-align: center;
    }
    #modalContent button {
      margin-top: 10px;
    }