/* Bills View Styling */

.content-container {
	position: relative;
	width: 92%;
	font-family: 'Open Sans', sans-serif;
	padding: 0 0 300px 0;
	margin: 24px auto 0 auto;
}

@media (min-width: 1304px) {
	.content-container {
		width: 1200px;
		margin: 90px auto 0 auto;
	}
}

.bills-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 20px;
}

.bills-header h1.page-title {
	margin: 0;
	font-size: 26px;
	font-weight: 700;
	color: #2c3e50;
}

.session-picker {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #f8f9fa;
	padding: 6px 12px;
	border-radius: 8px;
	border: 1px solid #e2e8f0;
}

.session-picker label {
	font-weight: 600;
	font-size: 13px;
	color: #4a5568;
}

.session-picker select {
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	padding: 6px 10px;
	font-size: 14px;
	font-weight: 600;
	background: #ffffff;
	color: #1e293b;
	cursor: pointer;
	outline: none;
	transition: border-color 0.15s ease;
}

.session-picker select:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Filter Toolbar */
.bills-toolbar {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 18px 20px;
	margin-bottom: 20px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.toolbar-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.toolbar-row + .toolbar-row {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid #f1f5f9;
}

.search-box {
	position: relative;
	flex: 1 1 260px;
	min-width: 200px;
}

.search-box input {
	width: 100%;
	box-sizing: border-box;
	padding: 9px 12px 9px 36px;
	font-size: 14px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	outline: none;
	transition: all 0.15s ease;
}

.search-box input:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-icon {
	position: absolute;
	left: 11px;
	top: 50%;
	transform: translateY(-50%);
	color: #94a3b8;
	font-size: 16px;
	pointer-events: none;
}

.clear-search-btn {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: #94a3b8;
	font-size: 16px;
	cursor: pointer;
	padding: 4px;
	display: none;
}

.clear-search-btn:hover {
	color: #475569;
}

/* Chamber segmented control */
.chamber-segmented {
	display: inline-flex;
	background: #f1f5f9;
	border-radius: 8px;
	padding: 3px;
	user-select: none;
}

.chamber-segmented button {
	background: transparent;
	border: none;
	padding: 7px 16px;
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.chamber-segmented button.active {
	background: #ffffff;
	color: #1e293b;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chamber-segmented button:hover:not(.active) {
	color: #1e293b;
}

/* Filter dropdowns */
.filter-group {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	flex: 2 1 400px;
}

.filter-select {
	flex: 1 1 140px;
	min-width: 130px;
	position: relative;
}

.filter-select select {
	width: 100%;
	padding: 8px 10px;
	font-size: 13px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background-color: #ffffff;
	color: #334155;
	outline: none;
	cursor: pointer;
	transition: border-color 0.15s ease;
}

.filter-select select:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.reset-filters-btn {
	background: transparent;
	border: 1px solid #e2e8f0;
	color: #64748b;
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 600;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.15s ease;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.reset-filters-btn:hover {
	background: #f8f9fa;
	color: #ef4444;
	border-color: #fca5a5;
}

/* Summary stats & tags */
.bills-summary {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 14px;
	padding: 0 4px;
}

.results-count {
	font-size: 14px;
	font-weight: 600;
	color: #475569;
}

.active-filter-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.filter-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #e0f2fe;
	color: #0369a1;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
}

.filter-pill .remove-pill {
	cursor: pointer;
	color: #0284c7;
	font-weight: bold;
	font-size: 14px;
	line-height: 1;
}

.filter-pill .remove-pill:hover {
	color: #0c4a6e;
}

/* Responsive Table */
.table-wrapper {
	overflow-x: auto;
	max-width: 100%;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	container-type: inline-size;
}

table.bills-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-size: 13px;
	text-align: left;
}

table.bills-table thead {
	position: sticky;
	top: 0;
	z-index: 2;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
}

table.bills-table th {
	padding: 12px 16px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #64748b;
	border-bottom: 1px solid #e2e8f0;
	white-space: nowrap;
	cursor: pointer;
	user-select: none;
	transition: color 0.15s ease;
}

table.bills-table th:hover {
	color: #1e293b;
}

table.bills-table th.sortable::after {
	content: " ↕";
	font-size: 11px;
	color: #cbd5e1;
}

table.bills-table th.sort-asc::after {
	content: " ↑";
	color: #3b82f6;
}

table.bills-table th.sort-desc::after {
	content: " ↓";
	color: #3b82f6;
}

table.bills-table tbody tr {
	cursor: pointer;
	transition: background-color 0.15s ease;
}

table.bills-table tbody tr:hover {
	background-color: #f1f5f9;
}

table.bills-table tbody tr:not(:last-child) td {
	border-bottom: 1px solid #f1f5f9;
}

table.bills-table td {
	padding: 14px 16px;
	vertical-align: middle;
	color: #334155;
	line-height: 1.4;
}

.bill-number-cell {
	white-space: nowrap;
}

.bill-number-badge {
	display: inline-block;
	font-weight: 700;
	font-size: 14px;
	color: #1e293b;
}

.bill-sub-tag {
	display: inline-block;
	margin-left: 6px;
	background: #fef3c7;
	color: #92400e;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 4px;
}

.chamber-badge {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.chamber-badge.chamber-senate {
	background: #f3e8ff;
	color: #7e22ce;
}

.chamber-badge.chamber-house {
	background: #fee2e2;
	color: #b91c1c;
}

.bill-title-link {
	font-weight: 600;
	color: #1e293b;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.bill-title-link:hover {
	color: #2563eb;
	text-decoration: underline;
}

.sponsor-link {
	color: #475569;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

.sponsor-link:hover {
	color: #1d4ed8;
	text-decoration: underline;
}

.sponsor-party {
	font-size: 11px;
	font-weight: 600;
	margin-left: 4px;
}

.party-R {
	color: #dc2626;
}

.party-D {
	color: #2563eb;
}

.status-badge {
	display: inline-block;
	padding: 4px 8px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
	max-width: 150px;
	text-overflow: ellipsis;
	overflow: hidden;
}

.status-passed, .status-signed, .status-enacted {
	background: #dcfce7;
	color: #15803d;
}

.status-failed {
	background: #fee2e2;
	color: #b91c1c;
}

.status-pending, .status-filed {
	background: #f1f5f9;
	color: #475569;
}

.subject-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	max-width: 240px;
}

.subject-tag {
	display: inline-block;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	color: #475569;
	padding: 2px 7px;
	border-radius: 4px;
	font-size: 11px;
	white-space: nowrap;
	max-width: 140px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.subject-more {
	font-size: 11px;
	color: #94a3b8;
	font-weight: 600;
	align-self: center;
}

/* Empty State */
.bills-empty {
	text-align: center;
	padding: 60px 20px;
	color: #64748b;
}

.bills-empty-icon {
	font-size: 48px;
	color: #cbd5e1;
	margin-bottom: 12px;
}

.bills-empty h3 {
	font-size: 18px;
	color: #1e293b;
	margin: 0 0 8px 0;
}

.bills-empty p {
	font-size: 14px;
	margin: 0 0 16px 0;
}

/* Container query for mobile stacked view */
@container (max-width: 760px) {
	table.bills-table,
	table.bills-table thead,
	table.bills-table tbody,
	table.bills-table tr,
	table.bills-table td {
		display: block;
	}

	table.bills-table thead {
		display: none;
	}

	table.bills-table tbody tr {
		margin-bottom: 14px;
		border: 1px solid #e2e8f0;
		border-radius: 10px;
		padding: 14px;
		background: #ffffff;
		box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
	}

	table.bills-table td {
		padding: 6px 0;
		border: none !important;
	}

	table.bills-table td:first-child {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding-bottom: 8px;
		border-bottom: 1px solid #f1f5f9 !important;
		margin-bottom: 8px;
	}

	table.bills-table td[data-label]::before {
		content: attr(data-label) ": ";
		font-weight: 700;
		color: #64748b;
		display: inline-block;
		min-width: 90px;
	}
}
