body {
  font-family: 'Tahoma', sans-serif;
  background: #f0f0f0;
  color: #333;
  margin: 0;
  padding: 20px;
  min-height: 100vh;
  box-sizing: border-box;
  overflow-y: scroll;
}

#loading-screen {
  position: fixed;
  inset: 0;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
  max-width: 320px;
  width: 80%;
}

.loading-text {
  margin-bottom: 16px;
  font-size: 1.2em;
  font-weight: 700;
  color: #000;
}

.loading-bar {
  width: 100%;
  height: 8px;
  background: #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.loading-bar-inner {
  width: 0;
  height: 100%;
  background: #9fdc00;
  animation: loading-bar-animation 2s infinite;
}

@keyframes loading-bar-animation {
  0% {
    width: 0;
  }
  50% {
    width: 80%;
  }
  100% {
    width: 0;
  }
}

.main-layout {
  position: relative;
  width: 100%;
}

.wrapper {
  width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.image-panel {
  position: absolute;
  left: calc(50% + 330px);
  top: 0;
  right: 20px;
  min-height: 100vh;
  padding-top: 100px;
  z-index: 1;
}

.image-panel[hidden] {
  display: none !important;
}

.rotate-controls {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
  justify-content: center;
  background: #fff;
  padding: 8px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  border: 1px solid #ddd;
  width: fit-content;
}

.rotate-controls button {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  padding: 5px 10px;
  font-weight: bold;
  color: #333;
}

.rotate-controls button:hover {
  background: #e0e0e0;
}

.sticky-container {
  position: relative;
  top: 20px;
}

.sticky-container img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  object-fit: contain;
  max-height: 80vh;
}

.header {
  text-align: center;
  margin-bottom: 20px;
  height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header h1 {
  margin: 0;
  font-size: 2.5em;
  color: #000;
}

.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.card h2 {
  margin-top: 0;
  font-size: 1.2em;
  border-bottom: 2px solid #9fdc00;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.input-row {
  margin-bottom: 10px;
}

input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: monospace;
  text-transform: uppercase;
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.kontrola-btn,
.ocr-btn,
.pdf-scan-btn {
  padding: 12px;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
  text-transform: uppercase;
  border: none;
}

.kontrola-btn,
.pdf-scan-btn {
  flex: 2;
  background: #000;
  color: #9fdc00;
}

.kontrola-btn:hover,
.pdf-scan-btn:hover {
  background: #333;
}

.ocr-btn {
  flex: 1;
  background: #e0e0e0;
  color: #333;
  border: 1px solid #ccc;
}

.ocr-btn:hover {
  background: #d0d0d0;
}

.mrz-result {
  margin-top: 15px;
  padding: 15px;
  background: #f9f9f9;
  border-left: 4px solid #ccc;
  font-size: 0.9em;
  line-height: 1.6;
  white-space: pre-wrap;
  display: none;
}

.mrz-result.show {
  display: block;
}

.mrz-result b {
  display: block;
  margin-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.mrz-result .ok {
  color: #2e7d32;
  font-weight: bold;
}

.mrz-result .bad {
  color: #d32f2f;
  font-weight: bold;
}

#selection-rect {
  position: absolute;
  border: 2px dashed #FF0000;
  pointer-events: none;
  display: none;
  z-index: 10;
}

#mrz-crop-container {
  margin-top: 40px;
  display: none;
  position: relative;
  z-index: 20;
}

#mrz-crop-container canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
