body {
  font-family: Arial, sans-serif;
  background: #f3f4f6;
  margin: 0;
}

.container {
  max-width: 1200px;
  margin: 10px;
  background: #ffffff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.wrapper{
  display: flex;
  justify-content: center;
}

input[type="text"] {
  width: 95%;
  padding: 10px;
  margin-top: 8px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1.1em;
}

textarea {
    width: 100%;
    height: 80px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    resize: vertical;
}

select {
  width: 40%;
  padding: 10px;
  margin-top: 8px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1.1em;
}

.device-info {
  background: #f9fafb;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.error {
  color: #c0392b;
}

button {
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 1em;
  cursor: pointer;
}

button:hover {
  background-color: #1d4ed8;
}
button:disabled,
button[disabled]{
  border: 1px solid #999999;
  background-color: #cccccc;
  color: #666666;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  padding: 20px 30px;
  border-radius: 8px;
  min-width: 280px;
  max-width: 400px;
  position: relative;
}

.modal-close {
  position: absolute;
  right: 10px;
  top: 10px;
  color: black;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  background: none;
  padding: unset;
}

.modal-confirm {
  margin-top: 15px;
  padding: 8px 12px;
  cursor: pointer;
}

/* Top Navigation */
.topnav {
  width: 98%;
  background: #1e293b; /* Dunkelblau/Grau */
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.topnav .logo {
  font-size: 20px;
  font-weight: bold;
}

.topnav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.topnav ul li a {
  color: #e2e8f0;
  font-weight: 500;
  text-decoration: none;
  transition: 0.2s;
}

.topnav ul li a:hover {
  color: white;
}
.topnav ul li a.active {
  color: #38bdf8; /* Hellblau */
  font-weight: bold;
}

.menu-links{
  display: flex;
}

.menu-links a {
  background-color: #2563eb;
  width: 5.5em;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 1em;
  cursor: pointer;
  text-decoration: none;
  margin: 20px;
}

.menu-links a:hover {
  color: rgb(63, 63, 63);
}
.menu-links a.active {
  color: #38bdf8; /* Hellblau */
  font-weight: bold;
}

/* Mobile Support */
@media (max-width: 600px) {
  .topnav {
    width: unset;
    flex-direction: column;
    align-items: flex-start;
  }

  .topnav ul {
    margin-top: 10px;
    flex-direction: column;
    gap: 10px;
  }

  select {
  width: 95%;
  padding: 10px;
  margin-top: 8px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1.1em;
}

}

#roomFrame {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 3 / 2;   /* automatisch 3:2 – ideal für Grundrisse */
    border: 1px solid #ccc;
    margin-bottom: 10px;
    overflow: hidden;
}

#mapContainer {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 3 / 2;   /* automatisch 3:2 – ideal für Grundrisse */
    border: 1px solid #ccc;
    margin-bottom: 10px;
    overflow: hidden;
}
  #mapContainer img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;  /* wichtig → skaliert Bild korrekt */
    height: 100%;
    object-fit: contain; /* Bild nie verzerren */
}

/* map_view Container – gleiche Größe wie Editor */
.map-view-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 3 / 2;
    border: 1px solid #ccc;
    background: #f8f8f8;
    overflow: hidden;
}

/* Bild im Viewer */
.map-view-container .map-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    left: 0;
    top: 0;
}

/* Räume im Viewer – identisch zum Editor */
.map-view-container .room {
    position: absolute;
    border: 2px solid green;
    background: rgba(0, 255, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: green;
    user-select: none;
    pointer-events: auto;
}

.map-view-container .room:hover {
    background-color: rgba(0,128,255,0.3);
    border-color: #0080ff;
    cursor: pointer;
}

.map-image { 
    width: 100%; height: auto; display: block;
}
#mapContainer { position: relative; width: 100%; max-width: 1000px; margin: auto; }

.room {
    position: absolute;
    border: 2px solid rgba(255,0,0,0.8);
    background-color: rgba(255,0,0,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: normal;
    user-select: none;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    text-align: center;
    font-size: min(1.6vw, 1.6vh);
    line-height: 1.1;
}
.room-multi {
    position: absolute;
    border: 2px solid green;
    background: rgba(0, 255, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    user-select: none;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    text-align: center;
    font-size: min(1.6vw, 1.6vh);
    line-height: 1.1;
}

.room-selected {
    background: rgba(0, 200, 50, 0.45) !important;
    border: 3px solid #00b341 !important;
    color: #064d1b !important;
    z-index: 20;
}

.room-new {
    background: rgba(255, 0, 0, 0.3);
    border: 2px solid red;
    color: red;
}

.room-saved {
    background: rgba(0, 255, 0, 0.8);
    border: 2px solid green;
    color: green;
}

/* Resize Handle (unten rechts) */
.room .resize-handle {
    width: 14px;
    height: 14px;
    background: green;
    position: absolute;
    right: 0;
    bottom: 0;
    cursor: se-resize;
}

.room:hover {
    background-color: rgba(0,128,255,0.3);
    border-color: #0080ff;
}
  #roomForm {
    margin-top: 10px;
  }
  #roomList div {
    margin-bottom: 5px;
  }
  #uploadSection{
    margin-top:10px;
    margin-bottom: 10px;
  }

  /*Login Form*/

.login-card {
    width: 100%;
    max-width: 400px;
    min-height: 520px;
    background-color: rgba(255,255,255,0.13);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 40px rgba(8,7,16,0.6);
    padding: 40px 30px;
    box-sizing: border-box;
}

.login-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.background{
  background-color: #1e293b;
  max-height: 3em;
  backdrop-filter: blur(10px);
}

.login-card h1{
    font-size: 32px;
    font-weight: 500;
    line-height: 42px;
    text-align: center;
}

.login-card label{
    display: block;
    margin-top: 30px;
    font-size: 16px;
    font-weight: 500;
}

.login-card input{
    display: block;
    height: 48px;
    width: 95%;
    border-radius: 3px;
    padding: 0 10px;
    margin-top: 8px;
    font-size: 16px;
    font-weight: 300;
    margin-bottom: unset;
    border: unset;
}

.login-card button{
    margin-top: 50px;
    height: 50px;
    width: 100%;
    padding: 15px 0;
    font-size: 18px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
}

.login-footer{
  text-align: center;
}

#loginForm{
  min-height: 45vh;
}

.login-error {
    margin-top: 15px;
    min-height: 18px;
    color: #ff4d4d;
    font-size: 14px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.login-error.visible {
    opacity: 1;
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
        min-height: auto;
    }

    .login-card h1 {
        font-size: 26px;
    }

    .login-card label {
        margin-top: 20px;
    }

    .login-card button {
        margin-top: 30px;
    }
}

/*Barcode-Scanner*/

.scanner {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.scanner video {
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
}

.scan-frame {
  position: absolute;
  width: 70%;
  height: 40%;
  border: 3px solid rgba(0,255,0,0.8);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#closeScanner {
    margin-top: 10px;
    padding: 10px 20px;
}
.hidden {
    display: none;
}