* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  height: 100%;
  font-family: 'Segoe UI', sans-serif;
  display: flex;
  flex-direction: column;
}

header {
  background-color: #0056b3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  color: white;
}

main {
  display: flex;
  flex: 1;
  justify-content: center;
  padding: 10px 10px 90px 10px;
  width: 100%;
}

.main-container {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  max-width: 1200px;
  gap: 10px;
}

.top-buttons > div {
  flex: 1;
}

.top-buttons,
.bottom-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

button {
  width: 100%;
  padding: 15px;
  font-size: 1.2em;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  transition: background-color 0.2s ease-in-out;
}

button:not(:disabled):hover {
  background-color: #0056b3;
  cursor: pointer;
}

.workspace {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  background-color: #f1f1f1;
  border: 2px dashed #ccc;
  min-height: 200px;
  border-radius: 6px;
  gap: 20px;
  max-width: 800px;
  outline: none;
  width: 100%;
}

.workspace video,
.workspace img,
.workspace canvas {
  width: 100%;
  height: auto;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ddd;
  font-size: 0.9em;
  padding: 5px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  gap: 10px;
}

footer button {
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.9em;
  cursor: pointer;
  padding: 6px;
  white-space: nowrap;
  width: fit-content;
}

footer button:hover {
  background-color: #b52a36;
}

@media (min-width: 600px) {
  .top-buttons,
  .bottom-buttons {
    flex-direction: row;
  }

  .top-buttons div,
  .bottom-buttons div {
    flex: 1;
  }
}

#fileInput {
  display: none;
}

.select-wrapper {
  position: relative;
  display: inline-block;
}

/* Hide default arrow in most browsers */
.select-wrapper select {
  width: 100%;
  padding: 5px 25px 5px 5px;
  font-size: 0.8rem;
  line-height: 1.2;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

/* Custom arrow */
.select-wrapper::after {
  content: "▾";
  position: absolute;
  top: 50%;
  right: 5px;
  pointer-events: none;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: #666;
}

/* Focus state */
.select-wrapper select:focus {
  outline: none;
  border-color: #007acc;
  box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

button:disabled {
  opacity: 0.5;
}

footer > div {
  flex: 1;
  display: flex;
  align-items: center;
}

footer > div:nth-child(1) {
  justify-content: flex-start;
}

footer > div:nth-child(2) {
  justify-content: center;
  flex-direction: column;
  gap: 10px;
}

footer > div:nth-child(3) {
  justify-content: flex-end;
}

.ticket-results-container {
  display: none;
  gap: 20px;
}

.ticket-results-container > div {
  flex: 1;
  padding: 10px;
}

.result-block {
  display: flex;
  align-items: center;
  gap: 4px;
}

.result-block .left {
  font-size: 14px;
}

.result-block .right {
  font-weight: bold;
  font-size: 14px;
}

.result-block .error {
  font-weight: bold;
  color: red;
}

#result .title {
  font-weight: bold;
}

#origImg, #rotImg, #rotCv {
  max-width: 800px;
}

#qr-code {
  text-align: center;
}

#qr-code-result {
  font-weight: bold;
  text-align: center;
}

#purchase-results {
  text-align: center;
}

.scratchcard-results-container {
  padding-top: 20px;
  padding-bottom: 20px;
  font-size: 30px;
  display:none;
}
