/* ==========================================================================
   Language & Currency Selector — Modal Styles
   ========================================================================== */

:root {
	--lcs-accent: #4f6ef7;
	--lcs-accent-light: #eef1fe;
	--lcs-accent-border: #c7d0fc;
	--lcs-surface: #ffffff;
	--lcs-surface-2: #f8f9fb;
	--lcs-border: #e4e7ec;
	--lcs-border-strong: #d0d5dd;
	--lcs-text: #111827;
	--lcs-text-2: #374151;
	--lcs-text-3: #6b7280;
	--lcs-success-bg: #ecfdf5;
	--lcs-success-border: #6ee7b7;
	--lcs-success-text: #065f46;
	--lcs-radius: 8px;
}

.lcs-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(17, 24, 39, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.lcs-overlay[hidden] { display: none !important; }

.lcs-overlay.lcs-closing { animation: lcsFadeOut 0.22s ease both; }
@keyframes lcsFadeOut { to { opacity: 0; } }

.lcs-modal {
	background: var(--lcs-surface);
	border-radius: 16px;
	width: 100%;
	max-width: 460px;
	max-height: 90vh;
	overflow-y: auto;
	border: 1px solid var(--lcs-border);
	box-shadow: 0 24px 64px rgba(0,0,0,0.28);
	animation: lcsPopIn 0.28s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes lcsPopIn {
	from { opacity: 0; transform: translateY(16px) scale(0.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lcs-modal-inner { padding: 28px 24px 22px; }

.lcs-head { text-align: center; margin-bottom: 22px; }
.lcs-logo { max-height: 36px; width: auto; margin-bottom: 10px; }
.lcs-head-icon {
	width: 40px; height: 40px; border-radius: 10px;
	background: var(--lcs-accent-light);
	display: inline-flex; align-items: center; justify-content: center;
	margin-bottom: 12px; font-size: 18px;
}
.lcs-head-title { font-size: 17px; font-weight: 600; color: var(--lcs-text); margin-bottom: 4px; line-height: 1.3; }
.lcs-head-sub { font-size: 12.5px; color: var(--lcs-text-3); line-height: 1.5; }

/* Detecting / geo banner */
@keyframes lcsSpin { to { transform: rotate(360deg); } }
.lcs-spin { display: inline-block; animation: lcsSpin 0.8s linear infinite; }

.lcs-detect-bar {
	display: flex; align-items: center; gap: 9px;
	background: var(--lcs-surface-2); border: 1px solid var(--lcs-border);
	border-radius: var(--lcs-radius); padding: 10px 13px; margin-bottom: 14px;
	font-size: 13px; color: var(--lcs-text-3);
}
.lcs-detect-bar[hidden] { display: none; }

.lcs-geo-banner {
	display: flex; align-items: center; gap: 9px;
	background: var(--lcs-success-bg); border: 1px solid var(--lcs-success-border);
	border-radius: var(--lcs-radius); padding: 9px 12px; margin-bottom: 12px;
	font-size: 12.5px; color: var(--lcs-success-text);
}
.lcs-geo-banner[hidden] { display: none; }

/* Country pill */
.lcs-country-pill {
	display: flex; align-items: center; gap: 9px;
	background: var(--lcs-surface-2); border: 1px solid var(--lcs-border-strong);
	border-radius: var(--lcs-radius); padding: 8px 12px; margin-bottom: 14px;
	cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.lcs-country-pill[hidden] { display: none; }
.lcs-country-pill:hover { background: var(--lcs-accent-light); border-color: var(--lcs-accent-border); }
.lcs-country-pill:focus-visible { outline: 3px solid var(--lcs-accent); outline-offset: 2px; }
.lcs-cp-flag { font-size: 17px; line-height: 1; }
.lcs-cp-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--lcs-text); }
.lcs-cp-change { font-size: 11.5px; color: var(--lcs-accent); white-space: nowrap; }

/* Search — fixed: no overlapping icon, plain padding + separate Clear button */
.lcs-field-label {
	display: block; font-size: 11px; font-weight: 500; color: var(--lcs-text-3);
	letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px;
}
#lcs-search[hidden] { display: none; }
.lcs-search-row { display: flex; gap: 8px; align-items: center; }
.lcs-search-input {
	flex: 1; padding: 9px 12px;
	border: 1px solid var(--lcs-border-strong); border-radius: var(--lcs-radius);
	background: var(--lcs-surface); color: var(--lcs-text);
	font-size: 13.5px; font-family: inherit; outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.lcs-search-input:focus { border-color: var(--lcs-accent); box-shadow: 0 0 0 3px var(--lcs-accent-light); }
.lcs-search-input::placeholder { color: var(--lcs-text-3); }
.lcs-clear-btn {
	padding: 8px 11px; background: var(--lcs-surface-2);
	border: 1px solid var(--lcs-border-strong); border-radius: var(--lcs-radius);
	color: var(--lcs-text-3); font-size: 12px; cursor: pointer; font-family: inherit;
	white-space: nowrap; transition: background 0.1s;
}
.lcs-clear-btn[hidden] { display: none; }
.lcs-clear-btn:hover { background: var(--lcs-border); color: var(--lcs-text); }

/* Dropdown */
.lcs-dropdown {
	background: var(--lcs-surface); border: 1px solid var(--lcs-border-strong);
	border-radius: var(--lcs-radius); overflow: hidden; max-height: 200px; overflow-y: auto;
	margin-top: 4px; box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.lcs-dropdown[hidden] { display: none; }
.lcs-dd-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; transition: background 0.1s; }
.lcs-dd-item:hover, .lcs-dd-item.lcs-hi { background: var(--lcs-surface-2); }
.lcs-dd-flag { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; line-height: 1; }
.lcs-dd-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--lcs-text); }
.lcs-dd-hint { font-size: 11px; color: var(--lcs-text-3); }
.lcs-dd-empty { padding: 14px; text-align: center; font-size: 13px; color: var(--lcs-text-3); }

/* Section label + popular grid */
.lcs-section-label {
	font-size: 11px; font-weight: 500; color: var(--lcs-text-3);
	letter-spacing: 0.04em; text-transform: uppercase; margin: 14px 0 8px;
}
#lcs-defaults[hidden], #lcs-custom[hidden] { display: none; }
.lcs-def-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.lcs-def-card {
	display: flex; align-items: center; gap: 9px; padding: 9px 11px;
	background: var(--lcs-surface-2); border: 1px solid var(--lcs-border);
	border-radius: var(--lcs-radius); cursor: pointer; font-family: inherit;
	text-align: left; transition: background 0.15s, border-color 0.15s; width: 100%;
}
.lcs-def-card:hover { background: var(--lcs-accent-light); border-color: var(--lcs-accent-border); }
.lcs-def-card:focus-visible { outline: 3px solid var(--lcs-accent); outline-offset: 2px; }
.lcs-def-card-flag { font-size: 17px; line-height: 1; }
.lcs-def-card-name { font-size: 12.5px; font-weight: 500; color: var(--lcs-text); }

/* Customise panel + chips */
.lcs-custom-panel {
	background: var(--lcs-surface-2); border: 1px solid var(--lcs-border);
	border-radius: 10px; padding: 13px; margin-bottom: 12px;
}
.lcs-custom-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.lcs-custom-row:last-child { margin-bottom: 0; }
.lcs-custom-label { font-size: 12px; color: var(--lcs-text-3); width: 66px; flex-shrink: 0; padding-top: 5px; }
.lcs-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.lcs-chip {
	padding: 4px 11px; border-radius: 20px; border: 1px solid var(--lcs-border-strong);
	background: var(--lcs-surface); font-size: 12px; color: var(--lcs-text-2);
	cursor: pointer; transition: all 0.12s; font-family: inherit;
}
.lcs-chip:hover { border-color: var(--lcs-accent); color: var(--lcs-accent); background: var(--lcs-accent-light); }
.lcs-chip.lcs-on { border-color: var(--lcs-accent); background: var(--lcs-accent-light); color: var(--lcs-accent); font-weight: 600; }
.lcs-chip:focus-visible { outline: 3px solid var(--lcs-accent); outline-offset: 2px; }

/* Summary */
.lcs-summary {
	display: flex; align-items: center; gap: 11px;
	background: var(--lcs-accent-light); border: 1.5px solid var(--lcs-accent-border);
	border-radius: 10px; padding: 11px 13px; margin-bottom: 16px;
}
.lcs-summary-flag { font-size: 24px; line-height: 1; }
.lcs-summary-main { font-size: 13px; font-weight: 600; color: var(--lcs-accent); }
.lcs-summary-sub { font-size: 11.5px; color: var(--lcs-accent); opacity: 0.75; margin-top: 2px; }

/* Footer */
.lcs-divider { height: 1px; background: var(--lcs-border); margin: 14px 0; }
.lcs-cta {
	width: 100%; padding: 11px; background: var(--lcs-accent); color: #fff;
	border: none; border-radius: var(--lcs-radius); font-size: 14px; font-weight: 600;
	cursor: pointer; font-family: inherit; transition: opacity 0.15s; margin-bottom: 9px;
}
.lcs-cta:disabled { opacity: 0.3; cursor: not-allowed; }
.lcs-cta:not(:disabled):hover { opacity: 0.88; }
.lcs-cta:focus-visible { outline: 3px solid var(--lcs-accent); outline-offset: 3px; }
.lcs-cta.lcs-loading { position: relative; color: transparent; }
.lcs-cta.lcs-loading::after {
	content: ''; position: absolute; inset: 50% auto auto 50%; transform: translate(-50%,-50%);
	width: 16px; height: 16px; border: 2.5px solid rgba(255,255,255,0.35);
	border-top-color: #fff; border-radius: 50%; animation: lcsSpin 0.7s linear infinite;
}

.lcs-skip {
	display: block; width: 100%; background: none; border: none; color: var(--lcs-text-3);
	font-size: 12px; cursor: pointer; font-family: inherit; padding: 4px; text-align: center;
}
.lcs-skip:hover { color: var(--lcs-text-2); text-decoration: underline; }
.lcs-skip:disabled { cursor: default; text-decoration: none; }

/* Success view */
#lcs-view-success[hidden] { display: none; }
.lcs-success { text-align: center; padding: 36px 20px; }
.lcs-success-circle {
	width: 48px; height: 48px; border-radius: 50%;
	background: var(--lcs-success-bg); border: 2px solid var(--lcs-success-border);
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 22px; margin-bottom: 14px; color: var(--lcs-success-text);
}
.lcs-success-title { font-size: 16px; font-weight: 600; color: var(--lcs-text); margin-bottom: 5px; }
.lcs-success-sub { font-size: 13px; color: var(--lcs-text-3); }

/* Responsive */
@media (max-width: 480px) {
	.lcs-modal-inner { padding: 24px 18px 20px; }
	.lcs-def-grid { grid-template-columns: 1fr; }
	.lcs-head-title { font-size: 16px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.lcs-overlay, .lcs-modal, .lcs-spin, .lcs-cta.lcs-loading::after {
		animation: none !important;
		transition: none !important;
	}
}
