/* =============================================================================
   GoFly Visa Search — Front-end stylesheet
   Version: 1.0.0
   ============================================================================= */

/* ---- CSS Custom Properties (defaults; overridden per-widget via inline vars) */
.gofly-search-widget {
	--gofly-btn-bg:         #2563eb;
	--gofly-btn-hover-bg:   #1d4ed8;
	--gofly-overlay-bg:     rgba(0, 0, 0, 0.5);
	--gofly-heading-color:  #ffffff;
	--gofly-sub-color:      rgba(255, 255, 255, 0.88);
	--gofly-heading-size:   48px;
	--gofly-sub-size:       20px;
	--gofly-search-radius:  50px;
	--gofly-search-max-w:   700px;
	--gofly-section-height: 600px;
}

/* =============================================================================
   HERO SECTION
   ============================================================================= */

.gofly-search-widget {
	position: relative;
	width: 100%;
	height: var(--gofly-section-height);
	min-height: 340px;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	background-color: #0f172a;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	box-sizing: border-box;
}

/* Overlay */
.gofly-search-widget .gofly-overlay {
	position: absolute;
	inset: 0;
	background-color: var(--gofly-overlay-bg);
	z-index: 1;
	pointer-events: none;
}

/* Content block */
.gofly-search-widget .gofly-hero-content {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 900px;
	padding: 40px 20px;
	text-align: center;
	box-sizing: border-box;
}

/* =============================================================================
   HEADING & SUBHEADING
   ============================================================================= */

.gofly-search-widget .gofly-heading {
	font-size: var(--gofly-heading-size);
	font-weight: 700;
	color: var(--gofly-heading-color);
	margin: 0 0 16px;
	line-height: 1.15;
	letter-spacing: -0.03em;
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.gofly-search-widget .gofly-subheading {
	font-size: var(--gofly-sub-size);
	color: var(--gofly-sub-color);
	margin: 0 0 40px;
	line-height: 1.6;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
	font-weight: 400;
}

/* =============================================================================
   SEARCH CONTAINER
   ============================================================================= */

.gofly-search-widget .gofly-search-container {
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: var(--gofly-search-max-w);
	margin: 0 auto;
	width: 100%;
}

/* =============================================================================
   SEARCH BOX (input + icon)
   ============================================================================= */

.gofly-search-widget .gofly-search-box {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 12px;
	background-color: #ffffff;
	border-radius: var(--gofly-search-radius);
	padding: 8px 8px 8px 24px;
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.14),
		0 2px 8px  rgba(0, 0, 0, 0.07);
	transition:
		box-shadow 0.3s ease,
		transform  0.25s ease;
	box-sizing: border-box;
}

.gofly-search-widget .gofly-search-box:focus-within {
	box-shadow:
		0 14px 48px rgba(0, 0, 0, 0.18),
		0 4px  16px rgba(37, 99, 235, 0.22);
	transform: translateY(-2px);
}

/* Location pin icon */
.gofly-search-widget .gofly-location-icon {
	color: var(--gofly-btn-bg);
	display: flex;
	align-items: center;
	flex-shrink: 0;
	transition: transform 0.25s ease, color 0.2s ease;
}

.gofly-search-widget .gofly-search-box:focus-within .gofly-location-icon {
	transform: scale(1.15);
}

/* Input wrapper (holds the text field + dropdown) */
.gofly-search-widget .gofly-input-wrapper {
	flex: 1;
	position: relative;
	min-width: 0;
}

/* Text input */
.gofly-search-widget .gofly-search-input {
	display: block;
	width: 100%;
	border: none;
	outline: none;
	background: transparent;
	font-size: 16px;
	font-weight: 500;
	color: #1f2937;
	padding: 10px 0;
	box-sizing: border-box;
	cursor: text;
}

.gofly-search-widget .gofly-search-input::placeholder {
	color: #9ca3af;
	font-weight: 400;
}

/* =============================================================================
   DROPDOWN
   ============================================================================= */

.gofly-search-widget .gofly-dropdown {
	position: absolute;
	top: calc(100% + 14px);
	left: -60px;  /* align with icon */
	right: -16px;
	background: #ffffff;
	border-radius: 16px;
	box-shadow:
		0 24px 64px rgba(0, 0, 0, 0.14),
		0 4px  16px rgba(0, 0, 0, 0.07);
	border: 1px solid rgba(0, 0, 0, 0.05);
	z-index: 99999;
	display: none;
	overflow: hidden;
	min-width: 260px;
}

.gofly-search-widget .gofly-dropdown.is-open {
	display: block;
	animation: gofly-slide-in 0.18s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes gofly-slide-in {
	from { opacity: 0; transform: translateY(-10px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0)     scale(1); }
}

/* Scrollable list */
.gofly-search-widget .gofly-dropdown-inner {
	max-height: 320px;
	overflow-y: auto;
	padding: 6px 0;
	overscroll-behavior: contain;
}

/* Thin scrollbar */
.gofly-search-widget .gofly-dropdown-inner::-webkit-scrollbar       { width: 4px; }
.gofly-search-widget .gofly-dropdown-inner::-webkit-scrollbar-track  { background: transparent; }
.gofly-search-widget .gofly-dropdown-inner::-webkit-scrollbar-thumb  { background: #e5e7eb; border-radius: 4px; }

/* Individual country item */
.gofly-search-widget .gofly-dropdown-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 20px;
	cursor: pointer;
	transition: background-color 0.12s ease;
	color: #1f2937;
	font-size: 15px;
	font-weight: 500;
	user-select: none;
	outline: none;
}

.gofly-search-widget .gofly-dropdown-item:hover,
.gofly-search-widget .gofly-dropdown-item.is-active {
	background-color: #eff6ff;
	color: #1d4ed8;
}

.gofly-search-widget .gofly-dropdown-item:hover .gofly-item-dot,
.gofly-search-widget .gofly-dropdown-item.is-active .gofly-item-dot {
	background-color: #1d4ed8;
	transform: scale(1.3);
}

/* Dot accent */
.gofly-search-widget .gofly-item-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: var(--gofly-btn-bg);
	flex-shrink: 0;
	transition: transform 0.15s ease, background-color 0.15s ease;
}

/* Country title */
.gofly-search-widget .gofly-item-title {
	flex: 1;
	text-align: left;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Status messages (loading / no results) */
.gofly-search-widget .gofly-dropdown-message {
	padding: 20px 20px;
	text-align: center;
	color: #6b7280;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

/* Loading spinner */
.gofly-search-widget .gofly-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #e5e7eb;
	border-top-color: var(--gofly-btn-bg);
	border-radius: 50%;
	animation: gofly-spin 0.55s linear infinite;
	flex-shrink: 0;
}

@keyframes gofly-spin {
	to { transform: rotate(360deg); }
}

/* =============================================================================
   SEARCH BUTTON
   ============================================================================= */

.gofly-search-widget .gofly-search-btn {
	width: 56px;
	height: 56px;
	min-width: 56px;
	border-radius: 50%;
	border: none;
	background-color: var(--gofly-btn-bg);
	color: #ffffff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-shadow: 0 4px 20px rgba(37, 99, 235, 0.38);
	transition:
		background-color 0.2s ease,
		transform        0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
		box-shadow       0.2s ease;
	padding: 0;
}

.gofly-search-widget .gofly-search-btn:hover {
	background-color: var(--gofly-btn-hover-bg);
	transform: translateX(4px) scale(1.05);
	box-shadow: 0 6px 28px rgba(37, 99, 235, 0.5);
}

.gofly-search-widget .gofly-search-btn:active {
	transform: translateX(2px) scale(0.97);
	box-shadow: 0 2px 12px rgba(37, 99, 235, 0.3);
}

.gofly-search-widget .gofly-search-btn:focus-visible {
	outline: 3px solid rgba(37, 99, 235, 0.45);
	outline-offset: 3px;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
	.gofly-search-widget .gofly-heading {
		font-size: clamp(26px, 6vw, 40px);
	}

	.gofly-search-widget .gofly-subheading {
		font-size: clamp(14px, 3.5vw, 18px);
		margin-bottom: 28px;
	}

	.gofly-search-widget .gofly-search-container {
		gap: 8px;
	}

	.gofly-search-widget .gofly-search-box {
		padding: 6px 6px 6px 16px;
	}

	.gofly-search-widget .gofly-search-input {
		font-size: 15px;
		padding: 9px 0;
	}

	.gofly-search-widget .gofly-search-btn {
		width: 48px;
		height: 48px;
		min-width: 48px;
	}

	.gofly-search-widget .gofly-dropdown {
		left: -42px;
		right: -10px;
	}
}

@media (max-width: 480px) {
	.gofly-search-widget .gofly-hero-content {
		padding: 32px 16px;
	}

	.gofly-search-widget .gofly-heading {
		font-size: clamp(22px, 7vw, 30px);
		letter-spacing: -0.02em;
	}

	.gofly-search-widget .gofly-subheading {
		font-size: 14px;
		margin-bottom: 24px;
	}

	.gofly-search-widget .gofly-search-box {
		padding: 5px 5px 5px 14px;
		gap: 8px;
	}

	.gofly-search-widget .gofly-location-icon svg {
		width: 18px;
		height: 18px;
	}

	.gofly-search-widget .gofly-search-input {
		font-size: 14px;
	}

	.gofly-search-widget .gofly-search-btn {
		width: 44px;
		height: 44px;
		min-width: 44px;
	}

	.gofly-search-widget .gofly-search-btn svg {
		width: 17px;
		height: 17px;
	}

	.gofly-search-widget .gofly-dropdown {
		left: -34px;
		right: -6px;
		border-radius: 12px;
	}
}

/* =============================================================================
   ACCESSIBILITY — reduced motion
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
	.gofly-search-widget .gofly-search-box,
	.gofly-search-widget .gofly-search-btn,
	.gofly-search-widget .gofly-location-icon,
	.gofly-search-widget .gofly-dropdown.is-open {
		animation: none;
		transition: none;
	}
	.gofly-search-widget .gofly-spinner {
		animation: gofly-spin 1s linear infinite;
	}
}
