/* Kleingarten-Wetter — Design-System
   Naturnahe Palette (Gartengrün/Erdtöne), Glassmorphism-Karte,
   dynamische Gradient-Header je nach Wetterlage. */

.kgw-widget {
	--kgw-green-900: #1b3a2b;
	--kgw-green-700: #2f6b45;
	--kgw-green-500: #4f9563;
	--kgw-green-100: #eaf5ee;
	--kgw-earth-600: #7a5230;
	--kgw-sun-500: #f0a93f;
	--kgw-rain-600: #3b6ea5;
	--kgw-storm-700: #4a3b6b;
	--kgw-snow-400: #a9c6d8;
	--kgw-red: #d8534f;
	--kgw-yellow: #e6b23d;
	--kgw-grey-100: #f6f7f5;
	--kgw-grey-300: #dfe3df;
	--kgw-grey-600: #667066;
	--kgw-text: #1c2620;
	--kgw-radius: 18px;

	max-width: 460px;
	margin: 1.5em 0;
	border-radius: var(--kgw-radius);
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--kgw-text);
	box-shadow: 0 12px 30px -10px rgba(27, 58, 43, 0.35), 0 2px 8px rgba(0,0,0,0.06);
	background: #fff;
	position: relative;
}

.kgw-header {
	position: relative;
	padding: 22px 22px 18px;
	color: #fff;
	background: linear-gradient(135deg, var(--kgw-green-700), var(--kgw-green-900));
	overflow: hidden;
	isolation: isolate;
}
.kgw-header::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 85% -10%, rgba(255,255,255,0.25), transparent 55%);
	pointer-events: none;
	z-index: 0;
}
.kgw-header-top, .kgw-main-temp, .kgw-substats, .kgw-regen-heute-bar { position: relative; z-index: 2; }

/* --- Wetter-Animationen (episches Design) --- */
.kgw-anim { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }

.kgw-anim-sonne::before {
	content: "";
	position: absolute;
	top: -60px; right: -40px;
	width: 220px; height: 220px;
	background: conic-gradient(from 0deg, rgba(255,255,255,0.35), transparent 20deg, transparent 340deg, rgba(255,255,255,0.35));
	border-radius: 50%;
	animation: kgw-rotate 22s linear infinite;
	opacity: 0.8;
}

.kgw-anim-wolken::before, .kgw-anim-wolken::after {
	content: "☁️";
	position: absolute;
	font-size: 46px;
	opacity: 0.35;
	filter: blur(0.5px);
	animation: kgw-drift 26s linear infinite;
}
.kgw-anim-wolken::before { top: 10px; left: -60px; animation-duration: 30s; }
.kgw-anim-wolken::after  { top: 55px; left: -120px; font-size: 32px; animation-duration: 22s; animation-delay: -8s; opacity: 0.22; }

.kgw-anim-regen {
	background-image: repeating-linear-gradient(115deg, rgba(255,255,255,0.35) 0px, rgba(255,255,255,0.35) 2px, transparent 2px, transparent 22px);
	background-size: 140% 220%;
	animation: kgw-rain 0.6s linear infinite;
	opacity: 0.5;
}

.kgw-anim-schnee::before, .kgw-anim-schnee::after {
	content: "❄ ❅ ❆ ❄ ❅ ❆ ❄ ❅";
	position: absolute;
	left: 0; right: 0;
	color: rgba(255,255,255,0.55);
	font-size: 16px;
	letter-spacing: 30px;
	white-space: nowrap;
	animation: kgw-snowfall 9s linear infinite;
}
.kgw-anim-schnee::before { top: -20px; }
.kgw-anim-schnee::after  { top: -120px; font-size: 12px; letter-spacing: 22px; animation-duration: 13s; animation-delay: -4s; opacity: 0.7; }

.kgw-anim-gewitter {
	background: rgba(255,255,255,0);
	animation: kgw-blitz 5s ease-in-out infinite;
}

@keyframes kgw-rotate { to { transform: rotate(360deg); } }
@keyframes kgw-drift { from { transform: translateX(0); } to { transform: translateX(520px); } }
@keyframes kgw-rain { from { background-position: 0 0; } to { background-position: -40px 220px; } }
@keyframes kgw-snowfall { from { transform: translateY(-10px); } to { transform: translateY(220px); } }
@keyframes kgw-blitz {
	0%, 92%, 100% { background-color: rgba(255,255,255,0); }
	93%, 95% { background-color: rgba(255,255,255,0.28); }
}

@media (prefers-reduced-motion: reduce) {
	.kgw-anim, .kgw-anim::before, .kgw-anim::after { animation: none !important; }
}
.kgw-bg-sonnig   { background: linear-gradient(135deg, #f6b93b, #e58e26) !important; }
.kgw-bg-bewoelkt { background: linear-gradient(135deg, #7f8c9b, #4b5661) !important; }
.kgw-bg-regen    { background: linear-gradient(135deg, #4a75a8, #2a4a6e) !important; }
.kgw-bg-schnee   { background: linear-gradient(135deg, #7fa5c2, #3f5a75) !important; }
.kgw-bg-gewitter { background: linear-gradient(135deg, #5c4a80, #2c2242) !important; }

.kgw-header-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	position: relative;
	z-index: 2;
	font-size: 13px;
	opacity: 0.95;
}
.kgw-location { display: flex; align-items: center; gap: 6px; font-weight: 600; letter-spacing: 0.2px; }
.kgw-refresh {
	background: rgba(255,255,255,0.18);
	border: none;
	color: #fff;
	width: 30px; height: 30px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 15px;
	transition: transform 0.4s ease, background 0.2s ease;
}
.kgw-refresh:hover { background: rgba(255,255,255,0.3); }
.kgw-refresh.kgw-spinning { animation: kgw-spin 0.8s linear infinite; }
@keyframes kgw-spin { to { transform: rotate(360deg); } }

.kgw-main-temp {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 14px;
	position: relative;
	z-index: 2;
}
.kgw-icon { font-size: 54px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2)); }
.kgw-temp { font-size: 44px; font-weight: 700; line-height: 1; }
.kgw-cond { font-size: 14px; opacity: 0.9; margin-top: 4px; }

.kgw-substats {
	display: flex;
	gap: 18px;
	margin-top: 16px;
	font-size: 13px;
	position: relative;
	z-index: 2;
	opacity: 0.95;
}
.kgw-substats div { display: flex; align-items: center; gap: 5px; }

.kgw-regen-jetzt { color: #bfe0ff; }

.kgw-regen-heute-bar {
	position: relative;
	margin-top: 14px;
	z-index: 2;
}
.kgw-regen-heute-track {
	height: 6px;
	border-radius: 4px;
	background: rgba(255,255,255,0.28);
	overflow: hidden;
}
.kgw-regen-heute-fill {
	height: 100%;
	border-radius: 4px;
	background: #ffffff;
	transition: width 0.4s ease;
}
.kgw-regen-heute-label {
	display: inline-block;
	margin-top: 8px;
	font-size: 12px;
	font-weight: 700;
	color: #fff;
	background: rgba(0,0,0,0.22);
	padding: 3px 9px;
	border-radius: 20px;
	letter-spacing: 0.2px;
}

/* --- Warn-Leiste --- */
.kgw-alertbar {
	background: var(--kgw-grey-100);
	border-bottom: 1px solid var(--kgw-grey-300);
	font-size: 13px;
}
.kgw-alertbar summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	font-weight: 700;
}
.kgw-alertbar summary::-webkit-details-marker { display: none; }
.kgw-alertbar-chevron { margin-left: auto; transition: transform 0.2s ease; opacity: 0.6; }
.kgw-alertbar[open] .kgw-alertbar-chevron { transform: rotate(180deg); }
.kgw-alertbar-gelb   { background: #fdf6e5; color: #7a5b12; }
.kgw-alertbar-orange { background: #fdecd6; color: #9a4d0a; }
.kgw-alertbar-rot, .kgw-alertbar-dunkelrot { background: #fdecec; color: #a12a26; }
.kgw-alertbar-list { margin: 0; padding: 0 20px 14px 44px; list-style: disc; }
.kgw-alertbar-list li { margin-bottom: 6px; line-height: 1.4; }
.kgw-pulse summary .kgw-alertbar-icon { animation: kgw-pulse-icon 1.4s ease-in-out infinite; display: inline-block; }
@keyframes kgw-pulse-icon { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .kgw-pulse summary .kgw-alertbar-icon { animation: none; } }

/* --- Akkordeon-Gruppen in Garten-Tools --- */
.kgw-group { border: 1px solid var(--kgw-grey-300); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.kgw-group summary {
	list-style: none;
	cursor: pointer;
	padding: 11px 14px;
	font-weight: 700;
	font-size: 13.5px;
	background: var(--kgw-grey-100);
	display: flex;
	align-items: center;
}
.kgw-group summary::after { content: '▾'; margin-left: auto; opacity: 0.5; transition: transform 0.2s ease; }
.kgw-group[open] summary::after { transform: rotate(180deg); }
.kgw-group summary::-webkit-details-marker { display: none; }
.kgw-group .kgw-tools-grid { padding: 12px; }

.kgw-tabs {
	display: flex;
	background: var(--kgw-grey-100);
	border-bottom: 1px solid var(--kgw-grey-300);
}
.kgw-tab {
	flex: 1;
	padding: 11px 6px;
	background: transparent;
	border: none;
	border-bottom: 3px solid transparent;
	font-size: 13px;
	font-weight: 600;
	color: var(--kgw-grey-600);
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease;
}
.kgw-tab:hover { color: var(--kgw-green-700); }
.kgw-tab.active { color: var(--kgw-green-700); border-bottom-color: var(--kgw-green-500); }

.kgw-panel { padding: 18px 20px 8px; }

.kgw-forecast-row {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
	text-align: center;
}
.kgw-day { font-size: 11px; padding: 6px 2px; border-radius: 10px; background: var(--kgw-grey-100); }
.kgw-day-name { font-weight: 700; margin-bottom: 4px; color: var(--kgw-grey-600); }
.kgw-day-dot { width: 10px; height: 10px; border-radius: 50%; margin: 0 auto 6px; }
.kgw-day-gruen .kgw-day-dot { background: var(--kgw-green-500); }
.kgw-day-gelb .kgw-day-dot { background: var(--kgw-yellow); }
.kgw-day-rot .kgw-day-dot { background: var(--kgw-red); }
.kgw-day-temp { font-weight: 600; }
.kgw-day-rainprob { color: var(--kgw-rain-600); font-size: 10px; margin-top: 3px; font-weight: 600; }
.kgw-day-rain { color: var(--kgw-grey-600); font-size: 9.5px; margin-top: 1px; }

.kgw-legende { font-size: 11px; color: var(--kgw-grey-600); margin-top: 12px; }
.kgw-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; }
.kgw-dot-gruen { background: var(--kgw-green-500); }
.kgw-dot-gelb { background: var(--kgw-yellow); }
.kgw-dot-rot { background: var(--kgw-red); }

.kgw-tools-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.kgw-tool-card {
	background: var(--kgw-grey-100);
	border-radius: 12px;
	padding: 12px 14px;
	border-left: 4px solid var(--kgw-green-500);
	font-size: 13px;
	line-height: 1.45;
}
.kgw-tool-card h4 { margin: 0 0 6px; font-size: 13.5px; }
.kgw-tool-label { font-weight: 700; margin: 2px 0; }
.kgw-tool-meta { color: var(--kgw-grey-600); font-size: 11.5px; margin-top: 6px; }

.kgw-tool-frost { border-left-color: var(--kgw-snow-400); background: #eef6fb; }
.kgw-tool-frost ul { margin: 4px 0 8px 18px; padding: 0; }

.kgw-stufe-hoch, .kgw-stufe-dringend { border-left-color: var(--kgw-red); background: #fdecec; }
.kgw-stufe-mittel, .kgw-stufe-empfohlen { border-left-color: var(--kgw-yellow); background: #fdf6e5; }
.kgw-stufe-niedrig, .kgw-stufe-nicht_noetig { border-left-color: var(--kgw-green-500); background: var(--kgw-green-100); }

.kgw-tool-mond { border-left-color: var(--kgw-storm-700); }

.kgw-tool-schnee { border-left-color: var(--kgw-snow-400); background: #eef6fb; }
.kgw-tool-dwd { border-left-color: var(--kgw-red); }
.kgw-stufe-warn-gelb { border-left-color: var(--kgw-yellow); background: #fdf6e5; }
.kgw-stufe-warn-orange { border-left-color: #e08a2c; background: #fdecd6; }
.kgw-stufe-warn-rot, .kgw-stufe-warn-dunkelrot { border-left-color: var(--kgw-red); background: #fdecec; }

.kgw-stufe-uv-niedrig { border-left-color: var(--kgw-green-500); }
.kgw-stufe-uv-maessig { border-left-color: var(--kgw-yellow); background: #fdf6e5; }
.kgw-stufe-uv-hoch { border-left-color: #e08a2c; background: #fdecd6; }
.kgw-stufe-uv-sehr_hoch, .kgw-stufe-uv-extrem { border-left-color: var(--kgw-red); background: #fdecec; }

.kgw-pollen-list { margin: 4px 0 0 0; padding: 0; list-style: none; }
.kgw-pollen-list li { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.kgw-pollen-badge { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; text-transform: uppercase; color: #fff; }
.kgw-pollen-niedrig { background: var(--kgw-green-500); }
.kgw-pollen-mittel { background: var(--kgw-yellow); color: #4a3a05; }
.kgw-pollen-hoch { background: var(--kgw-red); }

.kgw-kulturen-list { margin: 4px 0 0 0; padding: 0; list-style: none; }
.kgw-kulturen-list li { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.kgw-kultur-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.kgw-kultur-bereit .kgw-kultur-dot { background: var(--kgw-green-500); }
.kgw-kultur-bald .kgw-kultur-dot { background: var(--kgw-yellow); }
.kgw-kultur-zu_kalt .kgw-kultur-dot { background: var(--kgw-grey-300); }
.kgw-kultur-zu_kalt { opacity: 0.55; }

.kgw-tool-gdd { border-left-color: var(--kgw-earth-600); }
.kgw-tool-historie { border-left-color: var(--kgw-rain-600); }
.kgw-tool-regentonne { border-left-color: var(--kgw-rain-600); }
.kgw-tool-rueckblick { border-left-color: var(--kgw-earth-600); }

.kgw-ernte-bar { height: 7px; border-radius: 4px; background: var(--kgw-grey-300); overflow: hidden; margin: 6px 0 4px; }
.kgw-ernte-fill { height: 100%; border-radius: 4px; background: var(--kgw-green-500); transition: width 0.4s ease; }
.kgw-ernte-bereit, .kgw-ernte-bereit_seit { border-left-color: var(--kgw-green-500); background: var(--kgw-green-100); }
.kgw-ernte-bereit .kgw-ernte-fill, .kgw-ernte-bereit_seit .kgw-ernte-fill { background: var(--kgw-green-700); }
.kgw-ernte-im_forecast { border-left-color: var(--kgw-sun-500); }
.kgw-ernte-im_forecast .kgw-ernte-fill { background: var(--kgw-sun-500); }
.kgw-ernte-prognose { border-left-color: var(--kgw-earth-600); }
.kgw-ernte-geplant { border-left-color: var(--kgw-grey-300); opacity: 0.75; }
.kgw-ernte-unbekannt { border-left-color: var(--kgw-grey-300); }

.kgw-ernte-form {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}
.kgw-ernte-form select,
.kgw-ernte-form input[type="date"] {
	padding: 7px 9px;
	border: 1px solid var(--kgw-grey-300);
	border-radius: 8px;
	font-size: 12.5px;
	background: #fff;
	color: var(--kgw-text);
}
.kgw-ernte-form select { flex: 1 1 140px; min-width: 120px; }
.kgw-ernte-add {
	background: var(--kgw-green-500);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 7px 14px;
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s ease;
}
.kgw-ernte-add:hover { background: var(--kgw-green-700); }
.kgw-ernte-liste { display: flex; flex-direction: column; gap: 10px; }
.kgw-ernte-head { display: flex; align-items: center; justify-content: space-between; }
.kgw-ernte-head h4 { margin: 0; }
.kgw-ernte-remove {
	background: none;
	border: none;
	font-size: 18px;
	line-height: 1;
	color: var(--kgw-grey-600);
	cursor: pointer;
	padding: 0 4px;
}
.kgw-ernte-remove:hover { color: var(--kgw-red); }

.kgw-compare-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.kgw-compare-table th, .kgw-compare-table td { padding: 8px 6px; border-bottom: 1px solid var(--kgw-grey-300); text-align: left; }
.kgw-compare-table th { color: var(--kgw-grey-600); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
.kgw-fehler { color: var(--kgw-red); font-style: italic; }

.kgw-footer {
	padding: 10px 20px 16px;
	font-size: 10.5px;
	color: var(--kgw-grey-600);
	text-align: center;
}

.kgw-error { padding: 16px; background: #fdecec; color: var(--kgw-red); border-radius: 12px; }

@media (max-width: 420px) {
	.kgw-widget { max-width: 100%; }
	.kgw-icon { font-size: 42px; }
	.kgw-temp { font-size: 34px; }
	.kgw-forecast-row { grid-template-columns: repeat(7, 1fr); font-size: 9.5px; }
}
