/**
 * css/header.css - KORRIGIERTE VERSION
 * Header und Navigation Styles für Flohmarkt-Karte.de
 * Mit Toast-Notification Alert System - OHNE VERSCHIEBUNG
 */

/* Header und Navigation */
.header {
	background: var(--bg-white);
	box-shadow: var(--shadow-sm);
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	height: 70px;
	overflow: visible;
	/* GEÄNDERT: visible statt hidden */
}

.nav-container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 2rem;
	display: grid;
	grid-template-columns: auto 1fr auto auto;
	gap: 2rem;
	align-items: center;
	height: 70px;
	position: relative;
}

.logo {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	text-decoration: none;
	color: var(--primary-color);
	font-size: 1.5rem;
	font-weight: bold;
}

.logo i {
	font-size: 1.8rem;
}

.nav-menu {
	display: flex;
	list-style: none;
	gap: 2rem;
	align-items: center;
	justify-self: center;
}

.nav-menu a {
	text-decoration: none;
	color: var(--text-primary);
	font-weight: 500;
	transition: var(--transition-fast);
	padding: 0.5rem 1rem;
	border-radius: var(--border-radius-sm);
}

.nav-menu a:hover,
.nav-menu a:focus {
	color: var(--primary-color);
	background-color: var(--bg-light);
}

/* Header Login Form - KORRIGIERT */
.header-auth {
	justify-self: end;
	position: relative;
	height: 70px;
	display: flex;
	align-items: center;
	/* WICHTIG: Feste Breite verhindert Verschiebung */
	min-width: 380px;
	width: 380px;
}

.header-login-form {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
}

.header-login-fields {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	position: relative;
	width: 100%;
}

/* KORRIGIERT: Feste Breiten für Input-Felder */
.header-login-fields input {
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius-sm);
	font-size: 0.9rem;
	transition: var(--transition-fast);
	background: var(--bg-white);
	position: relative;
	z-index: 1;
	/* WICHTIG: Feste Breiten - ändern sich nicht beim Focus */
	width: 120px;
	min-width: 120px;
	max-width: 120px;
}

/* KORRIGIERT: Focus ohne Breitenänderung */
.header-login-fields input:focus {
	border-color: var(--primary-color);
	box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1);
	outline: none;
	/* ENTFERNT: width-Änderung */
}

.header-login-fields input::placeholder {
	color: var(--text-light);
	font-size: 0.85rem;
}

.btn-header-login {
	padding: 0.5rem 1rem;
	background: var(--primary-color);
	color: var(--text-white);
	border: none;
	border-radius: var(--border-radius-sm);
	cursor: pointer;
	font-weight: 500;
	font-size: 0.9rem;
	transition: var(--transition);
	display: flex;
	align-items: center;
	gap: 0.25rem;
	white-space: nowrap;
	height: 38px;
	position: relative;
	z-index: 1;
	/* WICHTIG: Feste Breite */
	min-width: 100px;
}

.btn-header-login:hover,
.btn-header-login:focus {
	background: var(--primary-dark);
	transform: translateY(-1px);
}

.btn-header-login:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
}

/* Mobile Navigation */
.mobile-menu-btn {
	display: none;
	background: none;
	border: none;
	font-size: 1.5rem;
	color: var(--text-primary);
	cursor: pointer;
	justify-self: end;
	padding: 0.5rem;
	border-radius: var(--border-radius-sm);
	transition: var(--transition);
}

.mobile-menu-btn:hover {
	background: var(--bg-light);
	color: var(--primary-color);
}

/* ==========================================
   TOAST-NOTIFICATION ALERT SYSTEM - KORRIGIERT
   ========================================== */

/* KORRIGIERT: Toast-Notification Alert - Absolut positioniert */
.header-alert {
	position: fixed;
	top: 80px;
	/* GEÄNDERT: Unter dem Header, aber oberhalb allem anderen */
	right: -400px;
	width: 350px;
	max-width: calc(100vw - 40px);
	z-index: 10001;
	/* ERHÖHT: Höher als Header (1000) */
	padding: 16px 20px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;

	/* Schöner Schatten für Toast-Effekt */
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.12),
		0 2px 8px rgba(0, 0, 0, 0.08);

	/* Glasmorphism-Effekt */
	backdrop-filter: blur(16px);
	border: 1px solid rgba(255, 255, 255, 0.2);

	/* Smooth Animation von rechts */
	transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	opacity: 0;
	transform: translateX(20px) scale(0.95);
	pointer-events: none;
}

/* Alert anzeigen - gleitet von rechts herein */
.header-alert.show {
	right: 20px;
	opacity: 1;
	transform: translateX(0) scale(1);
	pointer-events: auto;

	/* Zusätzliche Eingangs-Animation */
	animation: toastSlideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes toastSlideIn {
	0% {
		right: -400px;
		opacity: 0;
		transform: translateX(50px) scale(0.9);
	}

	60% {
		right: 10px;
		transform: translateX(-10px) scale(1.02);
	}

	100% {
		right: 20px;
		opacity: 1;
		transform: translateX(0) scale(1);
	}
}

/* Alert-Typen mit modernen Farben */
.header-alert.success {
	background: linear-gradient(135deg, rgba(76, 175, 80, 0.95), rgba(56, 142, 60, 0.95));
	color: white;
	border-left: 4px solid #4caf50;
}

.header-alert.error {
	background: linear-gradient(135deg, rgba(244, 67, 54, 0.95), rgba(211, 47, 47, 0.95));
	color: white;
	border-left: 4px solid #f44336;
}

.header-alert.info {
	background: linear-gradient(135deg, rgba(33, 150, 243, 0.95), rgba(25, 118, 210, 0.95));
	color: white;
	border-left: 4px solid #2196f3;
}

.header-alert.warning {
	background: linear-gradient(135deg, rgba(255, 152, 0, 0.95), rgba(245, 124, 0, 0.95));
	color: white;
	border-left: 4px solid #ff9800;
}

/* Icons für bessere Erkennbarkeit */
.header-alert.success::before {
	content: '✅ ';
	margin-right: 8px;
	font-size: 16px;
}

.header-alert.error::before {
	content: '❌ ';
	margin-right: 8px;
	font-size: 16px;
}

.header-alert.info::before {
	content: 'ℹ️ ';
	margin-right: 8px;
	font-size: 16px;
}

.header-alert.warning::before {
	content: '⚠️ ';
	margin-right: 8px;
	font-size: 16px;
}

/* Auto-Hide nach 5 Sekunden mit smooth Ausgangs-Animation */
.header-alert.auto-hide {
	animation: toastSlideOut 5s ease-in-out forwards;
}

@keyframes toastSlideOut {

	0%,
	80% {
		right: 20px;
		opacity: 1;
		transform: translateX(0) scale(1);
	}

	95% {
		opacity: 0.3;
		transform: translateX(10px) scale(0.98);
	}

	100% {
		right: -400px;
		opacity: 0;
		transform: translateX(50px) scale(0.9);
	}
}

/* Hover-Effekt für Interaktivität */
.header-alert:hover {
	transform: translateX(-5px) scale(1.02);
	box-shadow:
		0 12px 40px rgba(0, 0, 0, 0.15),
		0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Close-Button (optional) */
.header-alert-close {
	position: absolute;
	top: 12px;
	right: 12px;
	background: rgba(255, 255, 255, 0.2);
	border: none;
	color: white;
	cursor: pointer;
	font-size: 16px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	opacity: 0.8;
}

.header-alert-close:hover {
	background: rgba(255, 255, 255, 0.3);
	opacity: 1;
	transform: rotate(90deg);
}

/* Progress Bar (zeigt verbleibende Zeit) */
.header-alert::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: rgba(255, 255, 255, 0.3);
	border-radius: 0 0 12px 12px;
	transform-origin: left;
	animation: progressBar 5s linear forwards;
}

@keyframes progressBar {
	0% {
		transform: scaleX(1);
	}

	100% {
		transform: scaleX(0);
	}
}

/* ==========================================
   RESPONSIVE DESIGN - KORRIGIERT
   ========================================== */

@media (max-width: 1024px) {
	.nav-container {
		grid-template-columns: auto 1fr auto;
		gap: 1rem;
		height: 70px;
	}

	/* KORRIGIERT: Kompaktere aber feste Breiten */
	.header-auth {
		min-width: 300px;
		width: 300px;
	}

	.header-login-fields {
		gap: 0.25rem;
	}

	.header-login-fields input {
		width: 100px;
		min-width: 100px;
		max-width: 100px;
		font-size: 0.85rem;
	}

	.btn-header-login .btn-text {
		display: none;
	}

	.btn-header-login {
		min-width: 80px;
	}
}

/* Tablet-spezifische Anpassungen */
@media (min-width: 769px) and (max-width: 1024px) {
	.header-auth {
		display: flex;
		height: 70px;
		min-width: 320px;
		width: 320px;
	}

	.header-login-fields input {
		width: 110px;
		min-width: 110px;
		max-width: 110px;
		font-size: 0.85rem;
		padding: 0.4rem 0.6rem;
	}

	.btn-header-login {
		padding: 0.4rem 0.8rem;
		font-size: 0.85rem;
		height: 34px;
		min-width: 90px;
	}

	.mobile-menu-btn {
		display: none;
	}

	.nav-menu {
		display: flex;
		gap: 1.5rem;
	}
}

/* Mobile */
@media (max-width: 768px) {
	.nav-container {
		grid-template-columns: auto auto;
		gap: 1rem;
		height: 70px;
	}

	.nav-menu {
		display: none;
	}

	.mobile-menu-btn {
		display: block;
	}

	/* Header-Auth auf Mobile verstecken */
	.header-auth {
		display: none !important;
	}

	/* KORRIGIERT: Toast Alert für Mobile */
	.header-alert {
		top: 80px;
		right: -100%;
		left: 15px;
		width: auto;
		max-width: calc(100vw - 30px);
		font-size: 13px;
		padding: 14px 18px;
	}

	.header-alert.show {
		right: 15px;
	}

	@keyframes toastSlideIn {
		0% {
			right: -100%;
			opacity: 0;
			transform: translateX(20px) scale(0.95);
		}

		100% {
			right: 15px;
			opacity: 1;
			transform: translateX(0) scale(1);
		}
	}
}

@media (max-width: 480px) {
	.nav-container {
		padding: 0 1rem;
		height: 70px;
	}

	/* Toast Alert für kleine Screens */
	.header-alert {
		top: 80px;
		left: 10px;
		max-width: calc(100vw - 20px);
		padding: 12px 16px;
		font-size: 13px;
	}

	.header-alert.show {
		right: 10px;
	}
}

/* KORRIGIERT: Stacked Toasts - Mehrere gleichzeitig */
.header-alert:nth-of-type(2) {
	top: 170px;
	/* GEÄNDERT: Mehr Abstand für größere Toast-Boxen */
	animation-delay: 0.1s;
}

.header-alert:nth-of-type(3) {
	top: 260px;
	animation-delay: 0.2s;
}

.header-alert:nth-of-type(4) {
	top: 350px;
	animation-delay: 0.3s;
}

/* Accessibility */
.header-alert:focus-within {
	outline: 2px solid rgba(255, 255, 255, 0.5);
	outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
	.header-alert {
		transition: opacity 0.3s ease;
		animation: none;
	}

	.header-alert.show {
		right: 20px;
		animation: none;
	}

	.header-alert:hover {
		transform: none;
	}

	.header-alert::after {
		animation: none;
	}
}