@font-face {
  font-family: "Oswald-Regular";
  src: url("../font/Oswald-Regular.ttf");
}

@font-face {
  font-family: "Oswald-Light";
  src: url("../font/Oswald-Light.ttf");
}

@font-face {
  font-family: "OpenSans-Regular";
  src: url("../font/OpenSans-Regular.ttf");
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  -webkit-text-size-adjust: 100%;
  /* Prevent font scaling in landscape while allowing user zoom */
  background-color: #2b2b2b;
}

button {
  border: none;
  cursor: pointer;
  color: #ffffff;
  border: 0;
}

img {
  user-select: none;
}

.home-page {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  color: #ffffff;
  background-color: #2b2b2b;
  padding: 30px 0;
  gap: 20px;
}

.home-page .logo {
  width: 112.5px;
  height: 27px;
}

.home-page .description {
  width: 85%;
  text-align: center;
  background-color: #323234;
  margin: 0 auto;
  padding: 2rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.home-page .description .title {
  font-size: 26px;
  font-family: Oswald-Regular;
}

.home-page .description .content {
  font-family: OpenSans-Regular;
  font-size: 16px;
  line-height: 26px;
  margin: 1rem 0 1rem;
}

.home-page .description .desktop-qr-container {
  font-family: OpenSans-Regular;
  background-color: #2b2b2b;
  padding: 2rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

.home-page .description .desktop-start-btn {
  font-family: OpenSans-Regular;
  background-color: #2b2b2b;
  margin-top: 1rem;
  padding: 2rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 1rem;
  text-align: start;
}

.home-page .description .desktop-start-btn .start-btn {
  display: flex;
  width: 100%;
}

.home-page .description .start-btn {
  width: 180px;
  height: 6vh;
  min-height: 40px;
  max-height: 60px;
  background-color: #fe8e14;
  font-family: Oswald-Regular;
  font-size: 16px;
  margin: 0 auto;
  display: none;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  padding: 2rem;
}

.home-page .description .start-btn:hover {
  background-color: #fea543;
}

.home-page .powered-by-msg {
  font-size: 16px;
  font-family: Oswald-Light;
}

.scanner-container {
  position: absolute;
  width: 100%;
  height: 100%;
  display: none;
}

.scanner-container .header {
  width: 100%;
  height: 46px;
  background-color: rgb(55, 55, 55);
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
}

.scanner-container .header .camera-selector {
  width: 70px;
  height: 100%;
  background-color: #000000;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px;
  cursor: pointer;
}

.scanner-container .header .camera-selector:hover {
  opacity: 0.8;
}

.scanner-container .header .camera-selector .camera-svg {
  width: 28px;
  height: 16px;
}

.scanner-container .header .camera-selector .up {
  display: none;
}

.scanner-container .header .camera-list {
  position: absolute;
  top: 46px;
  left: 0;
  background-color: #000000;
  z-index: 3;
  display: none;
  border-right: #aaaaaa;
}

.scanner-container .header .camera-list .camera-item {
  width: 100%;
  height: 40px;
  color: #aaaaaa;
  border-bottom: 1px solid rgb(50, 50, 52);
  font-size: 12px;
  font-family: OpenSans-Regular;
  line-height: 40px;
  padding: 0 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  user-select: none;
  cursor: pointer;
}
.scanner-container .header .camera-list .camera-item:hover {
  opacity: 0.8;
}

.scanner-container .header .camera-list .camera-selected {
  color: #fe8e14;
}

.scanner-container .header .camera-list .camera-item:last-child {
  border: unset;
}

.scanner-container .header .music-container {
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.scanner-container .header .music-container:hover {
  opacity: 0.8;
}

.scanner-container .header .music {
  width: 24px;
  height: 24px;
}

.scanner-container .header .no-music {
  width: 24px;
  height: 24px;
  display: none;
}

.scanner-container .header .upload-img-btn {
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.scanner-container .header .upload-img-icon {
  width: 24px;
  height: 24px;
}

.result-container {
  position: absolute;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  background-color: #323234;
  color: #ffffff;
  font-family: "OpenSans-Regular";
  font-size: 16px;
  z-index: 2;
}

.result-container .result-header {
  width: 100%;
  min-height: 46px;
  position: relative;
  background-color: #2b2b2b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding-left: 30px;
}

.result-container .result-header .result-title {
  color: #aaaaaa;
}

.result-container .result-area {
  width: 100%;
  height: 84%;
  display: flex;
  flex-direction: column;
}

.result-container .scanned-image {
  flex: 1;
  max-height: 200px;
}

.result-container .scanned-image canvas {
  object-fit: contain;
  width: 100%;
  height: 100%;
}

.result-container .parsed-result-area {
  flex: 1;
  width: 100%;
  height: 84%;
  padding: 15px 15px 5px 30px;
  overflow: auto;
}

.result-container .parsed-result-area .parsed-filed {
  display: flex;
  flex-direction: column;
  margin-bottom: 25px;
}

.result-container .parsed-result-area .parsed-filed .field-name {
  color: #aaaaaa;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.result-container .parsed-result-area .parsed-filed .field-value {
  word-wrap: break-word;
}

.result-container .parsed-result-area .code .field-value {
  font-family: monospace;
}

.result-container .parsed-result-area .parsed-filed .status-icon {
  display: inline-flex;
  align-items: center;
  cursor: help; /* Indicates there's a tooltip */
}

.result-container .parsed-result-area .parsed-filed .status-icon svg {
  width: 16px;
  height: 16px;
}

.result-container .parsed-result-area .parsed-filed .status-success {
  color: #22c55e; /* Green */
}

.result-container .parsed-result-area .parsed-filed .status-failed {
  color: #ef4444; /* Red */
}

.result-container .scan-again {
  width: 100%;
  height: 10%;
  min-height: 60px;
  max-height: 100px;
  background-color: #2b2b2b;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.result-container .scan-again .btn-scan-again {
  width: 160px;
  height: 60%;
  border: 0;
  background-color: #fe8e14;
  font-size: 20px;
  color: #ffffff;
  font-family: "Oswald-Regular";
}

.scan-mode-container {
  display: none;
  justify-content: center;
  align-items: center;
  position: fixed;
  bottom: 15%;
  left: 5%;
  right: 5%;
  z-index: 2;
}

.scan-mode-container .scan-mode-content {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgb(34, 34, 34);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 0.5rem;
  width: max-content;
  opacity: 0.8;
}

.scan-option-btn {
  background-color: transparent;
  padding: 0.5rem;
  font-family: OpenSans-Regular;
  color: white;
  flex: 1;
  width: 5rem;
}

.selected {
  background-color: #fe8e14;
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#notification {
  text-align: center;
  text-align: center;
  padding: 0.5rem;
  width: -moz-fit-content;
  width: fit-content;
  position: absolute;
  z-index: 3;
  bottom: -200%;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  font-family: Oswald-Light;
  color: #fff;

  /* Fade in animation */
  opacity: 0;
  display: none;
  transition: opacity 300ms;
}

.banner-default {
  background-color: rgb(254, 142, 20, 0.4);
  border: 1px solid #fe8e14;
}
.banner-error {
  background-color: rgb(252, 2, 0, 0.4);
  border: 1px solid #fc0200;
}
.banner-success {
  background-color: rgb(124, 252, 0, 0.4);
  border: 1px solid #00fc15;
}

.dbr-download-code-icon {
  width: 16px;
  height: 16px;
  stroke: #ffae38;
  margin-left: 5px;
}

@keyframes dce-rotate {
  from {
    transform: rotate(0turn);
  }

  to {
    transform: rotate(1turn);
  }
}

@keyframes dce-scanlight {
  from {
    top: 0;
  }

  to {
    top: 97%;
  }
}

@media screen and (max-width: 800px) {
  html,
  body,
  .home-page {
    background-color: #323234;
  }

  .home-page .description {
    width: 80%;
    box-shadow: none;
  }

  .home-page .description .desktop-qr-container {
    display: none;
  }

  .home-page .description .desktop-start-btn {
    display: none;
  }

  .home-page .description .start-btn {
    display: flex;
    font-size: 20px;
    padding: 1.5rem;
  }
}

/* Media query for mobile phones */
@media screen and (orientation: landscape) and (max-width: 900px) {
  .result-container .parsed-result-area .parsed-filed {
    font-size: 14px;
  }

  .result-container .result-area {
    height: 70%;
    flex-direction: row;
  }
}
