/* styles.css */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Arial', sans-serif;
}

body, html {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url('https://static.wixstatic.com/media/e828ba_1132a20b8ada41d1b39a0fe6856af828~mv2.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #ffffff;
}

.container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  text-align: center;
}

.auth-box, .dashboard {
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  padding: 25px;
  padding-bottom: 35px; /* Add extra padding at the bottom */
  transition: all 0.3s ease;
}

.title {
  padding-bottom: 25px;
  font-size: 1.6em;
  margin-bottom: 20px;
  color: #3498db;
}

.input-field {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border-radius: 5px;
  border: 1px solid #ddd;
  transition: border-color 0.3s;
  font-size: 1em;
}

.input-field:focus {
  border-color: #3498db;
  outline: none;
}

.button {
  width: 100%;
  padding: 12px;
  background-color: #ae0ba0;
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 15px; /* Adjusted space between buttons */
}

.button:hover {
  background-color: #ef7720;
}

.logout-button {
  background-color: #e74c3c;
}

.logout-button:hover {
  background-color: #c0392b;
}

.toggle-camera-button {
  background-color: #1abc9c;
}

.toggle-camera-button:hover {
  background-color: #16a085;
}

.error-message, .refresh-error {
  color: #e74c3c;
  margin-top: 10px;
  font-weight: bold;
  display: none;
}

.scanner-box {
  width: 100%;
  max-width: 320px;
  height: 320px; /* Asigură-te că înălțimea și lățimea sunt egale */
  border: 2px dashed #3498db;
  border-radius: 8px;
  padding: 10px;
  margin: 20px auto;
  background: rgba(240, 245, 251, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* Ascunde orice conținut care depășește */
  position: relative;
}

.html5-qrcode-element {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover; /* Ajustează imaginea pentru a umple cadrul */
  border-radius: 8px;
}

.scanned-result {
  font-size: 1em;
  color: #3498db;
  margin-top: 10px;
}

.success-message {
  color: #2ecc71;
  margin-top: 10px;
  font-weight: bold;
}

.next-scan-button {
  background-color: #f1c40f;
}

.next-scan-button:hover {
  background-color: #f39c12;
}

.logo {
  width: 150px;
  margin-bottom: 10px;
}

.refresh-icon {
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.refresh-icon:hover {
  background-color: rgba(52, 152, 219, 0.2);
}

/* Loading Spinner */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #3498db;
  border-top: 4px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.footer-text {
  margin-top: 15px;
  font-size: 0.5em;
  color: #3498db;
  font-weight: bold;
  text-align: center;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsiveness */
@media (max-width: 500px) {
  .title {
    font-size: 1.4em;
  }
  .input-field, .button {
    padding: 10px;
    font-size: 0.9em;
  }
  .logo {
    width: 120px;
  }

}

@media (max-width: 320px) {
  .title {
    font-size: 1.2em;
  }
  .input-field, .button {
    padding: 8px;
    font-size: 0.8em;
  }
  .logo {
    width: 100px;
  }

}
