/* ==========================================================
   Live Trackers Plugin - Frontend Styles (VIP Edition)
   ========================================================== */

#sim-widget, #sim-widget *,
#sw-overlay, #sw-overlay * {
	box-sizing: border-box;
	font-family: 'Segoe UI', Arial, sans-serif;
}

:root {
	--sw-primary: #1E3A8A;
	--sw-secondary: #3B82F6;
}

/* ---------------- Main Search Card ---------------- */
.sw-card {
	max-width: 560px;
	margin: 20px auto;
	background: #ffffff;
	border: 2px solid var(--sw-primary);
	border-radius: 18px;
	padding: 32px 28px;
	box-shadow: 0 4px 18px rgba(30, 58, 138, 0.12);
}

.sw-title {
	text-align: center;
	color: var(--sw-primary) !important;
	font-size: 26px;
	font-weight: 800;
	margin: 0 0 8px;
}

.sw-subtitle {
	text-align: center;
	color: #555 !important;
	font-size: 14px;
	margin: 0 0 22px;
}

/* Social proof */
.sw-social-proof {
	text-align: center;
	background: #FEF3C7;
	color: #92400E !important;
	font-size: 13px;
	padding: 8px 14px;
	border-radius: 8px;
	margin: 0 0 18px;
	font-weight: 600;
}

/* Tabs */
.sw-tabs {
	display: flex;
	background: #EEF2FF;
	border-radius: 10px;
	padding: 4px;
	margin-bottom: 20px;
	gap: 4px;
}

.sw-tab {
	flex: 1;
	border: none;
	background: transparent;
	padding: 12px 10px;
	border-radius: 8px;
	font-weight: 700;
	font-size: 14px;
	color: var(--sw-primary) !important;
	cursor: pointer;
	transition: all 0.2s ease;
}

.sw-tab.active {
	background: linear-gradient(135deg, var(--sw-primary), var(--sw-secondary));
	color: #ffffff !important;
	box-shadow: 0 2px 8px rgba(30,58,138,0.3);
}

/* Form */
.sw-label {
	display: block;
	font-weight: 700;
	color: var(--sw-primary) !important;
	margin-bottom: 8px;
	font-size: 14px;
}

.sw-input-wrap {
	position: relative;
	margin-bottom: 10px;
}
.sw-input-icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	width: 20px;
	height: 20px;
	fill: #9CA3AF;
	pointer-events: none;
	transition: fill 0.2s ease;
	z-index: 2;
}
.sw-input-wrap:focus-within .sw-input-icon {
	fill: var(--sw-primary);
}

.sw-input {
	width: 100%;
	padding: 14px 16px 14px 48px !important;
	border: 2px solid #E5E7EB;
	border-radius: 10px;
	font-size: 16px;
	margin-bottom: 0;
	outline: none;
	color: #1a1a1a !important;
	background: #F9FAFB !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), inset 0 1px 2px rgba(0, 0, 0, 0.02);
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
	box-sizing: border-box !important;
}

.sw-input:focus {
	border-color: var(--sw-primary);
	background: #ffffff !important;
	box-shadow: 0 0 0 4px rgba(var(--sw-primary-rgb), 0.15), 0 4px 12px rgba(var(--sw-primary-rgb), 0.1);
}

.sw-input::placeholder {
	color: #999 !important;
}

/* Validation error */
.sw-error {
	color: #DC2626 !important;
	background: #FEF2F2;
	border-left: 3px solid #DC2626;
	padding: 8px 12px;
	font-size: 13px;
	font-weight: 600;
	border-radius: 6px;
	margin: 0 0 14px;
}

/* Buttons (general) */
.sw-btn,
.sw-btn:link,
.sw-btn:visited,
.sw-btn:hover,
.sw-btn:active {
	width: 100%;
	padding: 15px;
	border: none;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--sw-primary), var(--sw-secondary));
	color: #ffffff !important;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none !important;
	transition: opacity 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
	text-align: center;
	line-height: 1.4;
	box-shadow: 0 4px 14px rgba(var(--sw-primary-rgb), 0.3);
}

.sw-btn:hover {
	opacity: 0.92;
	box-shadow: 0 6px 18px rgba(var(--sw-primary-rgb), 0.4);
	transform: translateY(-1px);
}
.sw-btn:active { transform: scale(0.99); }

/* Quick links (chips) */
.sw-links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
	justify-content: center;
}

.sw-chip,
.sw-chip:link,
.sw-chip:visited {
	flex: 1 1 auto;
	text-align: center;
	background: #EEF2FF;
	color: var(--sw-primary) !important;
	text-decoration: none !important;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

.sw-chip:hover { background: #DCE6FF; }

/* ---------------- Popup / Modal ---------------- */
.sw-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.6);
	z-index: 999999;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.sw-overlay.open { display: flex; }

.sw-modal {
	background: #ffffff;
	border-radius: 16px;
	max-width: 380px;
	width: 100%;
	padding: 30px 26px 26px;
	text-align: center;
	position: relative;
	box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}

.sw-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	border: none;
	background: transparent;
	font-size: 22px;
	color: #888 !important;
	cursor: pointer;
	line-height: 1;
}

.sw-modal-icon { font-size: 40px; margin-bottom: 12px; }

.sw-modal h3 {
	color: var(--sw-primary) !important;
	margin: 0 0 10px;
	font-size: 19px;
}

.sw-modal p {
	color: #555 !important;
	font-size: 14px;
	line-height: 1.5;
	margin: 0 0 20px;
}

.sw-modal .sw-btn {
	margin-top: 15px;
}

/* Rotating Timer */
.sw-timer {
	font-size: 42px;
	font-weight: 800;
	color: var(--sw-primary) !important;
	margin: 20px auto;
	width: 85px;
	height: 85px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 6px solid #e5e7eb;
	border-radius: 50%;
	position: relative;
}

.sw-timer::after {
	content: '';
	position: absolute;
	width: 85px;
	height: 85px;
	border: 6px solid transparent;
	border-top-color: var(--sw-secondary);
	border-radius: 50%;
	animation: sw-spin 1s linear infinite;
	top: -6px;
	left: -6px;
}

@keyframes sw-spin {
	to { transform: rotate(360deg); }
}

/* ---------------- Responsive Design ---------------- */

@media (max-width: 768px) {
	.sw-card {
		max-width: 100%;
		margin: 15px 10px;
		padding: 26px 20px;
	}
	.sw-title { font-size: 22px; }
	.sw-subtitle { font-size: 13px; }
}

@media (max-width: 480px) {
	.sw-card {
		padding: 20px 16px;
		border-radius: 14px;
		margin: 10px auto;
	}
	.sw-title { font-size: 19px; }
	.sw-subtitle { font-size: 12px; margin-bottom: 12px; }
	.sw-social-proof { font-size: 12px; padding: 6px 10px; }

	.sw-tab {
		font-size: 12px;
		padding: 10px 6px;
	}

	.sw-input-wrap { margin-bottom: 10px; }
	.sw-input-icon { left: 14px; width: 18px; height: 18px; }
	.sw-input {
		font-size: 16px;
		padding: 12px 14px 12px 42px !important;
	}

	.sw-btn {
		font-size: 14px;
		padding: 13px;
	}

	.sw-links {
		gap: 6px;
	}
	.sw-chip {
		font-size: 11px;
		padding: 8px 8px;
		flex: 1 1 40%;
	}

	.sw-modal {
		padding: 24px 18px 20px;
		max-width: 92vw;
	}
	.sw-modal h3 { font-size: 17px; }
	.sw-modal p { font-size: 13px; }

	.sw-timer {
		width: 70px;
		height: 70px;
		font-size: 34px;
	}
	.sw-timer::after {
		width: 70px;
		height: 70px;
	}
}

@media (max-width: 360px) {
	.sw-tabs {
		flex-direction: column;
	}
	.sw-chip {
		flex: 1 1 100%;
	}
}

/* NEW: Pretty "Check Latest Database" CTA button in popup
   (replaces the old WhatsApp CTA — same shape/weight, kept the
   original teal/green gradient so it stays visually consistent
   with prior versions of this widget). */
.sw-cta-latest-db {
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 14px 20px;
	margin-top: 15px;
	border: none;
	border-radius: 50px;
	background: linear-gradient(90deg, #0d9488, #22c55e) !important;
	color: #ffffff !important;
	font-size: 16px;
	font-weight: 800;
	text-decoration: none !important;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sw-cta-latest-db:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(13, 148, 136, 0.45);
}
.sw-cta-latest-db:active {
	transform: translateY(0);
}

/* ---------------- Not-Found screen: Latest Database CTA wrapper ---------------- */
.sw-not-found-ctas {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 6px;
}

/* Inside the flex wrapper we don't want the button's own margin-top
   (15px, from the rule above) doubled up with the wrapper's own gap. */
.sw-not-found-ctas .sw-cta-latest-db {
	margin-top: 0;
}

/* ==========================================================
   Theme Preset: Dark Mode overrides
   Applied via the "sw-theme-dark" class on #sim-widget and
   #sw-overlay when the admin selects the "Midnight Dark" preset
   (or any future dark preset) in Theme Preset settings.
   ========================================================== */
#sim-widget.sw-theme-dark {
	background: #111827;
	border-color: var(--sw-secondary);
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}
#sim-widget.sw-theme-dark .sw-title { color: var(--sw-secondary) !important; }
#sim-widget.sw-theme-dark .sw-subtitle { color: #9CA3AF !important; }
#sim-widget.sw-theme-dark .sw-social-proof {
	background: #1F2937;
	color: #FBBF24 !important;
}
#sim-widget.sw-theme-dark .sw-tabs { background: #1F2937; }
#sim-widget.sw-theme-dark .sw-tab { color: var(--sw-secondary) !important; }
#sim-widget.sw-theme-dark .sw-tab.active {
	background: linear-gradient(135deg, var(--sw-primary), var(--sw-secondary));
	color: #0F172A !important;
}
#sim-widget.sw-theme-dark .sw-label { color: var(--sw-secondary) !important; }
#sim-widget.sw-theme-dark .sw-input {
	background: #1F2937 !important;
	border-color: var(--sw-secondary);
	color: #F3F4F6 !important;
}
#sim-widget.sw-theme-dark .sw-input::placeholder { color: #6B7280 !important; }
#sim-widget.sw-theme-dark .sw-chip {
	background: #1F2937;
	color: var(--sw-secondary) !important;
}
#sim-widget.sw-theme-dark .sw-chip:hover { background: #273449; }
#sim-widget.sw-theme-dark .sw-btn {
	background: linear-gradient(135deg, var(--sw-primary), var(--sw-secondary));
	color: #0F172A !important;
}

#sw-overlay.sw-theme-dark .sw-modal {
	background: #111827;
	box-shadow: 0 10px 40px rgba(0,0,0,0.55);
}
#sw-overlay.sw-theme-dark .sw-modal-close { color: #9CA3AF !important; }
#sw-overlay.sw-theme-dark .sw-modal h3 { color: var(--sw-secondary) !important; }
#sw-overlay.sw-theme-dark .sw-modal p { color: #9CA3AF !important; }
#sw-overlay.sw-theme-dark .sw-timer {
	color: var(--sw-secondary) !important;
	border-color: #1F2937;
}

/* ==========================================================
   Layout Preset: "Modern Icon" — a fully different card/form
   design (icon heading, single auto-detecting input, feature
   icon grid, spinner-based loading) selectable independently
   from the color theme via Widget Layout in UI Style settings.
   ========================================================== */

#sim-widget.sw-layout-modern {
	border: none;
	border-top: 4px solid var(--sw-primary);
	border-radius: 25px;
	padding: 35px 30px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.sw-modern-title {
	text-align: center;
	font-size: 22px;
	color: #374151;
	line-height: 1.5;
	margin: 0 0 22px;
	font-weight: 400;
}
.sw-modern-title-icon { width: 22px; height: 22px; fill: var(--sw-primary); margin-right: 4px; vertical-align: -4px; }
.sw-modern-title span { color: var(--sw-primary); font-weight: 700; }

#sim-widget.sw-layout-modern .sw-social-proof { margin-bottom: 18px; }

.sw-modern-form { margin: 0; }

.sw-modern-input-wrap {
	position: relative;
	margin-bottom: 16px;
}
.sw-modern-input-icon {
	position: absolute;
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	fill: #9CA3AF;
	pointer-events: none;
	transition: fill 0.2s ease;
	z-index: 2;
}
.sw-modern-input-wrap:focus-within .sw-modern-input-icon {
	fill: var(--sw-primary);
}

.sw-modern-input {
	width: 100%;
	height: 64px;
	border: 2px solid #E5E7EB;
	border-radius: 14px;
	padding: 0 18px 0 52px !important;
	font-size: 16px;
	outline: none;
	margin-bottom: 0;
	color: #111827 !important;
	background: #F9FAFB !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), inset 0 1px 2px rgba(0, 0, 0, 0.02);
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
	box-sizing: border-box !important;
}
.sw-modern-input:focus {
	border-color: var(--sw-primary);
	background: #ffffff !important;
	box-shadow: 0 0 0 4px rgba(var(--sw-primary-rgb), 0.15), 0 4px 12px rgba(var(--sw-primary-rgb), 0.1);
}
.sw-modern-input::placeholder { color: #9CA3AF !important; }

.sw-modern-btn {
	width: 100%;
	height: 62px;
	background: var(--sw-primary) !important;
	border: none;
	border-radius: 15px;
	color: #ffffff !important;
	font-size: 18px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(var(--sw-primary-rgb), 0.3);
	transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}
.sw-modern-btn:hover {
	background: var(--sw-secondary) !important;
	box-shadow: 0 6px 18px rgba(var(--sw-primary-rgb), 0.4);
	transform: translateY(-1px);
}
.sw-modern-btn:active { transform: scale(0.99); }
.sw-modern-btn-icon { width: 18px; height: 18px; fill: currentColor; margin-right: 6px; vertical-align: -3px; }

.sw-modern-features {
	margin-top: 24px;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}
.sw-modern-features div {
	display: flex;
	align-items: center;
	gap: 7px;
	background: #F3F4F6;
	color: #374151;
	font-size: 12.5px;
	font-weight: 700;
	padding: 9px 14px;
	border-radius: 30px;
	white-space: nowrap;
}
.sw-modern-features .sw-icon { width: 15px; height: 15px; fill: var(--sw-primary); flex-shrink: 0; }

.sw-modern-try {
	text-align: center;
	color: #6b7280;
	margin-top: 22px;
	font-size: 13px;
	line-height: 1.7;
}
.sw-modern-try strong { color: #374151; }

/* Modern modal: rounder, softer, spinner-based loading */
#sw-overlay.sw-layout-modern .sw-modal {
	border-radius: 22px;
	border-top: 4px solid var(--sw-primary);
}
#sw-overlay.sw-layout-modern .sw-modal h3 {
	color: var(--sw-primary) !important;
}

.sw-modern-spinner {
	width: 62px;
	height: 62px;
	margin: 6px auto 18px;
	border: 5px solid #e5e7eb;
	border-top: 5px solid var(--sw-primary);
	border-radius: 50%;
	animation: sw-modern-spin 0.9s linear infinite;
}
@keyframes sw-modern-spin {
	100% { transform: rotate(360deg); }
}

.sw-modern-timer-wrap {
	margin-top: 16px;
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 6px;
}
.sw-modern-timer-number {
	font-size: 30px;
	font-weight: 800;
	color: var(--sw-primary) !important;
	line-height: 1;
}
.sw-modern-timer-label {
	font-size: 13px;
	color: #9CA3AF !important;
	font-weight: 600;
}

#sw-overlay.sw-layout-modern .sw-cta-latest-db {
	border-radius: 15px;
}

/* ---------------- Modern layout: Responsive ---------------- */
@media (max-width: 600px) {
	#sim-widget.sw-layout-modern {
		max-width: 100%;
		margin: 15px 10px;
		padding: 24px 18px;
	}
	.sw-modern-title { font-size: 19px; }
	.sw-modern-input-wrap { margin-bottom: 14px; }
	.sw-modern-input-icon { left: 18px; font-size: 16px; }
	.sw-modern-input { height: 58px; font-size: 15px; padding: 0 16px 0 46px !important; }
	.sw-modern-btn { height: 56px; font-size: 17px; }
	.sw-modern-features { gap: 8px; }
	.sw-modern-features div { font-size: 12px; padding: 8px 12px; }
	.sw-modern-try { font-size: 13px; }
	#sw-overlay.sw-layout-modern .sw-modal { padding: 24px 18px 20px; max-width: 92vw; }
	.sw-modern-spinner { width: 52px; height: 52px; margin-bottom: 14px; }
	.sw-modern-timer-number { font-size: 24px; }
}

@media (max-width: 380px) {
	#sim-widget.sw-layout-modern { padding: 20px 14px; border-radius: 18px; }
	.sw-modern-title { font-size: 16px; }
	.sw-modern-title-icon { display: block; margin: 0 auto 6px; }
	.sw-modern-input-wrap { margin-bottom: 12px; }
	.sw-modern-input-icon { left: 16px; font-size: 15px; }
	.sw-modern-input { height: 52px; font-size: 14px; padding: 0 14px 0 42px !important; }
	.sw-modern-btn { height: 52px; font-size: 15px; }
	.sw-modern-features { gap: 6px; }
	.sw-modern-features div { font-size: 11px; padding: 7px 10px; }
	.sw-modern-try { font-size: 11.5px; line-height: 1.5; }
}