html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #1c1c1c;
    color: #f5f5f5;
}

.wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
}

.container {
    background-color: #2c2c2c;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    max-width: 600px;
    max-height: 875px;
    width: 100%;
    margin: 0 auto;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

#avatarContainer {
    display: flex;
    flex-direction: row;
    max-width: 1500px;
    max-height: 870px;
    padding: 40px 20px;
    margin-bottom: 0px;
    margin-top: 20px;
}

#resultContainer {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    z-index: 1;
    flex:1;
}

h1 {
    color: rgb(173, 12, 12);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

h2 {
    color: rgb(173, 12, 12);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.hidden {
    display: none !important;
}

.title {
    font-size: 2.5rem;
    color: rgb(173, 12, 12);
    margin-bottom: 20px;
    font-weight: bold;
}

button {
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    font-size: 1.2rem;
    border: 2px solid rgb(173, 12, 12);
    border-radius: 8px;
    background-color: transparent;
    color: rgb(173, 12, 12);
    transition: background-color 0.3s, color 0.3s;
}

button:hover {
    background-color: rgb(173, 12, 12);
    color: #1c1c1c;
}

button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgb(173, 12, 12);
}

.row, .col-md-6 {
    display: block;
}

.avatar-card {
    background-color: #2c2c2c;
    border: 2px solid rgb(173, 12, 12);
    border-radius: 10px;
    padding: 15px;
    margin: 0 auto;
    margin-bottom: 20px;
    margin-left: 10px;
    margin-right: 10px;
    width: 25%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.5);
    align-items: center;
}

.avatar-card img {
    border-radius: 10px;
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.avatar-select-btn {
    margin-top: 10px;
    width: 100%;
    font-size: 1.1rem;
    background-color: transparent;
    color: rgb(173, 12, 12);
    border: 2px solid rgb(173, 12, 12);
    border-radius: 8px;
    padding: 10px;
    transition: background-color 0.3s, color 0.3s;
    touch-action: manipulation;
}

.avatar-select-btn:hover {
    background-color: rgb(173, 12, 12);
    color: #1c1c1c;
}

.touchscreen-indicator {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: rgb(173, 12, 12);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

#progressBarContainer {
    width: calc(100% - 500px);
    max-width: 100%;
    margin: 20px auto;
    text-align: center;
    z-index: 1;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
}

#videoElement {
    width: 100%;
    max-width: 600px;
    border: 2px solid rgb(173, 12, 12);
    border-radius: 8px;
    background-color: #000;
    display: block;
}

#countdownDisplay {
    font-size: 2rem;
    color: rgb(173, 12, 12);
    margin-top: 10px;
    font-weight: bold;
}

#preCountdownText {
    font-size: 2rem;
    color: rgb(173, 12, 12);
    margin-top: 10px;
    font-weight: bold;
}

#preCountdownDisplay {
    margin-top : 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

#responseBox {
    padding: 10px;
    margin-top: 10px;
    color: #ffffff;
    text-align: left;
    font-size: 1.2rem;
}

#resultPhoto {
    width: 100%;
    max-width: 500px;
    border: 2px solid rgb(173, 12, 12);
    border-radius: 10px;
    margin-top: 20px;
    object-fit: contain;
}

#resultAvatarName {
    font-size: 1.5rem;
    font-weight: bold;
    color: rgb(173, 12, 12);
    margin-top: 10px;
}

.no-photo-message {
    color: #e74c3c;
    font-size: 1.2rem;
    margin-top: 20px;
    text-align: center;
}

.photo-strip {
    width: 100%;
    max-width: 400px;
    border: 2px solid rgb(173, 12, 12);
    border-radius: 8px;
    margin: 20px auto;
    display: block;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #2c2c2c;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
}

.qr-code {
    max-width: 200px;
    margin: 15px auto;
    display: block;
    border: 2px solid rgb(173, 12, 12);
    border-radius: 8px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-buttons button {
    width: 45%;
    margin-top: 10px;
    padding: 10px;
    font-size: 1rem;
}

#cancelPaymentButton {
    border-color: #e74c3c;
    color: #e74c3c;
}

#cancelPaymentButton:hover {
    background-color: #e74c3c;
    color: #1c1c1c;
}

.loader-container {
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  svg {
    width: 25px;
    height: 25px;
    transform: rotate(180deg);
  }

  .trace {
    fill: none;
    stroke: #c0392b;
    stroke-width: 8;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
  }
  
  .circle {
    transform: rotate(90deg) scale(-1, 1);
    transform-origin: center;
  }

  @keyframes traceStar {
    0% {
      stroke-dashoffset: 1000;
    }
    100% {
      stroke-dashoffset: 0;
    }
  }

  /* Overlay spans the full video */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    box-sizing: border-box;
  }
  
  /* Top bar with indicator and label */
  .top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  /* Blinking recording circle */
  .record-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: red;
    position: relative;
    animation: blink 1s infinite;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.7);
  }
  
  /* Label styling */
  .label {
    color: #f1f1f1;
    font-weight: bold;
    text-shadow: 0 0 6px rgba(0,0,0,0.8);
    font-size: 1rem;
    letter-spacing: 1px;
  }
  
  /* Timestamp at bottom */
  .timestamp {
    color: #0f0;
    font-family: monospace;
    font-size: 0.85rem;
    text-shadow: 0 0 4px rgba(0,0,0,0.9);
  }
  
  /* Blink keyframes */
  @keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
  }

.cctv-wrapper {
    position: relative;
    display: inline-block;
    font-family: system-ui, sans-serif;
    max-width: 100%;
}