/**
 * Modern Story Search & AJAX Dropdown Styles
 *
 * @package JournalistPortfolio
 * @version 1.4.0
 */

/* ==========================================================================
   HEADER SEARCH INPUT ENHANCEMENTS
   ========================================================================== */
.jp-search-form {
	position: relative;
	display: flex;
	align-items: center;
}

/* Disable native browser search cancel (cross) buttons */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
	-webkit-appearance: none !important;
	appearance: none !important;
	display: none !important;
}

input[type="search"]::-ms-clear,
input[type="search"]::-ms-reveal {
	display: none !important;
	width: 0 !important;
	height: 0 !important;
}

.jp-search-input,
.jp-search-page-input {
	width: 100%;
	height: 42px !important;
	padding: 10px 60px 10px 14px !important;
	background: #f8fafc !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 8px !important;
	font-size: 0.9rem !important;
	color: #0f172a !important;
	font-weight: 500 !important;
	outline: none !important;
	transition: all 0.2s ease !important;
	box-sizing: border-box !important;
}

.jp-search-input:focus,
.jp-search-page-input:focus {
	width: 100% !important;
	background: #ffffff !important;
	border-color: var(--jp-accent, #059669) !important;
	box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15) !important;
}

.jp-search-submit-icon-btn {
	position: absolute;
	right: 5px;
	top: 50%;
	transform: translateY(-50%);
	width: 32px !important;
	height: 32px !important;
	min-width: 32px !important;
	max-width: 32px !important;
	min-height: 32px !important;
	max-height: 32px !important;
	border-radius: 50% !important;
	background: #ffffff !important;
	border: 2px solid var(--jp-accent, #059669) !important;
	color: var(--jp-accent, #059669) !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
	z-index: 4 !important;
	box-shadow: 0 2px 5px rgba(5, 150, 105, 0.15) !important;
	padding: 0 !important;
	box-sizing: border-box !important;
}

.jp-search-submit-icon-btn:hover {
	background: var(--jp-accent, #059669) !important;
	color: #ffffff !important;
	transform: translateY(-50%) scale(1.05);
	box-shadow: 0 4px 10px rgba(5, 150, 105, 0.3) !important;
}

.jp-search-submit-icon-btn svg {
	width: 15px !important;
	height: 15px !important;
	stroke: var(--jp-accent, #059669) !important;
	stroke-width: 2.5 !important;
	transition: stroke 0.2s ease !important;
	display: block !important;
}

.jp-search-submit-icon-btn:hover svg {
	stroke: #ffffff !important;
}

.jp-search-clear-btn {
	position: absolute;
	right: 44px;
	top: 50%;
	transform: translateY(-50%);
	background: #cbd5e1 !important;
	color: #475569 !important;
	border: none !important;
	border-radius: 50% !important;
	width: 18px !important;
	height: 18px !important;
	min-width: 18px !important;
	max-width: 18px !important;
	min-height: 18px !important;
	max-height: 18px !important;
	flex-shrink: 0 !important;
	font-size: 11px !important;
	display: none;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	line-height: 1 !important;
	transition: background 0.2s ease, color 0.2s ease !important;
	z-index: 4 !important;
	box-sizing: border-box !important;
	padding: 0 !important;
}

.jp-search-clear-btn:hover {
	background: #94a3b8 !important;
	color: #ffffff !important;
}

.jp-keyboard-hint {
	position: absolute;
	right: 10px;
	font-size: 0.72rem;
	font-weight: 600;
	color: #94a3b8;
	background: #e2e8f0;
	padding: 2px 6px;
	border-radius: 4px;
	pointer-events: none;
	letter-spacing: 0.05em;
}

/* ==========================================================================
   LIVE AJAX SEARCH DROPDOWN OVERLAY
   ========================================================================== */
.jp-live-search-results {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	width: 380px;
	max-height: 440px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16), 0 8px 16px rgba(15, 23, 42, 0.08);
	overflow-y: auto;
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}

.jp-live-search-results.is-active {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.jp-live-header {
	background: #f8fafc;
	padding: 10px 16px;
	border-bottom: 1px solid #f1f5f9;
	font-size: 0.72rem;
	font-weight: 700;
	color: #64748b;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.jp-live-list {
	display: flex;
	flex-direction: column;
}

.jp-live-item-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	text-decoration: none !important;
	color: inherit;
	border-bottom: 1px solid #f1f5f9;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.jp-live-item-link:last-child {
	border-bottom: none;
}

.jp-live-item-link:hover,
.jp-live-item-link.is-selected {
	background: #f0fdf4;

}

.jp-live-thumb {
	width: 52px;
	height: 52px;
	object-fit: cover;
	border-radius: 8px;
	flex-shrink: 0;
	border: 1px solid #e2e8f0;
}

.jp-live-thumb-placeholder {
	width: 52px;
	height: 52px;
	background: #f1f5f9;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #94a3b8;
	flex-shrink: 0;
	border: 1px solid #e2e8f0;
}

.jp-live-item-info {
	flex: 1;
	min-width: 0;
}

.jp-live-kicker {
	display: block;
	font-size: 0.73rem;
	font-weight: 700;
	color: var(--jp-accent, #059669);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.jp-live-item-title {
	margin: 0 0 4px 0;
	font-size: 0.92rem;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-family: inherit;
}

.jp-live-item-link:hover .jp-live-item-title {
	color: var(--jp-accent, #059669);
}

.jp-live-item-meta {
	font-size: 0.78rem;
	color: #64748b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.jp-live-footer-link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background: #f8fafc;
	padding: 12px 16px;
	text-decoration: none !important;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--jp-accent, #059669) !important;
	border-top: 1px solid #e2e8f0;
	transition: background 0.15s ease;
}

.jp-live-footer-link:hover {
	background: #ecfdf5;
}

.jp-live-loading,
.jp-live-empty {
	padding: 24px;
	text-align: center;
	font-size: 0.88rem;
	color: #64748b;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.jp-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid #e2e8f0;
	border-top-color: var(--jp-accent, #059669);
	border-radius: 50%;
	animation: jpSpin 0.7s linear infinite;
}

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

/* ==========================================================================
   SEARCH RESULTS PAGE TEMPLATE STYLING
   ========================================================================== */
.jp-search-results-page {
	padding-top: 40px;
	padding-bottom: 70px;
}

.jp-search-header-card {
	background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
	color: #ffffff;
	padding: 36px 40px;
	border-radius: 16px;
	margin-bottom: 28px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
}

.jp-search-kicker-badge {
	display: inline-block;
	background: rgba(5, 150, 105, 0.2);
	color: #34d399;
	border: 1px solid rgba(52, 211, 153, 0.3);
	font-size: 0.75rem;
	font-weight: 800;
	padding: 4px 12px;
	border-radius: 20px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 12px;
}

.jp-search-title {
	color: #ffffff;
	font-size: 2.2rem;
	font-weight: 800;
	margin: 0 0 10px 0;
	font-family: var(--jp-font-serif, Georgia, serif);
	line-height: 1.25;
}

.jp-search-subtitle {
	color: #94a3b8;
	font-size: 1.02rem;
	margin: 0;
	max-width: 680px;
	line-height: 1.55;
}

.jp-search-filter-wrapper {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 16px 20px;
	margin-bottom: 20px;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.jp-search-page-form {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.jp-search-page-input-wrap {
	position: relative;
	flex: 1;
	min-width: 240px;
}

.jp-search-input-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: #94a3b8;
}

.jp-search-page-input {
	width: 100%;
	padding: 10px 14px 10px 42px;
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 0.92rem;
	color: #0f172a;
	outline: none;
	transition: all 0.2s ease;
}

.jp-search-page-input:focus {
	background: #ffffff;
	border-color: var(--jp-accent, #059669);
	box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.jp-filter-select-wrap {
	min-width: 170px;
}

.jp-filter-select {
	width: 100%;
	padding: 10px 14px;
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 0.9rem;
	color: #0f172a;
	font-weight: 500;
	cursor: pointer;
	outline: none;
	transition: all 0.2s ease;
}

.jp-filter-select:focus {
	background: #ffffff;
	border-color: var(--jp-accent, #059669);
}

.jp-search-submit-btn {
	background: var(--jp-accent, #059669);
	color: #ffffff;
	border: none;
	padding: 10px 22px;
	border-radius: 8px;
	font-weight: 700;
	font-size: 0.9rem;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.1s ease;
}

.jp-search-submit-btn:hover {
	background: #047857;

}

.jp-search-reset-btn {
	color: #ef4444;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.88rem;
	padding: 8px 12px;
	transition: color 0.2s ease;
}

.jp-search-reset-btn:hover {
	text-decoration: underline;
}

.jp-results-summary-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
	font-size: 0.9rem;
	color: #64748b;
}

.jp-results-count-tag {
	font-weight: 600;
	color: #334155;
	background: #f1f5f9;
	padding: 4px 12px;
	border-radius: 20px;
}

/* Empty State Card */
.jp-search-empty-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 50px 30px;
	text-align: center;
	max-width: 680px;
	margin: 20px auto;
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.jp-empty-icon-wrap {
	width: 80px;
	height: 80px;
	background: #f8fafc;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px auto;
	border: 1px solid #e2e8f0;
}

.jp-empty-title {
	font-size: 1.45rem;
	font-weight: 800;
	color: #0f172a;
	margin: 0 0 10px 0;
	font-family: inherit;
}

.jp-empty-desc {
	color: #64748b;
	font-size: 0.96rem;
	line-height: 1.6;
	margin: 0 0 24px 0;
}

.jp-empty-pills-wrap {
	background: #f8fafc;
	padding: 20px;
	border-radius: 12px;
	border: 1px solid #f1f5f9;
}

.jp-empty-pills-title {
	display: block;
	font-size: 0.85rem;
	font-weight: 700;
	color: #475569;
	margin-bottom: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.jp-empty-pills-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.jp-cat-pill-link {
	background: #ffffff;
	color: #0f172a;
	border: 1px solid #cbd5e1;
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none !important;
	transition: all 0.2s ease;
}

.jp-cat-pill-link:hover {
	background: var(--jp-accent, #059669);
	color: #ffffff;
	border-color: var(--jp-accent, #059669);
}

.jp-btn-primary-gradient {
	display: inline-block;
	background: var(--jp-accent, #059669);
	color: #ffffff !important;
	padding: 10px 24px;
	border-radius: 30px;
	font-weight: 700;
	font-size: 0.92rem;
	text-decoration: none !important;
	transition: all 0.2s ease;
	box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.jp-btn-primary-gradient:hover {
	background: #047857;

}

@media (max-width: 640px) {
	.jp-live-search-results {
		width: 300px;
		right: -50px;
	}
	.jp-search-header-card {
		padding: 24px 20px;
	}
	.jp-search-title {
		font-size: 1.6rem;
	}
}
