/* Weather Widget for Elementor — frontend styles
   All colors/spacing default sensibly, but every value below is
   overridden the moment a matching Style-tab control is set. */

.wwe-weather-widget {
	--wwe-accent: #3E8FDE;
	--wwe-text: #152238;
	--wwe-text-muted: #64748B;
	--wwe-divider: rgba(21, 34, 56, 0.08);
	--wwe-icon-color: var(--wwe-accent);
	display: flex;
}

.wwe-card {
	position: relative;
	width: 100%;
	max-width: 340px;
	background: linear-gradient(155deg, #F5F9FF 0%, #EAF2FE 100%);
	border-radius: 20px;
	padding: 26px 28px;
	box-shadow: 0 10px 30px -12px rgba(21, 34, 56, 0.18);
	color: var(--wwe-text);
	font-family: inherit;
	overflow: hidden;
	opacity: 1;
	transform: none;
}

/* --- Load-in animation (only when JS + data-animate=yes add .is-visible) --- */
.wwe-weather-widget[data-animate="yes"] .wwe-card {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.wwe-weather-widget[data-animate="yes"].is-visible .wwe-card {
	opacity: 1;
	transform: translateY(0);
}

.wwe-location {
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.2px;
	color: var(--wwe-text-muted);
	margin: 0 0 14px;
}

.wwe-primary-row {
	display: flex;
	align-items: center;
	gap: 18px;
}

.wwe-icon {
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	color: var(--wwe-icon-color);
}

.wwe-svg { width: 100%; height: 100%; overflow: visible; }
.wwe-svg-mini { width: 18px; height: 18px; flex: 0 0 auto; }

.wwe-temp-block { min-width: 0; }

.wwe-temp-value {
	font-size: 40px;
	line-height: 1;
	font-weight: 700;
	color: var(--wwe-text);
	white-space: nowrap;
}

.wwe-condition {
	margin-top: 4px;
	font-size: 14px;
	color: var(--wwe-text-muted);
}

.wwe-feels-like {
	margin-top: 2px;
	font-size: 12px;
	color: var(--wwe-text-muted);
	opacity: 0.85;
}

.wwe-divider {
	height: 1px;
	background: var(--wwe-divider);
	margin: 18px 0;
}

.wwe-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
	gap: 14px;
}

.wwe-stat {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}

.wwe-stat-icon { color: var(--wwe-accent); margin-bottom: 2px; }

.wwe-stat-value {
	font-size: 16px;
	font-weight: 600;
	color: var(--wwe-text);
}

.wwe-stat-label {
	font-size: 11px;
	color: var(--wwe-text-muted);
}

.wwe-forecast-row {
	display: flex;
	justify-content: space-between;
	gap: 8px;
}

.wwe-forecast-day {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	flex: 1;
	min-width: 0;
}

.wwe-forecast-dayname {
	font-size: 11px;
	font-weight: 600;
	color: var(--wwe-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.wwe-forecast-icon {
	width: 28px;
	height: 28px;
	color: var(--wwe-icon-color);
}

.wwe-forecast-temps {
	font-size: 12px;
	display: flex;
	gap: 5px;
	white-space: nowrap;
}
.wwe-forecast-temps strong { color: var(--wwe-text); font-weight: 600; }
.wwe-forecast-temps em { color: var(--wwe-text-muted); font-style: normal; }

.wwe-attribution {
	margin-top: 18px;
	font-size: 10px;
	color: var(--wwe-text-muted);
	opacity: 0.7;
	text-align: right;
}
.wwe-attribution a { color: inherit; text-decoration: underline; }

/* --- Error state --- */
.wwe-error-card {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: #FFF6F5;
	border: 1px solid #FFD9D4;
	color: #A2372B;
	max-width: 340px;
}
.wwe-error-card p { margin: 0; font-size: 13px; line-height: 1.5; }
.wwe-warning-icon { flex: 0 0 auto; margin-top: 1px; }

/* -----------------------------------------------------------------
   Compact / inline layout
----------------------------------------------------------------- */
.wwe-layout-compact .wwe-card { max-width: 100%; padding: 14px 20px; border-radius: 14px; }
.wwe-layout-compact .wwe-card-inner {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 18px;
}
.wwe-layout-compact .wwe-location { margin: 0; flex: 0 0 auto; }
.wwe-layout-compact .wwe-primary-row { flex: 0 0 auto; }
.wwe-layout-compact .wwe-icon { width: 40px; height: 40px; }
.wwe-layout-compact .wwe-temp-value { font-size: 26px; }
.wwe-layout-compact .wwe-divider { display: none; }
.wwe-layout-compact .wwe-stats-grid { flex: 1 1 auto; display: flex; gap: 20px; }
.wwe-layout-compact .wwe-stat { flex-direction: row; align-items: center; gap: 6px; }
.wwe-layout-compact .wwe-forecast-row { flex: 0 0 auto; gap: 14px; }
.wwe-layout-compact .wwe-attribution { flex-basis: 100%; text-align: left; margin-top: 6px; }

/* -----------------------------------------------------------------
   Condition animations — only run while data-animate="yes"
----------------------------------------------------------------- */
.wwe-weather-widget[data-animate="yes"] .wwe-sun-core {
	animation: wwe-pulse 3.2s ease-in-out infinite;
	transform-origin: center;
}
.wwe-weather-widget[data-animate="yes"] .wwe-sun-rays {
	animation: wwe-spin 24s linear infinite;
	transform-origin: 32px 32px;
}
.wwe-weather-widget[data-animate="yes"] .wwe-cloud-float {
	animation: wwe-float 4.5s ease-in-out infinite;
}
.wwe-weather-widget[data-animate="yes"] .wwe-fog-lines line {
	animation: wwe-drift 3.6s ease-in-out infinite;
}
.wwe-weather-widget[data-animate="yes"] .wwe-fog-lines line:nth-child(2) { animation-delay: 0.4s; }
.wwe-weather-widget[data-animate="yes"] .wwe-fog-lines line:nth-child(3) { animation-delay: 0.8s; }

.wwe-weather-widget[data-animate="yes"] .wwe-drop {
	animation: wwe-rain-fall 0.9s ease-in infinite;
	opacity: 0;
}
.wwe-weather-widget[data-animate="yes"] .wwe-drop-1 { animation-delay: 0s; }
.wwe-weather-widget[data-animate="yes"] .wwe-drop-2 { animation-delay: 0.25s; }
.wwe-weather-widget[data-animate="yes"] .wwe-drop-3 { animation-delay: 0.5s; }

.wwe-weather-widget[data-animate="yes"] .wwe-flake {
	animation: wwe-snow-fall 3s ease-in-out infinite;
}
.wwe-weather-widget[data-animate="yes"] .wwe-flake-2 { animation-delay: 0.6s; }
.wwe-weather-widget[data-animate="yes"] .wwe-flake-3 { animation-delay: 1.2s; }

.wwe-weather-widget[data-animate="yes"] .wwe-bolt {
	animation: wwe-flash 2.2s ease-in-out infinite;
}

@keyframes wwe-pulse {
	0%, 100% { opacity: 1; filter: drop-shadow(0 0 0 rgba(255,183,77,0)); }
	50% { opacity: 0.85; filter: drop-shadow(0 0 6px rgba(255,183,77,0.45)); }
}
@keyframes wwe-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}
@keyframes wwe-float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-4px); }
}
@keyframes wwe-drift {
	0%, 100% { transform: translateX(0); opacity: 0.9; }
	50% { transform: translateX(4px); opacity: 0.5; }
}
@keyframes wwe-rain-fall {
	0% { opacity: 0; transform: translateY(-3px); }
	30% { opacity: 1; }
	100% { opacity: 0; transform: translateY(7px); }
}
@keyframes wwe-snow-fall {
	0% { transform: translateY(-2px); opacity: 0.4; }
	50% { opacity: 1; }
	100% { transform: translateY(4px); opacity: 0.4; }
}
@keyframes wwe-flash {
	0%, 45%, 100% { opacity: 1; }
	48%, 52% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
	.wwe-weather-widget[data-animate="yes"] .wwe-card {
		transition: none;
		opacity: 1;
		transform: none;
	}
	.wwe-weather-widget * {
		animation: none !important;
	}
}

@media (max-width: 380px) {
	.wwe-card { padding: 20px; }
	.wwe-temp-value { font-size: 32px; }
	.wwe-stats-grid { grid-template-columns: 1fr 1fr; }
}
