/**
 * UCM Conference Search Add-on Stylesheet
 * Handles 1140px desktop rounded search container, mobile 2-row layout with 3 compact buttons, bottom-sheet modal, and responsive cards grid.
 */

:root {
	--ucmsa-btn-bg: #2563eb;
	--ucmsa-btn-hover: #1d4ed8;
	--ucmsa-btn-text: #ffffff;
	--ucmsa-bar-bg: #ffffff;
	--ucmsa-bar-border: #e2e8f0;
	--ucmsa-bar-radius: 50px;
	--ucmsa-text-color: #1e293b;
	--ucmsa-muted-color: #64748b;
	--ucmsa-icon-color: #6366f1;
	--ucmsa-mobile-btn-bg: #f8fafc;
	--ucmsa-mobile-btn-border: #e2e8f0;
	--ucmsa-mobile-btn-text: #334155;
	--ucmsa-mobile-btn-active-bg: #eff6ff;
	--ucmsa-mobile-btn-active-border: #3b82f6;
	--ucmsa-mobile-btn-active-text: #1d4ed8;
	--ucmsa-mobile-row-btn-bg: #5a2e8c;
}

/* Base Wrapper */
.ucmsa-search-wrapper {
	width: 100%;
	max-width: 1140px;
	margin: 0 auto 3rem auto;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ucmsa-search-wrapper *,
.ucmsa-search-wrapper *::before,
.ucmsa-search-wrapper *::after {
	box-sizing: border-box;
}

.ucmsa-search-section-title {
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--ucmsa-text-color);
	margin: 0 0 1.5rem 0;
	text-align: center;
}

/* ==========================================================================
   Desktop Search Bar (Horizontal Rounded Container)
   ========================================================================== */
.ucmsa-desktop-bar {
	display: flex;
	align-items: center;
	background: var(--ucmsa-bar-bg);
	border: 1px solid var(--ucmsa-bar-border);
	border-radius: var(--ucmsa-bar-radius);
	box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
	padding: 8px 10px 8px 24px;
	transition: all 0.25s ease;
	position: relative;
	width: 100%;
}

.ucmsa-desktop-bar:focus-within {
	border-color: #3b82f6;
	box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.12), 0 8px 10px -6px rgba(59, 130, 246, 0.08);
}

.ucmsa-field-group {
	display: flex;
	align-items: center;
	position: relative;
	height: 48px;
}

.ucmsa-field-keyword {
	flex: 2.2;
	min-width: 180px;
}

.ucmsa-field-select {
	flex: 1.5;
	min-width: 140px;
	padding: 0 10px;
}

.ucmsa-field-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #6366f1;
	margin-right: 10px;
	flex-shrink: 0;
}

.ucmsa-field-icon svg {
	display: block;
}

.ucmsa-input-keyword {
	width: 100%;
	border: none;
	outline: none;
	background: transparent;
	font-size: 15px;
	color: var(--ucmsa-text-color);
	font-weight: 500;
	padding: 8px 0;
}

.ucmsa-input-keyword::placeholder {
	color: #94a3b8;
	font-weight: 400;
}

.ucmsa-clear-keyword {
	background: transparent !important;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	color: #94a3b8;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 0 8px;
	position: absolute;
	right: 4px;
}

.ucmsa-clear-keyword:hover,
.ucmsa-clear-keyword:focus {
	color: #475569;
	outline: none !important;
	box-shadow: none !important;
}

.ucmsa-bar-divider {
	width: 1px;
	height: 32px;
	background: #e2e8f0;
	margin: 0 8px;
	flex-shrink: 0;
}

.ucmsa-select {
	width: 100%;
	border: none;
	outline: none;
	background: transparent;
	font-size: 14px;
	font-weight: 500;
	color: var(--ucmsa-text-color);
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	padding: 8px 24px 8px 0;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
}

.ucmsa-arrow-icon {
	position: absolute;
	right: 10px;
	pointer-events: none;
	color: #94a3b8;
	display: flex;
	align-items: center;
}

.ucmsa-field-btn {
	margin-left: 8px;
	flex-shrink: 0;
}

.ucmsa-btn-search {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--ucmsa-btn-bg);
	color: var(--ucmsa-btn-text);
	border: none;
	border-radius: 40px;
	padding: 13px 28px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.ucmsa-btn-search:hover {
	background: var(--ucmsa-btn-hover);
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.ucmsa-btn-search:active {
	transform: translateY(0);
}

/* ==========================================================================
   Mobile 2-Row Layout Structure
   ========================================================================== */
.ucmsa-mobile-bar {
	display: none;
	flex-direction: column;
	gap: 12px;
	width: 100%;
}

.ucmsa-mobile-row-search {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
}

.ucmsa-mobile-input-wrapper {
	display: flex;
	align-items: center;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 30px;
	padding: 4px 14px;
	flex: 1;
	height: 48px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
	position: relative;
}

.ucmsa-mobile-input-keyword {
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent;
	width: 100%;
	font-size: 15px;
	color: var(--ucmsa-text-color);
	font-weight: 500;
}

.ucmsa-mobile-input-keyword:focus {
	outline: none !important;
	box-shadow: none !important;
}

.ucmsa-mobile-input-keyword::placeholder {
	color: #94a3b8;
}

.ucmsa-mobile-clear-keyword {
	background: transparent !important;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	color: #94a3b8;
	font-size: 18px;
	cursor: pointer;
	padding: 0 4px;
}

.ucmsa-mobile-clear-keyword:focus,
.ucmsa-mobile-clear-keyword:hover {
	outline: none !important;
	box-shadow: none !important;
	color: #475569;
}

.ucmsa-mobile-btn-search {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	background: var(--ucmsa-btn-bg);
	color: var(--ucmsa-btn-text);
	border: none;
	border-radius: 50%;
	flex-shrink: 0;
	cursor: pointer;
	box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.ucmsa-mobile-row-filters {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 100%;
}

.ucmsa-mobile-select-wrapper {
	display: flex;
	align-items: center;
	position: relative;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 0 14px;
	height: 46px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	transition: all 0.2s ease;
	width: 100%;
}

.ucmsa-mobile-select-wrapper:focus-within {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.ucmsa-mobile-select-icon {
	display: flex;
	align-items: center;
	color: #6366f1;
	margin-right: 10px;
	flex-shrink: 0;
}

.ucmsa-mobile-select {
	width: 100%;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent;
	font-size: 14px;
	font-weight: 500;
	color: var(--ucmsa-text-color);
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	padding: 10px 24px 10px 0;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
}

.ucmsa-mobile-select:focus {
	outline: none !important;
	box-shadow: none !important;
}

.ucmsa-mobile-arrow-icon {
	position: absolute;
	right: 14px;
	pointer-events: none;
	color: #94a3b8;
	display: flex;
	align-items: center;
}

/* ==========================================================================
   Active Filter Chips
   ========================================================================== */
.ucmsa-active-chips {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
	padding: 0 8px;
}

.ucmsa-chip-label {
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
}

.ucmsa-chips-list {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
}

.ucmsa-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #eff6ff;
	color: #1e40af;
	border: 1px solid #bfdbfe;
	border-radius: 16px;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 500;
}

.ucmsa-chip-remove {
	background: transparent !important;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	color: #3b82f6;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ucmsa-chip-remove:hover,
.ucmsa-chip-remove:focus {
	color: #1d4ed8;
	outline: none !important;
	box-shadow: none !important;
}

.ucmsa-btn-reset-all {
	background: transparent !important;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	color: #ef4444;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	padding: 4px 8px;
	text-decoration: underline;
}

.ucmsa-btn-reset-all:focus {
	outline: none !important;
	box-shadow: none !important;
}

.ucmsa-sheet-item {
	display: block;
	width: 100%;
	text-align: left;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 12px 16px;
	font-size: 14px;
	font-weight: 500;
	color: #334155;
	margin-bottom: 8px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.ucmsa-sheet-item:hover,
.ucmsa-sheet-item.is-selected {
	background: #eff6ff;
	border-color: #3b82f6;
	color: #1d4ed8;
	font-weight: 600;
}

/* ==========================================================================
   Results Grid Container
   ========================================================================== */
.ucmsa-results-wrapper {
	position: relative;
	margin-top: 2rem;
	width: 100%;
}

.ucmsa-results-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.5rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #e2e8f0;
}

.ucmsa-results-count-wrapper {
	font-size: 15px;
	font-weight: 600;
	color: #64748b;
}

.ucmsa-results-count {
	color: #0f172a;
	font-weight: 700;
}

.ucmsa-results-grid {
	width: 100%;
}

.ucmsa-no-results {
	grid-column: 1 / -1;
	padding: 48px 20px;
	text-align: center;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 12px;
	width: 100%;
}

.ucmsa-no-results-text {
	font-size: 16px;
	color: #64748b;
	margin: 0;
}

/* Spinner */
.ucmsa-loading-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(1px);
	z-index: 10;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 60px;
}

.ucmsa-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid #e2e8f0;
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: ucmsaSpin 0.7s linear infinite;
}

@keyframes ucmsaSpin {
	to { transform: rotate(360deg); }
}

@keyframes ucmsaFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes ucmsaSlideUp {
	from { transform: translateY(100%); }
	to { transform: translateY(0); }
}

/* Responsive Media Queries */
@media (max-width: 900px) {
	.ucmsa-desktop-bar {
		display: none;
	}
	.ucmsa-mobile-bar {
		display: flex;
	}
}
