/**
 * Evently component library — buttons, badges, pills, generic form fields.
 * Every homepage/archive/single-event section reuses these instead of
 * redefining its own button/badge styles (brief §14, §25 "reusable
 * component system").
 */

/* ── Buttons — brief §14/§25 button system ───────────────────────── */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 14px 28px;
	border-radius: var(--evently-radius-pill);
	font-size: var(--evently-fs-button);
	font-weight: 700;
	font-family: inherit;
	border: none;
	cursor: pointer;
	transition: transform var(--evently-transition-base) var(--evently-ease),
		box-shadow var(--evently-transition-base) var(--evently-ease),
		opacity var(--evently-transition-fast) ease,
		border-color var(--evently-transition-fast) ease;
	line-height: 1;
	white-space: nowrap;
}

.btn .evently-arrow {
	display: inline-block;
	transition: transform var(--evently-transition-fast) ease;
}

.btn:hover .evently-arrow {
	transform: translateX(4px);
}

.btn--sm {
	padding: 9px 18px;
	font-size: var(--evently-fs-small);
	font-weight: 600;
}

.btn--block {
	display: flex;
	width: 100%;
}

.btn--primary {
	background: var(--evently-dark);
	color: var(--evently-white);
}

.btn--primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 24px rgba(11, 11, 13, 0.18);
}

.btn--secondary {
	background: transparent;
	color: var(--evently-text);
	border: 1.5px solid var(--evently-border);
}

.btn--secondary:hover {
	transform: translateY(-1px);
	border-color: #999;
}

.btn--white {
	background: var(--evently-white);
	color: var(--evently-dark);
}

.btn--white:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 32px rgba(11, 11, 13, 0.2);
}

.btn--accent {
	background: var(--evently-primary);
	color: var(--evently-white);
}

.btn--accent:hover {
	opacity: 0.88;
}

.btn--ghost {
	background: transparent;
	color: var(--evently-text);
}

.btn--ghost:hover {
	background: var(--evently-surface);
}

.btn--outline-white {
	background: transparent;
	color: rgba(255, 255, 255, 0.7);
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn--outline-white:hover {
	border-color: rgba(255, 255, 255, 0.4);
}

.btn--pill-outline {
	background: none;
	border: 1px solid var(--evently-border);
	color: var(--evently-text);
	padding: 7px 16px;
	font-size: var(--evently-fs-caption);
	font-weight: 600;
	border-radius: var(--evently-radius-pill);
}

.btn--pill-outline:hover {
	border-color: #999;
}

.btn:disabled,
.btn[aria-disabled='true'] {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none !important;
	box-shadow: none !important;
}

/* Icon-only round buttons (favorite, search trigger, calendar nav, etc.) */
.evently-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(8px);
	cursor: pointer;
	transition: transform var(--evently-transition-fast) ease;
	padding: 0;
}

.evently-icon-btn:hover {
	transform: scale(1.08);
}

.evently-icon-btn--liked {
	transform: scale(1.15);
}

/* ── Badges / pills — brief "Badges" design-system page ──────────── */

.evently-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: 8px;
	line-height: 1.4;
}

.evently-badge--soft {
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(8px);
	color: var(--evently-text);
}

.evently-badge--accent {
	background: var(--evently-primary-soft);
	color: var(--evently-primary);
	border-radius: var(--evently-radius-pill);
	padding: 6px 14px;
	letter-spacing: 0.12em;
}

.evently-badge--dark {
	background: rgba(0, 0, 0, 0.55);
	color: var(--evently-white);
	backdrop-filter: blur(8px);
}

.evently-badge--success {
	background: rgba(22, 163, 74, 0.1);
	color: var(--evently-success);
}

.evently-badge--warning {
	background: rgba(245, 158, 11, 0.12);
	color: #b45309;
}

.evently-badge--error {
	background: rgba(220, 38, 38, 0.1);
	color: var(--evently-error);
}

/* Filter pill buttons — "Choose Your Vibe" + reused on the Event Archive
   category/quick filters so there's one pill-toggle implementation. */
.evently-pill-filter {
	border: none;
	border-radius: var(--evently-radius-pill);
	padding: 11px 22px;
	font-size: var(--evently-fs-small);
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	background: var(--evently-white);
	color: var(--evently-text);
	box-shadow: 0 0 0 1px var(--evently-border);
	transition: background var(--evently-transition-fast) ease, color var(--evently-transition-fast) ease,
		box-shadow var(--evently-transition-fast) ease;
}

.evently-pill-filter:hover {
	box-shadow: 0 0 0 1px #999;
}

.evently-pill-filter.is-active {
	background: var(--evently-dark);
	color: var(--evently-white);
	box-shadow: none;
}

/* ── Generic card shell ───────────────────────────────────────────── */

.evently-card {
	background: var(--evently-white);
	border: 1px solid var(--evently-border);
	border-radius: var(--evently-radius-lg);
	box-shadow: var(--evently-shadow-card);
}

/* ── Star rating ──────────────────────────────────────────────────── */

.evently-stars {
	font-size: 18px;
	color: var(--evently-warning);
	letter-spacing: 2px;
}

.evently-stars[data-rating] {
	unicode-bidi: bidi-override;
}

/* ── Form fields (search bar, filters, checkout — shared baseline) ── */

.evently-field-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--evently-muted);
	margin-bottom: 5px;
	display: block;
}

.evently-input,
.evently-select {
	width: 100%;
	border: 1px solid var(--evently-border);
	border-radius: var(--evently-radius-sm);
	background: var(--evently-white);
	color: var(--evently-text);
	font-family: inherit;
	font-size: var(--evently-fs-label);
	font-weight: 500;
	padding: 12px 16px;
}

.evently-input::placeholder {
	color: #bbb;
}

.evently-input:focus,
.evently-select:focus {
	outline: none;
	border-color: var(--evently-primary);
	box-shadow: 0 0 0 3px var(--evently-primary-soft);
}

/* ── Avatar (organizer/testimonial initials) ─────────────────────── */

.evently-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--evently-fs-small);
	font-weight: 700;
	color: var(--evently-white);
	flex-shrink: 0;
	overflow: hidden;
}

.evently-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ── Empty / loading states (Event Archive, My Tickets, dashboards) ─ */

.evently-empty-state {
	text-align: center;
	padding: var(--evently-space-9) var(--evently-space-3);
	color: var(--evently-muted);
}

.evently-empty-state__icon {
	width: 56px;
	height: 56px;
	margin: 0 auto var(--evently-space-3);
	color: var(--evently-border);
}

.evently-empty-state h3 {
	color: var(--evently-text);
	margin-bottom: var(--evently-space-1);
}

.evently-empty-state__action {
	margin-top: var(--evently-space-3);
}

.evently-skeleton {
	background: linear-gradient(90deg, var(--evently-surface) 25%, var(--evently-border) 37%, var(--evently-surface) 63%);
	background-size: 400% 100%;
	animation: evently-skeleton-loading 1.4s ease infinite;
	border-radius: var(--evently-radius-md);
}

@keyframes evently-skeleton-loading {
	0% {
		background-position: 100% 50%;
	}

	100% {
		background-position: 0 50%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.evently-skeleton {
		animation: none;
	}
}

/* ── Modal (generic — search, filter drawer, ticket info) ─────────── */

.evently-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(11, 11, 13, 0.55);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 12vh 20px 20px;
	backdrop-filter: blur(2px);
}

.evently-modal[hidden] {
	display: none;
}

body.evently-modal-open {
	overflow: hidden;
}

.evently-modal__panel {
	background: var(--evently-white);
	border-radius: var(--evently-radius-lg);
	box-shadow: var(--evently-shadow-deep);
	width: 100%;
	max-width: 560px;
	padding: var(--evently-space-4);
}

.evently-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--evently-space-3);
}

.evently-modal__title {
	margin: 0;
	font-size: 20px;
}

.evently-modal__search-form {
	display: flex;
	gap: var(--evently-space-2);
}

.evently-modal__search-form .evently-input {
	flex: 1;
}

.evently-modal__hint {
	margin: var(--evently-space-3) 0 0;
	font-size: var(--evently-fs-caption);
	color: var(--evently-muted);
}

.evently-modal__hint a {
	color: var(--evently-primary);
	font-weight: 600;
}

/* ── Event autocomplete (Smart Search + header quick-search) ──────── */

.evently-autocomplete {
	position: relative;
}

.evently-autocomplete.is-autocomplete-open {
	z-index: 40;
}

.evently-autocomplete__panel {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	right: 0;
	z-index: 60;
	min-width: 280px;
	max-width: min(420px, calc(100vw - 32px));
	max-height: 380px;
	overflow-y: auto;
	margin: 0;
	padding: 8px;
	border: 1px solid var(--evently-border);
	border-radius: var(--evently-radius-md);
	background: var(--evently-white);
	box-shadow: var(--evently-shadow-deep);
	box-sizing: border-box;
	scrollbar-width: thin;
}

.search-field--what .evently-autocomplete__panel {
	left: 0;
	right: auto;
	width: min(420px, calc(100vw - 48px));
}

.evently-modal__search-form.evently-autocomplete .evently-autocomplete__panel {
	left: 0;
	right: 0;
	width: auto;
	max-width: none;
}

.evently-autocomplete__panel[hidden] {
	display: none;
}

.evently-autocomplete__item {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: 10px 12px;
	border: 0;
	border-radius: var(--evently-radius-sm);
	background: transparent;
	color: var(--evently-text);
	font-family: inherit;
	text-align: left;
	cursor: pointer;
	transition: background-color var(--evently-transition-fast) ease;
}

.evently-autocomplete__item + .evently-autocomplete__item {
	margin-top: 2px;
}

.evently-autocomplete__item:hover,
.evently-autocomplete__item.is-active,
.evently-autocomplete__item:focus {
	outline: none;
	background: var(--evently-surface);
}

.evently-autocomplete__thumb {
	width: 44px;
	height: 44px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--evently-surface);
	flex-shrink: 0;
}

.evently-autocomplete__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.evently-autocomplete__thumb.is-placeholder {
	background:
		linear-gradient(135deg, var(--evently-border) 0%, var(--evently-surface) 100%);
}

.evently-autocomplete__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.evently-autocomplete__title {
	font-size: var(--evently-fs-small);
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.35;
	color: var(--evently-text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.evently-autocomplete__meta {
	font-size: var(--evently-fs-caption);
	font-weight: 500;
	color: var(--evently-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.evently-autocomplete__price {
	font-size: 12px;
	font-weight: 600;
	color: var(--evently-primary);
	white-space: nowrap;
}

.evently-autocomplete__view-all {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 12px 14px;
	border: 0;
	border-top: 1px solid var(--evently-border);
	border-radius: 0 0 var(--evently-radius-sm) var(--evently-radius-sm);
	background: transparent;
	color: var(--evently-primary);
	font-family: inherit;
	font-size: var(--evently-fs-small);
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}

.evently-autocomplete__view-all:hover,
.evently-autocomplete__view-all:focus {
	outline: none;
	background: var(--evently-primary-soft);
}

.evently-autocomplete__empty,
.evently-autocomplete__loading {
	padding: 16px 14px;
	font-size: var(--evently-fs-small);
	font-weight: 500;
	color: var(--evently-muted);
	text-align: left;
}

/* ── Notices (booking-plugin-missing, WooCommerce-missing, etc.) ─── */

.evently-notice {
	border: 1px solid var(--evently-border);
	background: var(--evently-surface);
	border-radius: var(--evently-radius-md);
	padding: var(--evently-space-3);
	font-size: var(--evently-fs-small);
	color: var(--evently-text);
}

.evently-notice--warning {
	border-color: rgba(245, 158, 11, 0.35);
	background: rgba(245, 158, 11, 0.08);
}

.evently-notice a {
	color: var(--evently-primary);
	font-weight: 600;
	text-decoration: underline;
}
