/* ========================================
   GRID LAYOUT - Clean and consistent
   ======================================== */
.ais-Hits {
	margin: 0 0 30px 0;
	padding: 0;
}

.ais-Hits-list {
	display: grid;
	grid-template-columns: repeat(1, 1fr);
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
	width: 100%;
}

@media (min-width: 768px) {
	.ais-Hits-list {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 992px) {
	.ais-Hits-list {
		grid-template-columns: repeat(3, 1fr);
	}
}

.ais-Hits-item {
	padding: 0;
	margin: 0;
	width: 100%;
	display: block;
	border: none !important;
	box-shadow: none !important;
}

/* ========================================
   CARD STRUCTURE
   ======================================== */
.panel {
	padding: 0;
	margin: 0;
	width: 100%;
	min-height: 420px;
	background-color: #fff;
	border: 1px solid #ddd;
	border-radius: 12px;
	-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
	box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
	position: relative;
	border-color: #ddd;
}

.project-panel {
	border: 0px !important;
	position: relative;
	overflow-y: visible !important;
	-webkit-box-shadow: 0 0 10px 0 rgba(0,0,0,0.1);
	-moz-box-shadow: 0 0 10px 0 rgba(0,0,0,0.1);
	box-shadow: 0 0 10px 0 rgba(0,0,0,0.1);
}

.project-panel,
.panel.project-panel,
.panel-default.project-panel {
	border: 1px solid #ddd !important;
	margin-bottom: 0;
	height: 100%;
	background: #fff;
	-webkit-box-shadow: 0 0 10px 0 rgba(0,0,0,0.1);
	-moz-box-shadow: 0 0 10px 0 rgba(0,0,0,0.1);
	box-shadow: 0 0 10px 0 rgba(0,0,0,0.1);
	transition: box-shadow 0.2s ease-in-out;
	border-radius: 12px !important;
	overflow: hidden;
	border-color: #ddd;
}

.project-panel:hover {
	-webkit-box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	-moz-box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.panel-body {
	padding: 0 !important;
	margin: 0 !important;
}

.project-panel .panel-body {
	border-radius: 12px !important;
	overflow: hidden;
	padding: 0 !important;
	margin: 0 !important;
}

/* ========================================
   IMAGE - No margins or padding
   ======================================== */
.panel-img {
	position: relative;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden;
}

.project-panel .panel-img {
	margin: 0 !important;
	padding: 0 !important;
	border-radius: 12px 12px 0 0;
	overflow: hidden;
}

.panel-img img,
.project-panel .panel-img img {
	width: 100%;
	height: 220px;
	object-fit: cover;
	border-radius: 12px 12px 0 0;
	margin: 0 !important;
	padding: 0 !important;
	display: block;
}

.image-fade-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 40px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 100%);
	border-radius: 0 0 0 0;
	pointer-events: none;
}

.image-slider {
	position: absolute;
	bottom: 15px;
	left: 15px;
	right: 15px;
	height: 6px;
	background: rgba(255, 255, 255, 0.3);
	border-radius: 3px;
	backdrop-filter: blur(5px);
	z-index: 10;
}

.slider-progress {
	height: 100%;
	background: linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%);
	border-radius: 3px;
	transition: width 0.3s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider-text {
	position: absolute;
	bottom: 25px;
	left: 15px;
	color: white;
	font-size: 12px;
	font-weight: 500;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
	z-index: 15;
}

.slider-text-right {
	position: absolute;
	bottom: 25px;
	right: 15px;
	color: white;
	font-size: 12px;
	font-weight: 500;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
	z-index: 15;
}

/* ========================================
   CARD CONTENT
   ======================================== */
.project-card-content {
	height: 260px;
	padding: 0px 15px;
	font-weight: 200;
	position: relative;
}

.projectTitle {
	font-size: 16px;
	margin-top: 0;
	padding: 15px 15px 0 15px;
	line-height: 22px;
	font-weight: 400;
	color: #555;
	min-height: 70px;
	overflow: visible;
	display: block;
}

.project-name {
	height: 44px;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	line-height: 22px;
}

.projectinfo {
	font-size: .9em !important;
	color: #555;
	padding: 0 15px 80px 15px;
}

.projectinfo > div {
	font-weight: 200 !important;
}

.fundingNeeded {
	text-align: right;
	color: #777;
	font-weight: 500;
	font-size: .8em;
	margin-top: 2px;
}

.projectCountry {
	font-size: .8em;
	color: #8F8F8F;
}

.fundProject {
	position: absolute; 
	bottom: 20px;
	left: 15px;
	right: 15px;
	margin: 0 !important;
	padding: 0 !important;
}

/* ========================================
   INFO PILLS
   ======================================== */
.info-pills {
	display: flex;
	gap: 6px;
	margin-top: 6px;
	flex-wrap: wrap;
	margin-bottom: 15px;
}

.info-pill {
	background: rgba(45, 100, 132, 0.08);
	border-radius: 12px;
	padding: 3px 8px;
	font-size: 10px;
	color: #666;
	border: 1px solid rgba(45, 100, 132, 0.1);
	display: inline-flex;
	align-items: center;
	gap: 3px;
	white-space: nowrap;
	min-width: auto;
	height: 20px;
}

.country-pill {
	background: rgba(45, 100, 132, 0.12);
	color: #2D6484;
	border: 1px solid rgba(45, 100, 132, 0.15);
}

.info-pill i {
	font-size: 9px;
}

/* ========================================
   PROGRESS BAR
   ======================================== */
.progress {
	height: 20px;
	width: 100%;
	margin-bottom: 5px;
	margin-top: 5px;
	overflow: hidden;
	background-color: #f5f5f5;
	border-radius: 4px;
	-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
}

.project-panel .progress {
	border-radius: 12px !important;
}

.progress-bar {
	float: left;
	width: 0;
	height: 100%;
	font-size: 12px;
	color: #fff;
	background-color: #2D6484;
	padding-top: 2px;
	-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
	box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
	-webkit-transition: width .6s ease;
	-o-transition: width .6s ease;
	transition: width .6s ease;
}

.progress-bar.accelerated {
	color: white;
	background-color: green;
}

.progress-bar span {
	padding-left: 10px;
}

/* ========================================
   BUTTONS - Match original style
   ======================================== */
.btn {
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
	white-space: nowrap;
	vertical-align: middle;
	-ms-touch-action: manipulation;
	touch-action: manipulation;
	cursor: pointer;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	background-image: none;
	border: 1px solid transparent;
	border-radius: 8px;
	transition: all 0.2s ease;
	text-decoration: none;
	display: inline-block;
}

.btn-danger {
	color: #fff;
	background: #d75b30;
	border-color: #d75b30;
	box-shadow: 0 2px 4px rgba(215, 91, 48, 0.3);
}

.btn-danger:hover {
	background: #c14a26;
	border-color: #c14a26;
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(215, 91, 48, 0.4);
	color: #fff;
	text-decoration: none;
}

.btn-lg {
	padding: 10px 16px;
	font-size: 14px;
	line-height: 1.3;
}

.btn-help {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

/* ========================================
   MATCH ICON
   ======================================== */
.matchIcon {
	position: absolute;
	top: -10px;
	z-index: 1000;
	right: 10px;
}

/* ========================================
   SEARCH & FILTERS
   ======================================== */
#hits {
	border: none !important;
	margin: 0 0 30px 0 !important;
	padding: 0 !important;
}

.searchin {
	width: 100%;
	padding: 8px 10px 8px 35px;
	font-size: 16px;
	border: 1px solid #ddd;
	border-radius: 4px;
	margin-bottom: 15px;
	background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23999" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="M21 21l-4.35-4.35"/></svg>') no-repeat 10px center;
	background-color: white;
}

.searchin:focus {
	outline: none;
	border-color: #2D6484;
}

.searchin::placeholder {
	color: #999;
	opacity: 1;
}

.ais-SearchBox-form {
	position: relative;
}

.ais-SearchBox-submit {
	display: none !important;
}

.ais-SearchBox-reset {
	position: absolute;
	right: 1em;
	top: 50%;
	transform: translateY(-70%);
	border: none;
	background: none;
	padding: 8px;
	cursor: pointer;
}

.ais-SearchBox-resetIcon {
	width: 12px;
	height: 12px;
}

.ais-SearchBox-resetIcon path {
	fill: #999;
}

.ais-SearchBox-reset:hover .ais-SearchBox-resetIcon path {
	fill: #2D6484;
}

.ais-RefinementList {
	padding-left: 14px;
}

.ais-RefinementList-showMore {
	display: none;
}

.ais-RefinementList-list {
	padding: 0;
	margin: 0;
	list-style: none;
}

.ais-RefinementList-checkbox {
	margin-top: 0!important;
	margin-right: .3em!important;
}

.ais-RefinementList-labelText, 
.ais-RefinementList-label, 
.ais-RefinementList-checkbox {
	vertical-align: middle;
	font-weight: normal;
}

.ais-RefinementList-count {
	display: none;
}

label.ais-refinement-list--label {
	font-weight: 400;
}

.ais-refinement-list--count {
	display: none;
}

.filters .panel-heading {
	min-height: 40px !important;
}

/* ========================================
   CURRENT REFINEMENTS
   ======================================== */
.ais-current-refined-values {
	margin-bottom: 15px;
}

.ais-current-refined-values--item {
	background-color: #f8f9fa;
	padding: 4px 10px;
	margin: 0 5px 5px 0;
	border-radius: 4px;
	font-size: 13px;
	border: 1px solid #eee;
	display: inline-flex;
	align-items: center;
}

.ais-current-refined-values--link {
	color: #666;
	text-decoration: none;
	display: flex;
	align-items: center;
}

.ais-current-refined-values--clear-all {
	color: #ed5565;
	text-decoration: none;
	font-size: 13px;
	margin-left: 5px;
}

.ais-current-refined-values--link:after {
	content: '×';
	margin-left: 6px;
	font-size: 16px;
	color: #999;
}

.ais-current-refined-values--link:hover:after {
	color: #ed5565;
}

.ais-current-refined-values--list {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
}

.ais-CurrentRefinements {
	margin: 10px 0;
}

.ais-CurrentRefinements-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	padding: 0;
}

.ais-CurrentRefinements-item {
	background: #f8f9fa;
	border: 1px solid #eee;
	border-radius: 4px;
	padding: 4px 8px;
	font-size: 13px;
	display: flex;
	align-items: center;
}

.ais-CurrentRefinements-label {
	margin-right: 4px;
	color: #666;
}

.ais-CurrentRefinements-delete {
	background: none;
	border: none;
	color: #999;
	cursor: pointer;
	margin-left: 4px;
	padding: 0;
}

.ais-CurrentRefinements-delete:hover {
	color: #ed5565;
}

/* ========================================
   PAGINATION
   ======================================== */
#pagination,
#pagination2 {
	margin: 30px 0 20px 0;
}

.ais-Pagination {
	margin: 0!important;
	text-align: center;
}

.ais-Pagination-list {
	display: inline-flex;
	padding: 0;
	margin: 0;
	list-style: none;
}

.ais-Pagination-item {
	margin: 0;
}

.ais-Pagination-link {
	padding: 5px 12px!important;
	text-decoration: none;
	color: #000;
	border: 1px solid #ddd;
	background: white;
	display: block;
	height: auto;
	font-size: 14px;
	font-weight: 100;
	margin: 0 5px;
}

.ais-Pagination-item:first-child .ais-Pagination-link {
	border-top-left-radius: 0!important;
	border-bottom-left-radius: 0!important;
	margin-left: 0;
}

.ais-Pagination-item:last-child .ais-Pagination-link {
	border-top-right-radius: 0!important;
	border-bottom-right-radius: 0!important;
}

.ais-Pagination-item--disabled {
	visibility: visible;
	opacity: 0.3;
}

.ais-Pagination-item--disabled .ais-Pagination-link {
	cursor: not-allowed;
}

.ais-Pagination-item--selected .ais-Pagination-link, 
.ais-Pagination-item--selected:hover .ais-Pagination-link {
	color: white!important;
	background: #ed5565!important;
	border-color: #ed5565;
	position: relative;
	z-index: 1;
	font-weight: normal;
}

.ais-Pagination-link:hover:not(.ais-Pagination-item--selected):not(.ais-Pagination-item--disabled) {
	background: #f5f5f5;
	color: #000!important;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.more {
	margin: 20px;
	font-size: 1.2em;
}

.icon-overlay {
	position: absolute;
	top: 10px;
	right: 10px;
	font-size: 24px;
	color: #fff;
	text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.project-year-overlay {
	position: absolute;
	bottom: 15px;
	right: 25px;
	font-size: 38px;
	color: #337ab7;
}

#hits .col-sm-4 {
	padding-left: 2px;
	padding-right: 2px;
}

.yellow {
	color: goldenrod !important;
}

.green {
	color: green !important;
}

.white {
	color: #fff !important;
}

.red {
	color: firebrick !important;
}

.top-banner {
	min-height: 375px;
	background: url('/images/funding-catalog.jpg');
	background-position: top;
	background-size: cover;
	margin-top: 50px;
}

.top-banner-text {
	display: block;
	width: 100%;
	min-height: 130px;
	color: #fff;
	background-color: rgba(26, 34, 59, 0.85);
	position: relative;
	top: 250px;
}

#cost {
	cursor: pointer;
}

#cost a {
	display: block;
	padding: 5px 0;
	color: #333;
	text-decoration: none;
	transition: color 0.2s ease;
}

#cost a:hover {
	color: #ed5565;
}

#cost a:first-child {
	font-weight: bold;
	margin-bottom: 5px;
}

.panel-heading {
	background: #f8f9fa !important;
	border-bottom: 1px solid #eee;
	padding: 10px 15px;
}

.panel-heading .panel-title {
	font-size: 16px;
	font-weight: 500;
}

.panel-heading .panel-title a {
	color: #2D6484;
	text-decoration: none;
}

.panel-footer {
	background: #f8f9fa;
	font-size: 13px;
	color: #666;
	line-height: 1.4;
	border-top: 1px solid #eee;
}

#filters .panel-body {
	padding: 10px 0!important;
}

#cost a {
	padding: 5px 14px
}

.price-ranges-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.price-ranges-list a {
	display: block;
	color: #333;
	text-decoration: none;
	padding: 6px 10px;
	border-radius: 4px;
	transition: all 0.2s ease;
	font-size: 14px;
	background: #f8f9fa;
	border: 1px solid transparent;
}

.price-ranges-list a:hover {
	background: #fff;
	color: #ed5565;
	border-color: #ed5565;
}

.price-ranges-list a:first-child {
	font-weight: 500;
	color: #2D6484;
	background: transparent;
	padding-left: 0;
}

.price-ranges-list a:first-child:hover {
	color: #ed5565;
	border-color: transparent;
}

#map {
	width: 100%;
	height: 300px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 767px) {
	.panel { 
		margin: 0 18px 0 0; 
	}
}

@media (max-width: 500px) {
	.top-banner-text {
		min-height: 100px;
		top: 200px;
	}

	.ais-Pagination-link {
		padding: 6px 8px;
	}
}
