/**
 * Avşa Triple Control Bar & Modal Styles
 *
 * @package Avsa_Tesis_Filtreleme
 */

.avsa-control-bar-wrapper {
	width: 100%;
	margin-bottom: 12px;
}

@media (max-width: 767px) {
	.avsa-control-bar-wrapper {
		margin-top: 2px;
		margin-bottom: 8px;
	}
}

/* Control Bar Container */
.avsa-control-bar {
	display: flex;
	align-items: center;
	background-color: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	height: 48px;
	overflow: hidden;
}

/* Equal Width Buttons */
.avsa-ctrl-btn {
	flex: 1 1 0;
	min-width: 0;
	min-height: 44px;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 0 8px;
	background: transparent;
	border: none;
	border-bottom: 3px solid transparent;
	color: #334155;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.3px;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.avsa-ctrl-btn:hover,
.avsa-ctrl-btn:focus-visible {
	background-color: #f8fafc;
	color: var(--avsa-color-primary, #2a5f97);
}

.avsa-ctrl-btn.is-active {
	background-color: #f0f7ff;
	color: var(--avsa-color-primary, #2a5f97);
	border-bottom-color: var(--avsa-color-primary, #2a5f97);
}

.avsa-ctrl-icon {
	flex-shrink: 0;
	color: currentColor;
}

.avsa-ctrl-label {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Subtle Vertical Divider */
.avsa-ctrl-divider {
	width: 1px;
	height: 22px;
	background-color: #e2e8f0;
	flex-shrink: 0;
}

/* Active Filter Counter Badge */
.avsa-filter-count-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	background-color: var(--avsa-color-accent, #ffa500);
	color: #000000;
	font-size: 11px;
	font-weight: 800;
	border-radius: 9px;
	line-height: 1;
}

/* Active Filter Chips Bar */
.avsa-active-filters-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
}

.avsa-chips-container {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.avsa-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background-color: #f1f5f9;
	color: #1e293b;
	padding: 4px 10px;
	border-radius: 16px;
	font-size: 12px;
	font-weight: 600;
	border: 1px solid #cbd5e1;
}

.avsa-chip-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	color: #64748b;
	padding: 0;
}

.avsa-chip-remove:hover {
	color: #ef4444;
}

.avsa-clear-chips-btn {
	background: none;
	border: none;
	color: #dc2626;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
	padding: 4px 6px;
}

/* Modal Overlay */
.avsa-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.5);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	z-index: 2100;
}

.avsa-modal-overlay.is-active {
	opacity: 1;
	visibility: visible;
}

/* Filter Drawer (Bottom-sheet on mobile, centered modal on desktop) */
.avsa-filter-drawer {
	position: fixed;
	bottom: -100%;
	left: 0;
	width: 100%;
	max-height: 85vh;
	background-color: #ffffff;
	border-radius: 16px 16px 0 0;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
	display: flex;
	flex-direction: column;
	z-index: 2101;
	transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	overflow: hidden;
}

.avsa-filter-drawer.is-active {
	bottom: 0;
}

.avsa-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #f1f5f9;
}

.avsa-drawer-title {
	font-size: 18px;
	font-weight: 800;
	color: #0f172a;
	margin: 0;
}

.avsa-modal-close-btn {
	background: none;
	border: none;
	color: #64748b;
	cursor: pointer;
	padding: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
}

.avsa-modal-close-btn:hover {
	color: #0f172a;
	background-color: #f1f5f9;
}

.avsa-drawer-body {
	flex: 1 1 auto;
	padding: 16px 20px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.avsa-filter-group {
	border: none;
	padding: 0;
	margin: 0 0 20px 0;
}

.avsa-group-title {
	font-size: 14px;
	font-weight: 700;
	color: #334155;
	margin-bottom: 10px;
	display: block;
}

/* Pill Selectors */
.avsa-pill-selector {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.avsa-pill-label {
	cursor: pointer;
}

.avsa-pill-label input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.avsa-pill-label span {
	display: inline-block;
	padding: 6px 12px;
	background-color: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	color: #475569;
	transition: all 0.15s ease;
}

.avsa-pill-label input:checked + span {
	background-color: var(--avsa-color-primary, #2a5f97);
	border-color: var(--avsa-color-primary, #2a5f97);
	color: #ffffff;
}

/* Radio & Checkbox Lists */
.avsa-radio-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.avsa-radio-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #334155;
	cursor: pointer;
}

.avsa-checkbox-grid-frontend {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
}

.avsa-check-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #334155;
	cursor: pointer;
}

/* Drawer Footer */
.avsa-drawer-footer {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 20px;
	border-top: 1px solid #f1f5f9;
	background-color: #ffffff;
}

.avsa-btn-primary {
	flex: 2;
	height: 44px;
	background-color: var(--avsa-color-primary, #2a5f97);
	color: #ffffff;
	border: none;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.avsa-btn-primary:hover {
	background-color: var(--avsa-color-primary-dark, #1e4773);
}

.avsa-btn-secondary {
	flex: 1;
	height: 44px;
	background-color: #f1f5f9;
	color: #475569;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.avsa-btn-secondary:hover {
	background-color: #e2e8f0;
}

/* Sort Modal */
.avsa-sort-modal {
	position: fixed;
	bottom: -100%;
	left: 0;
	width: 100%;
	background-color: #ffffff;
	border-radius: 16px 16px 0 0;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
	z-index: 2101;
	transition: bottom 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.avsa-sort-modal.is-active {
	bottom: 0;
}

.avsa-sort-options {
	padding: 12px 20px 24px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.avsa-sort-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
	font-size: 15px;
	font-weight: 600;
	color: #1e293b;
	cursor: pointer;
	border-bottom: 1px solid #f8fafc;
}

/* Desktop Responsive Layout (>= 1024px) */
@media (min-width: 1024px) {
	.avsa-control-bar {
		height: 52px;
	}

	.avsa-ctrl-btn {
		font-size: 14px;
		gap: 8px;
	}

	.avsa-filter-drawer {
		top: 50%;
		left: 50%;
		bottom: auto;
		transform: translate(-50%, -50%) scale(0.95);
		width: 580px;
		max-height: 80vh;
		border-radius: 12px;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	}

	.avsa-filter-drawer.is-active {
		bottom: auto;
		opacity: 1;
		visibility: visible;
		transform: translate(-50%, -50%) scale(1);
	}

	.avsa-sort-modal {
		top: 50%;
		left: 50%;
		bottom: auto;
		transform: translate(-50%, -50%) scale(0.95);
		width: 360px;
		border-radius: 12px;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	}

	.avsa-sort-modal.is-active {
		bottom: auto;
		opacity: 1;
		visibility: visible;
		transform: translate(-50%, -50%) scale(1);
	}
}
