@font-face {
  font-family: 'NeoSansBold';
  src: url('NeoSansStd-Bold.otf') format('opentype');
  font-weight: bold;
  font-style: normal;
}

/* Endast rubriken (dashboard/list-vy) */
h1 {
  font-family: 'NeoSansBold', Arial, sans-serif;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #003DA5 0%, #ffffff 100%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#app {
  width: 100%;
  max-width: 900px;
  background: white;
  padding: 20px;
  margin: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

header img {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 80px;
}

.filter-bar, .add-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center; /* 🔹 centrera allt vertikalt (inkl. texten) */
}

/* texten "X av Y är utlånade" bredvid knappen */
.add-bar .stats {
  margin-left: 10px;      /* lite luft efter knappen */
  font-size: 0.95em;
  color: #333;
  white-space: nowrap;    /* håll ihop på en rad */
}

.filter-bar select, .filter-bar input,
.add-bar select, .add-bar input {
  padding: 6px;
}

/* Materialrutor */
.item {
  border: 1px solid #ddd;
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 6px;
  background-color: #f9f9f9;
  transition: background-color 0.2s ease;
}
.item:hover {
  background-color: #e6f0ff;
}

/* Gör raderna till grid: Namn | Kategori | Info | Knappar */
.list .item {
  display: grid;
  grid-template-columns: 2fr 1fr 3fr 2fr;
  align-items: center;
  gap: 10px;
}
.item-kategori { text-align: center; }
.item-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Bas-knappar */
button {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: none;
  margin: 2px;
  background: #eee;
  background-image: linear-gradient(to bottom, #f9f9f9, #e0e0e0);
}
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}
button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 🔹 Blå primärknapp */
button.primary, #addBtn, #addFixedBtn {
  color: #fff;
  background-image: linear-gradient(to bottom, #0055e6, #003DA5);
}
button.primary:hover, #addBtn:hover, #addFixedBtn:hover {
  background-image: linear-gradient(to bottom, #003DA5, #002a73);
}

/* 🔸 Grå sekundärknapp */
button.secondary, #logoutBtn {
  color: #333;
  background-image: linear-gradient(to bottom, #f5f5f5, #ccc);
}
button.secondary:hover, #logoutBtn:hover {
  background-image: linear-gradient(to bottom, #e0e0e0, #bbb);
}

/* 🔴 Röd knapp */
button.danger, #removeFixedBtn {
  color: #fff;
  background-image: linear-gradient(to bottom, #e66464, #c9302c);
}
button.danger:hover, #removeFixedBtn:hover {
  background-image: linear-gradient(to bottom, #d9534f, #a62626);
}

/* Utlånade rader */
.item.utlånad {
  background: #ffe5e5;
  border-color: #c00;
  box-shadow: inset 0 0 0 3px rgba(204,0,0,0.15);
}
.item.utlånad b {
  color: #a00000;
}

@media (max-width: 600px) {
  .filter-bar, .add-bar {
    flex-direction: column;
  }
  header img { width: 60px; }
}

#resultCount {
  align-self: center;
  font-size: 14px;
  color: #333;
}

/* === LOGIN-SIDA (matchar andra siten) === */
body.login-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 60px;
  min-height: 100vh;
  background: linear-gradient(135deg, rgba(0,61,165,0.97) 0%, rgba(255,255,255,0.97) 100%);
  margin: 0;
}

/* DASHBOARD */
body.dashboard-body {
  padding: 20px;
  min-height: 100vh;
  background: linear-gradient(135deg, rgba(0,61,165,0.97) 0%, rgba(255,255,255,0.97) 100%);
  position: relative;
  overflow: auto;
}

.site-logo {
  position: absolute;
  top: 20px;
  right: 20px;
  height: 90px;
  width: auto;
  display: block;
}

body.login-body #app {
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0;
  max-width: none;
  border-radius: 0;
}

/* Login-box */
body.login-body .login-box {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  width: 530px;
  margin: 80px auto;
  text-align: center;
}

/* Rubriker */
body.login-body .login-box h1 {
  text-transform: uppercase;
  font-family: 'NeoSansStd-Bold', 'NeoSansBold', Arial, sans-serif;
  font-size: 2em;
  margin-bottom: 10px;
}
body.login-body .login-box h2 {
  font-family: Arial, sans-serif;
  font-size: 1.1em;
  font-weight: normal;
  margin: 8px 0 8px;
}

/* Inputs */
body.login-body .login-box input[type="text"],
body.login-body .login-box input[type="password"],
body.login-body #u,
body.login-body #p {
  width: 80%;
  padding: 10px;
  margin: 3px 0;
  border: 1px solid #ccc;
  border-radius: 5px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Login-knappen */
body.login-body .login-box #loginBtn {
  display: inline-block;
  margin-top: 6px;
  padding: 10px 12px;
  width: auto;
  min-width: 120px;
  font-size: 1em;
  background: linear-gradient(135deg, #003DA5, #0055cc);
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
body.login-body .login-box #loginBtn:hover {
  background: linear-gradient(135deg, #002a73, #0040a0);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

/* === VITS-RUTA UNDER LOGIN === */
body.login-body .joke-box {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  width: 530px;
  max-width: 92vw;
  margin: 20px auto 60px;
  text-align: center;
  font-size: 1.05em;
  color: #333;
  line-height: 1.4;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.35);
}

/* === Oversize watermark-logga (både login & dashboard) === */
body.login-body::before,
body.dashboard-body::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('logga.png') no-repeat;
  background-size: 160%;
  background-position: -200px -100px;
  opacity: 0.05;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* === Hudde-bild stående till vänster === */
body.login-body::after,
body.dashboard-body::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 250px;
  background: url('hudde.png') no-repeat center 20%;
  background-size: contain;
  opacity: 0.15;   /* 🔹 justera synlighet */
  z-index: 1;     /* över logga.png men under innehåll */
  pointer-events: none;
}

/* Se till att innehåll alltid ligger ovanpå */
body.login-body #app,
body.login-body .login-box,
body.dashboard-body #app,
body.dashboard-body header,
body.dashboard-body .list,
body.dashboard-body .add-bar {
  position: relative;
  z-index: 5;
}

/* === USER INFO (Inloggad som: ...) === */
.user-info {
  font-size: 0.95em;
  color: #222;
  margin: 8px 0 16px 0;
}
.user-info a {
  color: #003DA5;
  text-decoration: none;
  font-weight: bold;
  transition: transform .15s ease, color .2s ease;
  display: inline-block;
  cursor: pointer;
}
.user-info a:hover {
  transform: scale(1.12);
  color: #002a73;
  text-decoration: underline;
}

.user-info .username {
  font-weight: bold;
}