:root {
	--blue:#003865;
	--red:#e1001a;
	--white:#ffffff;
	--text-black:#1a1a1a;
	--bg-light:#f5f5f5;

	/* Dark Mode */
	
	--dark-blue:#0d2740;
	--dark-item:#212121;
	--dark-item-tag:#2d2d2d;
	--text-white:#f2f2f2;
	--bg-dark:#121212;
}

/* Klasse mit . und ID mit # */
/* BODY & MAIN */
body{
	margin:0;
	padding:0;
	font-family:Verdana,Arial,sans-serif;
	background:var(--bg-light);
	color:var(--text-black);
	display:flex;
	flex-direction:column;
	min-height:100vh;
}

/* Dark Mode */
body.dark-mode{
	background:var(--bg-dark);
	color:var(--text-white);
}

body.dark-mode .placeholder{
	background:var(--bg-dark);
}

body.dark-mode .item{
	background:var(--dark-item);
	color:var(--text-white);
}

body.dark-mode .category-group{
	background:var(--bg-dark);
}

body.dark-mode .item-tag{
	background:var(--dark-item-tag);
	color:var(--text-white);
}

body.dark-mode .filter-btn,
body.dark-mode .pack-btn{
	background:var(--dark-blue);
	color:var(--text-white);
}

body.dark-mode footer{
	background:var(--dark-blue);
	color:var(--text-white);
}

body.dark-mode header{
	background:var(--dark-blue);
	color:var(--text-white);
}

body.dark-mode #header-search{
	background:var(--bg-dark);
	color: var(--text-white);
}

body.dark-mode .modal-box{
	background:var(--dark-item);
	color: var(--text-white);
}

body.dark-mode .btn-primary{
	background:var(--dark-blue);
	color: var(--text-white);
}

body.dark-mode .btn-danger{
	background:var(--red);
	color: var(--text-white);
}

.main-content{
	flex:1 0 auto;
}

/* HEADER sticky */
header {
	position: fixed;   /* statt sticky */
	top: 0;
	left: 0;
	width: 100%;
	height: 50px;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: var(--blue);
	color: var(--white);
	box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* HEADER Titel */
header h1{
	margin:0;
	text-align:center;
	flex:1;
	z-index:1;
}

/* SEARCH */
#search-btn{
	margin-right: 30px;
	padding:6px 12px;
	border-radius:6px;
	border:none;
	background:var(--white);
	color:var(--white);
	cursor:pointer;
	font-size:1rem;
}

#header-search{
	display:none;
	position:absolute;
	font-size: 2em;
	top:0;
	left:0;
	width:100%;
	height:100%;
	background:var(--bg-light);
	display:flex;
	align-items:center;
	justify-content:center;
	padding:0 16px;
	box-sizing:border-box;
	z-index:1001;
	opacity:0;
	pointer-events:none;
	transition:opacity 0.3s ease;
}

#header-search.show{
	display:flex;
	opacity:1;
	pointer-events:auto;
}

#header-search input{
	width:100%;
	max-width:500px;
	padding:12px;
	font-size:1rem;
	border:none;
	outline:none;
	border-radius:8px;
	box-shadow:0 2px 6px rgba(0,0,0,0.2);
}

#cache-status {
	position: fixed;
	top: 12px;            /* Abstand vom oberen Rand */
	left: 50%;            /* horizontale Mitte */
	transform: translateX(-50%); /* perfekt zentrieren */
	background: var(--red);
	color: var(--white);
	padding: 8px 16px;
	border-radius: 8px;
	font-size: 13px;
	display: none;        /* standardmäßig unsichtbar */
	z-index: 1003;        /* über Header, unter Update-Banner, falls nötig anpassen */
	box-shadow: 0 4px 12px rgba(0,0,0,0.25);
	text-align: center;
}

.update-banner {
	position: fixed;
	top: 12px;
	left: 12px;
	right: 12px;
	background: var(--red);
	color: var(--white);
	padding: 14px 16px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 14px;
	box-shadow: 0 6px 20px rgba(0,0,0,.25);
	z-index: 1002; /* über Header */
}

.update-banner strong {
	font-weight: 600;
}

.update-banner .update-btn {
	background: var(--white);
	color: var(--blue);
	border: none;
	border-radius: 8px;
	padding: 6px 10px;
	font-weight: 600;
	cursor: pointer;
}

.ios-install-banner {
	position: fixed;         /* bleibt immer im Viewport */
	bottom: 12px;            /* Abstand vom unteren Rand */
	left: 12px;
	right: 12px;
	background: var(--red);     /* damals rot, kann durch var(--blue) ersetzt werden */
	color: var(--white);
	padding: 14px 16px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 14px;
	box-shadow: 0 6px 20px rgba(0,0,0,.25);
	z-index: 9999;           /* hoch genug, damit es über Footer schwebt */
}

.ios-install-banner strong {
	font-weight: 600;
}

.ios-install-banner .close-btn {
	background: none;
	border: none;
	color: var(--white);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding-left: 12px;
}

.filterContainer {
	max-width: 700px;
    padding: 1rem;
    margin-top: 60px;
	margin-left: auto;
	margin-right: auto;
}

.listContainer {
	max-width:700px;
	padding:1rem;
	margin-top: 135px; 
	margin-bottom: auto;
	margin-left: auto;
	margin-right: auto;
}

.item{
	background:var(--white);
	padding:0.8rem;
	border-radius:10px;
	margin-bottom:0.7rem;

	display:flex;
	align-items:center;

	box-shadow:0 2px 4px rgba(0,0,0,0.1);
	transition:transform 0.15s ease, box-shadow 0.15s ease;
}

.item:hover{
	transform:translateY(-2px);
	box-shadow:0 4px 8px rgba(0,0,0,0.15);
}

.item img{
	width:60px;
	height:60px;
	object-fit:cover;
	border-radius:8px;
	margin-right:0.8rem;
	flex-shrink:0;
}

/* Item Content */
.item-content{
	flex:1;
	display:flex;
	flex-direction:column;
	height:60px; /* statt min-height */
}

/* Titel */
.item-title{
	flex:1;
	display:flex;
	align-items:center;
	font-weight:600;
	line-height:1.3;
}

/* Kategorien unter Items */
.item-categories{
	display:flex;
	flex-wrap:wrap;
	justify-content:flex-end;
	gap:0.3rem;
	margin-top:auto; /* WICHTIG */
}

.item-tag{
	padding:0.2rem 0.4rem;
	background:var(--bg-light);
	color:var(--text-black);
	border:none;
	border-radius:5px;
	font-size:0.7rem;
	line-height:1;
	cursor:pointer;
	white-space:nowrap;
	transition:filter 0.15s ease, transform 0.15s ease;
}

.checkbox{
	margin-right:1.6rem;
	transform:scale(2.2);
	cursor:pointer;
}

/* Gruppen */
.category-group {
	margin-bottom: 1.5rem;
	padding: 0.75rem;
}

.category-group-title {
	font-size: 1rem;
	font-weight: 700;
	margin-bottom: 0.8rem;
	padding-bottom: 0.4rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* FILTERBAR sticky + scrollable */
.filterBar {
	width: 100%;
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	gap: 0.5rem;
	padding-top: 0.2rem;
	padding-bottom: 0.2rem;
	z-index: 10;
}

.placeholder {
	position: fixed;   /* statt sticky */
	width: 100%;
	height: 125px;
	z-index: 2;
	align-items: center;
	padding-top: 1rem;
	background: #f5f5f5;
}

.filter-btn, .reset-btn, #search-btn, .pack-btn{
	white-space: nowrap;      /* Kein Zeilenumbruch innerhalb des Buttons */
	transition:background 0.15s ease, transform 0.15s ease;
}

.filter-btn:hover, .reset-btn:hover, #search-btn:hover, .pack-btn:hover, .item-tag:hover{
	transform:translateY(-2px);
	filter:brightness(1.2);
}

.filter-btn{
	padding:0.5rem 0.8rem;
	background:var(--blue);
	color:var(--white);
	border:none;
	border-radius:8px;
	font-size:0.8rem;
	cursor:pointer;
}

.reset-btn{
	width:100%;
	padding:0.8rem;
	background:var(--red);
	color:var(--white);
	border:none;
	border-radius:10px;
	font-size:1rem;
	font-weight:600;
	cursor:pointer;
}

/* PACKS unten */
.packsButtonCloud{
	display:flex;
	flex-wrap:wrap;
	gap:8px;
	margin:1rem auto;
	max-width:700px;
}

.pack-btn{
	padding:0.5rem 0.8rem;
	background:var(--blue);
	color:var(--white);
	border-radius:8px;
	text-decoration:none;
	font-size:0.8rem;
	font-weight:600;
}

/* ERROR */
.error{
	background:#f8d7da;
	padding:8px;
	border-radius:6px;
	margin-bottom:8px;
}

.static-item{
  background:var(--white);
  padding:0.8rem;
  border-radius:10px;
  margin-bottom:0.7rem;
  display:flex;
  align-items:center;
  box-shadow:0 2px 4px rgba(0,0,0,0.1);
  transition:transform 0.15s ease, box-shadow 0.15s ease;
}

.static-item-title{
  font-weight:600;
  margin-bottom:0.2rem;
}

/* FOOTER sticky bottom bei kurzen Seiten */
footer{
	background: var(--blue);
	color: var(--white);
	padding: 1rem;
}

.footer-inner{
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
}

/* links nimmt Platz ein */
.footer-left{
	flex: 1;
}

/* Mitte wirklich zentriert */
.footer-center{
	flex: 1;
	display: flex;
	justify-content: center;
}

.footer-center a{
	color: var(--white);
	text-decoration: none;
	font-weight: 600;
}

/* rechts */
.footer-right{
	flex: 1;
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 10px;
}

/* Dark Mode Controls */
.footer-controls{
	display:flex;
	justify-content:flex-end;
	align-items:center;
	gap:12px;
	margin-top:10px;
}

.footer-controls-text{
	font-size:0.7rem;
}

.theme-switch{
	position:relative;
	display:inline-block;
	width:52px;
	height:30px;
}

.theme-switch input{
	opacity:0;
	width:0;
	height:0;
}

.slider{
	position:absolute;
	cursor:pointer;
	top:0;
	left:0;
	right:0;
	bottom:0;
	background-color:#777;
	transition:.25s;
	border-radius:34px;
}

.slider:before{
	position:absolute;
	content:"";
	height:22px;
	width:22px;
	left:4px;
	bottom:4px;
	background-color:var(--text-white);
	transition:.25s;
	border-radius:50%;
}

.theme-switch input:checked + .slider{
	background-color:var(--bg-dark);
}

.theme-switch input:checked + .slider:before{
	transform:translateX(22px);
}

body.no-theme-switch .footer-controls{
	display: none;
}

/* Mail to Modal */
.modal-overlay{
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.5);
	z-index: 10000;
	justify-content: center;
	align-items: center;
}

.modal-box{
	background: var(--white);
	padding: 20px;
	max-width: 500px;
	width: 90%;
	border-radius: 8px;
	position: relative;
	max-height: 80%;
	overflow: auto;
	box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.modal-content{
	margin-bottom: 10px;
}

.modal-actions{
	margin-top: 10px;
	text-align: right;
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

/* Buttons */
.btn-primary{
	padding: 0.5rem 0.8rem;
	background: var(--blue);
	color: var(--white);
	border: none;
	border-radius: 8px;
	font-size: 0.8rem;
	cursor: pointer;
}

.btn-danger{
	padding: 0.5rem 0.8rem;
	background: var(--red);
	color: var(--white);
	border: none;
	border-radius: 8px;
	font-size: 0.8rem;
	cursor: pointer;
}

/* RESPONSIVE */
@media(max-width:700px){
  header{
    justify-content:space-between;
	height: 50px;
    padding:1rem;
	box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  }
  header h1{
    text-align:left;
    font-size:1.2rem;
    flex:initial;
  }
  #search-btn{flex:initial;}
  #header-search{
    width:100%;
    height:100%;
    top:0;
    left:0;
    transform:none;
  }
}
