/*
This file is part of Indkøbs App - Denne app er kun på dansk her lige nu.
Copyright (C) 2025 Rikard Svenningsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
body .heading{
  font-family: sans-serif;
  padding: 10px;
  width: 95%;
  max-width: 768px;
  margin: auto;
  background: #f7f7f7;
}
/*
 * Start indsættelse
*/
.heading-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 1.4em;
    font-weight: bold;
    font-family: inherit;
    color: inherit;
    cursor: pointer;
    text-align: center;
}

.heading-button:focus {
    outline: none;
}

/*
 * Slut indsættelse
*/
h1 {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.input-group, .filter-bar {
  margin-top: 10px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-line {
  display: flex;
  gap: 5px;
}

.input-number {
  flex: 0 0 20%;
}

.input-name {
  flex: 1;
}

input, select, button {
  padding: 4px;
  font-size: 0.7rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  width: 100%;
  box-sizing: border-box;
  max-height: 34px;
}

button {
  background-color: #4CAF50;
  color: white;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background-color: #45a049;
}

ul {
  list-style: none;
  padding: 0;
  margin-top: 8px;
}

/* 🌟 KORREKTION: Al lodret margin mellem elementerne er fjernet 🌟 */
li {
  background: #fff;
  margin: 0; /* Fjernet vertikal afstand */
  padding: 0px; 
  border-radius: 4px;
  font-size: 0.7rem; /* Sikrer at tekststørrelsen er fastsat */
  position: relative; 
  overflow: hidden; 
}

li.checked .item-name {
  text-decoration: line-through;
  opacity: 0.6;
}

/* 🌟 KORREKTION: Tilføjet mere padding til højre og box-sizing for at undgå overflow 🌟 */
.item-content {
  padding: 6px 10px 6px 6px; /* ⭐ RETTELSE: Øget padding til 10px på højre side */
  display: flex;
  flex-direction: column; 
  width: 100%;
  box-sizing: border-box; /* ⭐ NYT: Sikrer at padding ikke får elementet til at flyde over kanten */
  background: #fff; 
  position: relative;
  z-index: 2; 
  transition: transform 0.3s ease-out; 
}

/* 🌟 NY STIL: Slet-baggrunden 🌟 */
.delete-background {
  position: absolute;
  top: 0;
  right: 0; 
  bottom: 0;
  width: 100px; 
  background-color: #f44336; 
  color: white;
  display: flex;
  align-items: center;
  justify-content: flex-end; 
  padding-right: 15px;
  font-weight: bold;
  z-index: 1;
  cursor: pointer;
}


/* VIGTIGT: Sætter align-items: center for at holde alt på top-linjen kompakt */
.top-line {
  display: flex;
  align-items: center; /* Sætter vertikal justering til midten */
  gap: 5px;
}

.item-line {
  display: flex;
  gap: 5px;
  align-items: center;
  flex: 1;
}

.item-number {
  flex: 0 0 20%;
  font-weight: bold;
  color: #0079a1;
  cursor: pointer;
}

.item-name {
  flex: 1;
  word-break: break-word;
  cursor: pointer;
}

/* 🌟 NY STIL: Definer bredde og udseende for Pris Input i top-linjen 🌟 */
.top-line input[type="text"] {
    width: 80px; 
    text-align: right;
    font-size: 0.7rem; 
    padding: 4px; 
}


/* Bottom-linjen indeholder nu kun kategorien */
.bottom-line {
  font-size: 0.6rem;
  color: #555;
  margin-top: 2px;
  display: flex;
  align-items: center;
}


.right-buttons {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

/* OPDATERET: Til tre knapper, mindre størrelse */
.right-buttons button {
  flex: 1 1 33.33%; 
  max-width: 33.33%;
  font-size: 0.6rem; 
  padding: 4px 2px; 
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.header-container h1 {
  flex-grow: 1;
  text-align: center;
  margin: 0;
}

.info-btn, .help-btn {
  width: 10%;
  min-width: 40px;
  padding: 5px;
  font-size: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
}

.flash {
/* background-color: #ffffcc;
  transition: background-color 2s ease-out;*/
  animation: flashHighlight 2s ease-in-out;
}

@keyframes flashHighlight {
  0% { background-color: #ffffcc; }
  50% { background-color: #fff176; }
  100% { background-color: #ffffff; }
}

.highlight {
  animation: flashHighlight 2s ease-in-out;
}

/* NYE: Farveklasser for kategori-knap */
.btn-green {
  background-color: #4CAF50 !important; /* Grøn (ON) */
  color: white;
}

.btn-red {
  background-color: #f44336 !important; /* Rød (OFF) */
  color: white;
}
