/* =====================================================
   USGP v3.1 — User Selectable Token Stylesheet
   Redesigned card-based picker + all legacy display classes
   ===================================================== */

/* ── Wrappers ─────────────────────────────────────────── */
.usgp-selector,
.usgp-points-wrapper,
.usgp-row-wrapper {
	width: 100% !important;
	max-width: 100% !important;
	margin-left: auto;
	margin-right: auto;
}

.usgp-points-wrapper,
.usgp-row-wrapper {
	transition: opacity .25s ease;
}
.usgp-points-wrapper.usgp-fading,
.usgp-row-wrapper.usgp-fading {
	opacity: 0;
}

/* ══════════════════════════════════════════════════════
   CUSTOM PICKER
   ══════════════════════════════════════════════════════ */

.usgp-picker {
	width: 100%;
	position: relative;
	font-family: inherit;
}

/* ── Trigger (selected token display) ─────────────────── */
.usgp-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px 16px;
	background: #f8fafc;
	border: 2px solid #e2e8f0;
	border-radius: 18px;
	transition: border-color .2s, background .2s, border-radius .15s;
	user-select: none;
}
.usgp-trigger.usgp-trigger-manual {
	cursor: pointer;
}
.usgp-trigger.usgp-trigger-manual:hover {
	border-color: #3b82f6;
	background: #eff6ff;
}
.usgp-trigger.usgp-trigger-auto {
	cursor: default;
	opacity: .85;
}
.usgp-trigger.usgp-trigger-open {
	border-color: #3b82f6;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}

/* ── Chevron ──────────────────────────────────────────── */
.usgp-chevron {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	color: #64748b;
	transition: transform .2s;
}
.usgp-trigger-open .usgp-chevron {
	transform: rotate(180deg);
}
.usgp-chevron svg { width: 100%; height: 100%; }

/* ── Auto badge ───────────────────────────────────────── */
.usgp-auto-badge {
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #3b82f6;
	background: #dbeafe;
	border-radius: 999px;
	padding: 3px 9px;
	flex-shrink: 0;
}

/* ── Dropdown ─────────────────────────────────────────── */
.usgp-dropdown {
	position: absolute;
	top: 100%;
	left: 0; right: 0;
	z-index: 1000;
	background: #fff;
	border: 2px solid #3b82f6;
	border-top: none;
	border-bottom-left-radius: 18px;
	border-bottom-right-radius: 18px;
	overflow: hidden;
	box-shadow: 0 12px 32px rgba(59,130,246,.12);
	max-height: 300px;
	overflow-y: auto;
}

/* ── Token option inside dropdown ─────────────────────── */
.usgp-token-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 16px;
	cursor: pointer;
	transition: background .15s;
	border-bottom: 1px solid #f1f5f9;
}
.usgp-token-option:last-child {
	border-bottom: none;
}
.usgp-token-option:hover {
	background: #eff6ff;
}
.usgp-token-option.usgp-option-active {
	background: #eff6ff;
}

/* ── Check icon ───────────────────────────────────────── */
.usgp-option-check {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	color: #3b82f6;
}
.usgp-option-check svg { width: 100%; height: 100%; }

.usgp-no-tokens {
	padding: 16px;
	text-align: center;
	color: #94a3b8;
	font-size: 14px;
}

/* ── Token row ─────────────────────────────────────────── */
.usgp-pick-row {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	flex: 1;
}
.usgp-pick-row.usgp-row-lg { gap: 14px; }

/* ── Logo ──────────────────────────────────────────────── */
.usgp-pick-logo {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	object-fit: cover;
	flex-shrink: 0;
	background: #e2e8f0;
	display: block;
}
.usgp-pick-logo.usgp-row-lg {
	width: 46px;
	height: 46px;
	border-radius: 13px;
}
.usgp-pick-logo-ph {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
	color: #fff;
	font-weight: 900;
	font-size: 16px;
	letter-spacing: -.01em;
}
.usgp-pick-logo-ph.usgp-row-lg {
	font-size: 20px;
}

/* ── Token info text ──────────────────────────────────── */
.usgp-pick-info {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.usgp-pick-name {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #0f172a;
}
.usgp-pick-row.usgp-row-lg .usgp-pick-name {
	font-size: 17px;
	font-weight: 800;
}
.usgp-pick-meta {
	font-size: 12px;
	color: #64748b;
	font-weight: 600;
	margin-top: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.usgp-empty-state {
	color: #94a3b8;
	font-size: 14px;
	font-weight: 500;
}

/* ── Auto-select row ──────────────────────────────────── */
.usgp-auto-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 12px;
	padding: 14px 16px;
	background: #f8fafc;
	border: 1.5px solid #e2e8f0;
	border-radius: 16px;
}
.usgp-auto-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.usgp-auto-label {
	font-size: 14px;
	font-weight: 700;
	color: #334155;
	line-height: 1.3;
}
.usgp-auto-desc {
	font-size: 11px;
	color: #94a3b8;
	font-weight: 500;
	margin-top: 2px;
}

/* ── Toggle switch ─────────────────────────────────────── */
.usgp-toggle {
	position: relative;
	display: inline-block;
	width: 46px;
	height: 26px;
	flex-shrink: 0;
}
.usgp-toggle input {
	opacity: 0;
	width: 0; height: 0;
	position: absolute;
}
.usgp-toggle-track {
	position: absolute;
	inset: 0;
	background: #cbd5e1;
	border-radius: 999px;
	cursor: pointer;
	transition: background .22s;
}
.usgp-toggle input:checked + .usgp-toggle-track {
	background: #3b82f6;
}
.usgp-toggle-thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 5px rgba(0,0,0,.22);
	transition: left .22s cubic-bezier(.4,0,.2,1);
}
.usgp-toggle input:checked + .usgp-toggle-track .usgp-toggle-thumb {
	left: 23px;
}

/* ── Message flash ─────────────────────────────────────── */
.usgp-message {
	margin-top: 10px;
	padding: 9px 14px;
	border-radius: 12px;
	font-size: 13px;
	font-weight: 700;
}
.usgp-msg-success {
	background: #dcfce7;
	color: #15803d;
}
.usgp-msg-error {
	background: #fee2e2;
	color: #dc2626;
}

/* ══════════════════════════════════════════════════════
   DARK MODE — picker
   ══════════════════════════════════════════════════════ */
html[data-theme="dark"] .usgp-trigger {
	background: #1e293b;
	border-color: #334155;
}
html[data-theme="dark"] .usgp-trigger.usgp-trigger-manual:hover,
html[data-theme="dark"] .usgp-trigger.usgp-trigger-open {
	border-color: #60a5fa;
	background: #172036;
}
html[data-theme="dark"] .usgp-dropdown {
	background: #1e293b;
	border-color: #60a5fa;
	box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
html[data-theme="dark"] .usgp-token-option {
	border-color: #334155;
}
html[data-theme="dark"] .usgp-token-option:hover,
html[data-theme="dark"] .usgp-token-option.usgp-option-active {
	background: #172036;
}
html[data-theme="dark"] .usgp-pick-name { color: #f1f5f9; }
html[data-theme="dark"] .usgp-pick-meta { color: #94a3b8; }
html[data-theme="dark"] .usgp-chevron { color: #94a3b8; }
html[data-theme="dark"] .usgp-auto-row {
	background: #1e293b;
	border-color: #334155;
}
html[data-theme="dark"] .usgp-auto-label { color: #cbd5e1; }
html[data-theme="dark"] .usgp-auto-badge {
	background: #1e3a5f;
	color: #60a5fa;
}
html[data-theme="dark"] .usgp-msg-success { background: #14532d; color: #4ade80; }
html[data-theme="dark"] .usgp-msg-error   { background: #7f1d1d; color: #f87171; }
html[data-theme="dark"] .usgp-pick-logo   { background: #334155; }

/* ══════════════════════════════════════════════════════
   LEGACY DISPLAY CLASSES (usgp_points_display / usgp_points_row)
   ══════════════════════════════════════════════════════ */

/* Row display */
.usgp-row-card {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
}
.usgp-row-media {
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.usgp-row-media img {
	width: 42px;
	height: 42px;
	border-radius: 12px;
	object-fit: cover;
	display: block;
	background: #fff;
}
.usgp-row-text { min-width: 0; }
.usgp-row-name {
	font-size: 20px;
	font-weight: 800;
	line-height: 1.2;
	margin: 0;
}
.usgp-row-balance {
	margin-top: 4px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
}

/* Standard token card */
.usgp-token-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px;
	background: #f8fafc;
	border-radius: 14px;
}
.usgp-token-icon img {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	object-fit: cover;
}
.usgp-token-card .usgp-token-name {
	font-size: 18px;
	font-weight: 800;
	line-height: 1.2;
}
.usgp-token-symbol {
	font-size: 12px;
	color: #64748b;
	font-weight: 700;
	text-transform: uppercase;
}
.usgp-token-balance {
	font-size: 22px;
	font-weight: 900;
	margin-top: 4px;
}
html[data-theme="dark"] .usgp-token-card   { background: #1e2a3a; }
html[data-theme="dark"] .usgp-token-symbol { color: #94a3b8; }
