/* Recyca Audience Selector — selector.css */

:root {
	--recyca-green: #AAC626;
	--recyca-green-dark: #8fa51e;
	--recyca-green-light: #c5df4a;
	--recyca-text: #1a1a1a;
	--recyca-text-muted: #6b7280;
	--recyca-white: #ffffff;
	--recyca-card-bg: #ffffff;
	--recyca-card-border: #e5e7eb;
	--recyca-card-hover: #f9fbe8;
	--recyca-radius: 16px;
	--recyca-radius-sm: 8px;
	--recyca-shadow: 0 4px 24px rgba(0,0,0,0.10);
	--recyca-shadow-hover: 0 8px 32px rgba(170,198,38,0.25);
	--recyca-transition: 0.22s ease;
}

/* Selector overlay — fixed to the viewport so it always starts at the top,
   independent of theme headers, page padding, or content above the shortcode. */
.recyca-selector-wrap {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	overflow-y: auto;
	scrollbar-width: none;     /* Firefox — hide scrollbar track */
	-ms-overflow-style: none;  /* IE / Edge legacy */
	padding: clamp(24px, 4vh, 64px) 16px 48px;
	box-sizing: border-box;
	background: rgba(255,255,255,0.96);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

/* Hide scrollbar track in WebKit/Blink (Chrome, Safari, Edge) */
.recyca-selector-wrap::-webkit-scrollbar {
	display: none;
}

/* Account for WordPress admin bar (32px desktop, 46px mobile) */
.admin-bar .recyca-selector-wrap {
	padding-top: 52px;
}

@media screen and (max-width: 782px) {
	.admin-bar .recyca-selector-wrap {
		padding-top: 66px;
	}
}

/* Overlay child div no longer needed */
.recyca-selector-overlay {
	display: none;
}

/* Modal — no fixed height, no overflow constraint */
.recyca-selector-modal {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 900px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(16px, 3vh, 32px);
	padding: 0 16px 24px;
	box-sizing: border-box;
}

/* Logo */
.recyca-selector-logo {
	width: 52px;
	height: 52px;
	margin-bottom: -8px;
}

.recyca-selector-logo svg {
	width: 100%;
	height: 100%;
}

/* Header */
.recyca-selector-header {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.recyca-selector-headline {
	margin: 0;
	font-size: clamp(28px, 5vw, 44px);
	font-weight: 700;
	color: var(--recyca-text);
	letter-spacing: -0.5px;
	line-height: 1.15;
}

.recyca-selector-subheadline {
	margin: 0;
	font-size: clamp(15px, 2.5vw, 18px);
	color: var(--recyca-text-muted);
	font-weight: 400;
}

/* Language switcher */
.recyca-selector-lang-switcher {
	display: flex;
	gap: 8px;
	justify-content: center;
	flex-wrap: wrap;
}

.recyca-lang-btn {
	padding: 6px 16px;
	border: 2px solid var(--recyca-card-border);
	border-radius: 999px;
	background: transparent;
	color: var(--recyca-text-muted);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: border-color var(--recyca-transition), color var(--recyca-transition), background var(--recyca-transition);
	letter-spacing: 0.04em;
}

.recyca-lang-btn:hover {
	border-color: var(--recyca-green);
	color: var(--recyca-green-dark);
}

.recyca-lang-btn.active {
	border-color: var(--recyca-green);
	background: var(--recyca-green);
	color: var(--recyca-white);
}

/* Cards grid */
.recyca-selector-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	width: 100%;
}

/* Server-side fallback cards use <a> elements — reset link styling so they
   look identical to the JS-rendered <div> cards. */
a.recyca-card,
a.recyca-card:visited,
a.recyca-card:hover,
a.recyca-card:focus {
	text-decoration: none;
	color: inherit;
}

/* Card */
.recyca-card {
	background: var(--recyca-card-bg);
	border: 2px solid var(--recyca-card-border);
	border-radius: var(--recyca-radius);
	padding: 32px 24px 28px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 12px;
	cursor: pointer;
	transition: border-color var(--recyca-transition), box-shadow var(--recyca-transition), background var(--recyca-transition), transform var(--recyca-transition);
	box-shadow: var(--recyca-shadow);
}

.recyca-card:hover,
.recyca-card:focus-within {
	border-color: var(--recyca-green);
	background: var(--recyca-card-hover);
	box-shadow: var(--recyca-shadow-hover);
	transform: translateY(-3px);
}

.recyca-card-icon {
	width: 56px;
	height: 56px;
	object-fit: contain;
}

.recyca-card-label {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--recyca-text);
	line-height: 1.2;
}

.recyca-card-desc {
	margin: 0;
	font-size: 14px;
	color: var(--recyca-text-muted);
	line-height: 1.5;
	flex: 1;
}

.recyca-card-btn {
	margin-top: 8px;
	padding: 10px 22px;
	border: none;
	border-radius: var(--recyca-radius-sm);
	background: var(--recyca-green);
	color: var(--recyca-white);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background var(--recyca-transition), box-shadow var(--recyca-transition);
	white-space: nowrap;
}

.recyca-card-btn:hover {
	background: var(--recyca-green-dark);
	box-shadow: 0 2px 12px rgba(170,198,38,0.35);
}

/* Reset button */
.recyca-reset-wrap {
	display: inline-block;
}

.recyca-reset-button {
	color: var(--recyca-text-muted);
	font-size: 14px;
	text-decoration: none;
	border-bottom: 1px dashed var(--recyca-card-border);
	transition: color var(--recyca-transition), border-color var(--recyca-transition);
}

.recyca-reset-button:hover {
	color: var(--recyca-green-dark);
	border-color: var(--recyca-green);
}

/* Responsive */
@media (max-width: 600px) {
	.recyca-selector-wrap {
		padding-left: 12px;
		padding-right: 12px;
	}

	.recyca-selector-modal {
		padding: 0 8px 16px;
	}

	.recyca-selector-cards {
		grid-template-columns: 1fr 1fr;
		gap: 14px;
	}

	.recyca-card {
		padding: 24px 16px 20px;
	}

	.recyca-card-label {
		font-size: 16px;
	}

	.recyca-card-btn {
		font-size: 13px;
		padding: 9px 14px;
	}
}

@media (max-width: 380px) {
	.recyca-selector-cards {
		grid-template-columns: 1fr;
	}
}

/* Fade-in animation */
@keyframes recyca-fadein {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

.recyca-selector-modal {
	animation: recyca-fadein 0.35s ease both;
}

.recyca-card {
	animation: recyca-fadein 0.3s ease both;
}

.recyca-card:nth-child(1) { animation-delay: 0.05s; }
.recyca-card:nth-child(2) { animation-delay: 0.10s; }
.recyca-card:nth-child(3) { animation-delay: 0.15s; }
.recyca-card:nth-child(4) { animation-delay: 0.20s; }

/* Controls row — country selector + language switcher side by side */
.recyca-selector-controls {
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	gap: 12px 20px;
	flex-wrap: wrap;
	width: 100%;
	min-height: 36px;
}

.recyca-country-switcher {
	display: flex;
	align-items: center;
}

.recyca-country-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 500;
	color: var(--recyca-text-muted);
	cursor: default;
	white-space: nowrap;
}

.recyca-country-select {
	appearance: none;
	-webkit-appearance: none;
	background-color: transparent;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 6px center;
	border: 1px solid var(--recyca-card-border);
	border-radius: var(--recyca-radius-sm);
	padding: 4px 24px 4px 10px;
	font-size: 12px;
	font-weight: 600;
	color: var(--recyca-text);
	cursor: pointer;
	transition: border-color var(--recyca-transition), color var(--recyca-transition);
	outline: none;
}

.recyca-country-select:hover,
.recyca-country-select:focus {
	border-color: var(--recyca-green);
	color: var(--recyca-green-dark);
}

/* Debug panel (admin only, server-side rendered) */
.recyca-debug-panel {
	width: 100%;
	font-size: 11px;
	color: #666;
	background: #f7f7f7;
	border: 1px dashed #ccc;
	border-radius: 6px;
	padding: 8px 12px;
	text-align: left;
	font-family: monospace;
	line-height: 2;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 14px;
}

.recyca-debug-label {
	display: inline-block;
	background: var(--recyca-green);
	color: white;
	font-size: 10px;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 4px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-family: inherit;
	flex-shrink: 0;
}

.recyca-debug-item {
	white-space: nowrap;
}

.recyca-debug-key {
	color: #888;
}

.recyca-debug-val {
	font-weight: 700;
}

.recyca-debug-yes { color: #2e7d32; }
.recyca-debug-no  { color: #c62828; }
