﻿/* ===== GLOBAL ===== */
body {
  background: #ffffff;
  color: #222;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: 40px;
}

.container {
  max-width: 720px;
}

/* ===== HEADER: LOGO & LANGUAGE ===== */
.topbar {
  background: #f9f9f9;
  border-bottom: 1px solid #ddd;
  padding: 8px 0 15px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lang {
  margin-bottom: 6px;
  text-align: center;
}

.lang .pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 16px;
  background: #e0e0e0;
  color: #333;
  margin: 0 3px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.2s ease, color 0.2s ease;
}
.lang .pill:hover {
  background: #d0d0d0;
  color: #000;
}

.brand {
  text-align: center;
}

.logo-img {
  max-width: 130px;
  height: auto;
  display: block;
  margin: 0 auto;
  transition: transform 0.2s ease;
}
.logo-img:hover {
  transform: scale(1.05);
}

/* ===== PAGE HEADER ===== */
.page-header h1 {
  margin-top: 25px;
  font-size: 1.8em;
  font-weight: 600;
  color: #004080;
  text-align: center;
}

.lead {
  font-size: 1.1em;
  color: #444;
  text-align: center;
}

/* ===== PANELS ===== */
.panel {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.panel-heading {
  background: #f1f5ff;
  padding: 10px 15px;
  font-weight: 600;
  color: #004080;
  border-bottom: 1px solid #ccd9ff;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.panel-body {
  padding: 15px;
  position: relative;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  margin-bottom: 26px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #222;
}

.form-control {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
  box-sizing: border-box;
  font-size: 14px;
  height: 44px;
}

/* ===== BUTTONS ===== */
.btn {
  font-size: 14px;
  padding: 10px 15px;
  border-radius: 8px;
  transition: background 0.2s ease;
  height: 44px;
  line-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: #007bff;
  color: #fff;
  border: none;
  font-weight: 600;
  width: 100%;
}

.btn-primary:hover {
  background: #0069d9;
}

/* ===== SKENIRANJE ===== */
.scan-group {
  position: relative;
  display: flex;
  align-items: center;
}

.scan-input {
  padding-right: 110px;
  flex: 1;
  height: 44px;
}

.btn-scan {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  height: 38px;
  padding: 6px 12px;
  background-color: #f8f9fa !important;
  color: #212529 !important;
  border: 1px solid #adb5bd !important;
  font-weight: 600 !important;
  border-radius: 6px;
  text-shadow: none !important;
  transition: background 0.2s ease;
  line-height: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-scan:hover {
  background-color: #e2e6ea !important;
}

/* ===== STATUS ===== */
.alert {
  border-radius: 6px;
  padding: 10px 15px;
}

.alert-success {
  background: #e8f8ef;
  color: #1c663a;
  border: 1px solid #c6e7cf;
}

.alert-danger {
  background: #fdecea;
  color: #a61111;
  border: 1px solid #f5c6cb;
}

/* ===== VALIDACIJA ===== */
.input-error {
  border-color: #d9534f !important;
  background: #fff6f6 !important;
  box-shadow: 0 0 4px rgba(217, 83, 79, 0.3);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.error-text {
  position: absolute;
  bottom: -16px;
  left: 4px;
  color: #d9534f;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  animation: fadeIn 0.25s ease;
  pointer-events: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  color: #666;
  font-size: 0.9em;
  margin-top: 40px;
}

/* ===== QR OVERLAY ===== */
#qrOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#qrOverlay.active {
  display: flex !important;
  visibility: visible;
  opacity: 1;
}

.qr-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#qrVideo {
  width: 100%;
  border-radius: 8px;
  background: #000;
  display: block;
}

#qrClose {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  border: 1px solid #ccc;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  z-index: 10000;
}

#qrClose:hover {
  background: #f8f8f8;
}

/* ===== GUMB ZA PREKLOP KAMERE ===== */
#switchCam {
  margin-top: 12px;
  background: #f8f9fa;
  border: 1px solid #ccc;
  color: #222;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

#switchCam:hover {
  background: #e2e6ea;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
  .logo-img {
    max-width: 110px;
  }
  .lang .pill {
    padding: 4px 8px;
    font-size: 12px;
  }
  .btn-scan {
    height: 36px;
    padding: 5px 10px;
    font-size: 13px;
  }
  .error-text {
    font-size: 11px;
    bottom: -14px;
  }
}

/* ===== QR TARGET OVERLAY ===== */
.qr-target {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  animation: pulseBox 1.5s ease-in-out infinite;
  z-index: 5;
  pointer-events: none;
}

@keyframes pulseBox {
  0%   { border-color: rgba(255,255,255,0.8); }
  50%  { border-color: rgba(0,150,255,0.9); }
  100% { border-color: rgba(255,255,255,0.8); }
}

.btn-loading {
  pointer-events: none;
  opacity: 0.8;
  position: relative;
}

.btn-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  transform: translateY(-50%);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

