/* =============================================================================
   UC Bookmarks — front-end styles
   ============================================================================= */

/* ---- Bookmark button -------------------------------------------------------- */

.ucb-wrap {
	display: inline-block;
	position: relative;
}

.ucb-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	font-size: 14px;
	font-weight: 600;
	border: 2px solid #d1d5db;
	border-radius: 6px;
	background: #fff;
	color: #374151;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	-webkit-tap-highlight-color: transparent;
	box-shadow: none;
}

.ucb-btn:hover {
	border-color: #9ca3af;
	background: #f3f4f6;
}

.ucb-btn:focus,
.ucb-btn:active {
	outline: none;
	box-shadow: none;
}

.ucb-btn--active,
.ucb-btn--active:hover {
	background: var(--global-palette1, #2B6CB0);
	border-color: var(--global-palette1, #2B6CB0);
	color: #fff;
}

/* Show/hide the right icon based on state */
.ucb-btn .ucb-btn__icon--saved   { display: none; }
.ucb-btn .ucb-btn__icon--unsaved { display: flex; }
.ucb-btn--active .ucb-btn__icon--saved   { display: flex; }
.ucb-btn--active .ucb-btn__icon--unsaved { display: none; }

/* ---- "Move to list" link (shown after saving) ------------------------------ */
.ucb-change-list {
	display: inline-block;
	margin-left: 8px;
	font-size: 12px;
	color: var(--global-palette1, #2B6CB0);
	text-decoration: underline;
	cursor: pointer;
	vertical-align: middle;
}

.ucb-change-list:hover {
	opacity: 0.8;
}

/* ---- List picker dropdown -------------------------------------------------- */

.ucb-list-picker {
	/* Base styles — position overridden to fixed by JS when opened */
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 999999;
	background: #fff;
	border: 2px solid #d1d5db;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.15);
	min-width: 200px;
	padding: 12px;
}

.ucb-list-picker[hidden] { display: none; }

.ucb-list-picker__label {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6b7280;
	margin: 0 0 8px;
}

.ucb-list-picker__options {
	display: flex;
	flex-direction: column;
	gap: 3px;
	margin-bottom: 8px;
	/* Cap at 5 visible items, scroll for more */
	max-height: 215px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.ucb-list-picker__option {
	display: block;
	width: 100%;
	padding: 5px 10px;
	text-align: left;
	font-size: 13px;
	font-weight: 500;
	color: #1d2327;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 5px;
	cursor: pointer;
	transition: background 0.12s, border-color 0.12s;
}

.ucb-list-picker__option:hover {
	background: var(--global-palette1, #2B6CB0);
	border-color: var(--global-palette1, #2B6CB0);
	color: #fff;
}

.ucb-list-picker__new {
	display: block;
	width: 100%;
	padding: 6px 10px;
	text-align: left;
	font-size: 13px;
	color: var(--global-palette1, #2B6CB0);
	background: none;
	border: 1px dashed #d1d5db;
	border-radius: 5px;
	cursor: pointer;
}

.ucb-list-picker__new:hover {
	border-color: var(--global-palette1, #2B6CB0);
	background: #eff6ff;
}

/* ---- My Account page ------------------------------------------------------- */

#ucb-account {
	font-size: 15px;
}

/* List tabs */
.ucb-lists-header {
	margin-bottom: 20px;
}

.ucb-list-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.ucb-list-tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	font-size: 14px;
	font-weight: 600;
	border: 2px solid #d1d5db;
	border-radius: 20px;
	background: #f9fafb;
	color: #374151;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ucb-list-tab:hover {
	border-color: #9ca3af;
	background: #f3f4f6;
}

.ucb-list-tab.is-active {
	background: var(--global-palette1, #2B6CB0);
	border-color: var(--global-palette1, #2B6CB0);
	color: #fff;
}

.ucb-list-tab__count {
	font-size: 11px;
	opacity: 0.7;
	font-weight: 400;
}

.ucb-tab-all {
	font-style: italic;
}

.ucb-manage-lists-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 12px;
	font-size: 13px;
	color: #6b7280;
	background: none;
	border: none;
	cursor: pointer;
	text-decoration: none;
	border-radius: 20px;
	transition: color 0.15s, background 0.15s;
	margin-left: 6px;
}

.ucb-manage-lists-link:hover {
	color: #374151;
	background: #f3f4f6;
}

/* Manage Lists view */
.ucb-manage-view {
	margin-top: 4px;
}

.ucb-manage-view[hidden] { display: none; }

.ucb-manage-view__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.ucb-manage-view__header h2 {
	margin: 0;
	font-size: 18px;
}

.ucb-manage-table {
	width: 100%;
	border-collapse: collapse;
}

.ucb-manage-table th {
	text-align: left;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6b7280;
	padding: 8px 12px;
	border-bottom: 2px solid #e5e7eb;
}

.ucb-manage-table td {
	padding: 10px 12px;
	border-bottom: 1px solid #f3f4f6;
	vertical-align: middle;
	font-size: 14px;
}

.ucb-manage-table tr:last-child td {
	border-bottom: none;
}

.ucb-manage-table tr:hover td {
	background: #f9fafb;
}

.ucb-manage__rename,
.ucb-manage__delete {
	padding: 4px 10px;
	font-size: 12px;
	border-radius: 4px;
	cursor: pointer;
	border: 1px solid #d1d5db;
	background: #f9fafb;
	color: #374151;
	margin-right: 4px;
}

.ucb-manage__rename:hover {
	background: #e5e7eb;
}

.ucb-manage__delete:hover {
	background: #fee2e2;
	border-color: #ef4444;
	color: #7f1d1d;
}

.ucb-manage__default-badge {
	display: inline-block;
	font-size: 11px;
	padding: 2px 7px;
	background: #e5e7eb;
	color: #6b7280;
	border-radius: 10px;
	margin-left: 6px;
}

.ucb-list-new {
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 600;
	border: 2px dashed #d1d5db;
	border-radius: 20px;
	background: none;
	color: var(--global-palette1, #2B6CB0);
	cursor: pointer;
	transition: border-color 0.15s;
}

.ucb-list-new:hover {
	border-color: var(--global-palette1, #2B6CB0);
	background: #eff6ff;
}

/* Bookmark items list */
.ucb-bookmarks-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ucb-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
	transition: box-shadow 0.15s;
}

.ucb-item:hover {
	box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.ucb-item.sortable-ghost {
	opacity: 0.4;
}

.ucb-item.sortable-chosen {
	box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.ucb-item__drag {
	color: #9ca3af;
	cursor: grab;
	font-size: 20px;
	line-height: 1;
	padding-top: 2px;
	flex-shrink: 0;
	user-select: none;
}

.ucb-item__drag:active {
	cursor: grabbing;
}

.ucb-item__thumb {
	flex-shrink: 0;
	width: 80px;
	height: 60px;
	overflow: hidden;
	border-radius: 5px;
	display: block;
	background: #f3f4f6;
}

.ucb-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ucb-item__body {
	flex: 1;
	min-width: 0;
}

.ucb-item__title {
	display: block;
	font-weight: 700;
	font-size: 15px;
	color: var(--global-palette3, #1a202c);
	text-decoration: none;
	margin-bottom: 5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ucb-item__title:hover {
	color: var(--global-palette1, #2B6CB0);
}


.ucb-item__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 8px;
}

/* Reuse search badge styles */
.ucb-item__badges .uc-tax-badge {
	font-size: 11px;
}

/* Note */
.ucb-item__note {
	width: 100%;
	padding: 6px 8px;
	font-size: 13px;
	border: 1px solid #d1d5db;
	border-radius: 5px;
	resize: vertical;
	background: #f9fafb;
	color: #374151;
	transition: border-color 0.15s, background 0.15s;
	box-sizing: border-box;
}

.ucb-item__note:focus {
	outline: none;
	border-color: var(--global-palette1, #2B6CB0);
	background: #fff;
}

.ucb-item__note-actions {
	display: flex;
	gap: 6px;
	margin-top: 6px;
}

.ucb-item__note-actions[hidden] { display: none; }

/* Move picker */
.ucb-item__move-wrap {
	position: relative;
}

.ucb-move-picker {
	position: absolute;
	right: 0;
	top: calc(100% + 4px);
	z-index: 100;
	background: #fff;
	border: 2px solid #d1d5db;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.12);
	min-width: 160px;
	padding: 8px;
}

.ucb-move-picker[hidden] { display: none; }

.ucb-move-picker__opts {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.ucb-move-picker__opt {
	display: block;
	width: 100%;
	padding: 8px 12px;
	text-align: left;
	font-size: 14px;
	font-weight: 500;
	color: #1d2327;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 5px;
	cursor: pointer;
	transition: background 0.12s, border-color 0.12s;
}

.ucb-move-picker__opt:hover {
	background: var(--global-palette1, #2B6CB0);
	border-color: var(--global-palette1, #2B6CB0);
	color: #fff;
}

.ucb-move-picker__empty {
	font-size: 13px;
	color: #6b7280;
	margin: 2px 0;
	padding: 4px;
}

/* Item action buttons */
.ucb-item__actions {
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex-shrink: 0;
}

.ucb-item__move,
.ucb-item__remove {
	font-size: 12px;
	padding: 4px 10px;
	border-radius: 4px;
	cursor: pointer;
	border: 1px solid #d1d5db;
	background: #f9fafb;
	color: #374151;
	transition: background 0.1s, border-color 0.1s;
}

.ucb-item__move:hover {
	background: #e5e7eb;
}

.ucb-item__remove:hover {
	background: #fee2e2;
	border-color: #ef4444;
	color: #7f1d1d;
}

/* Empty / loading states */
.ucb-bookmarks-empty,
.ucb-bookmarks-loading {
	padding: 30px;
	text-align: center;
	color: #6b7280;
	font-size: 14px;
}

.ucb-bookmarks-loading[hidden],
.ucb-bookmarks-empty[hidden] { display: none; }

/* Shared button styles */
.ucb-btn-primary {
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 600;
	background: var(--global-palette1, #2B6CB0);
	color: #fff;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	transition: background 0.15s;
}

.ucb-btn-primary:hover {
	background: var(--global-palette2, #215387);
}

.ucb-btn-secondary {
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 600;
	background: #f3f4f6;
	color: #374151;
	border: 1px solid #d1d5db;
	border-radius: 5px;
	cursor: pointer;
}

.ucb-btn-secondary:hover {
	background: #e5e7eb;
}

/* Modal */
.ucb-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ucb-modal[hidden] { display: none; }

.ucb-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.5);
	backdrop-filter: blur(3px);
}

.ucb-modal__box {
	position: relative;
	background: #fff;
	border-radius: 10px;
	padding: 24px;
	min-width: 300px;
	max-width: 90vw;
	box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.ucb-modal__title {
	margin: 0 0 14px;
	font-size: 18px;
}

.ucb-modal__input {
	display: block;
	width: 100%;
	padding: 8px 12px;
	font-size: 14px;
	border: 2px solid #d1d5db;
	border-radius: 6px;
	margin-bottom: 14px;
	box-sizing: border-box;
}

.ucb-modal__input:focus {
	outline: none;
	border-color: var(--global-palette1, #2B6CB0);
}

.ucb-modal__actions {
	display: flex;
	gap: 8px;
}

/* Responsive */
@media (max-width: 600px) {
	.ucb-item__thumb { width: 60px; height: 45px; }
	.ucb-item__drag  { display: none; }
	.ucb-item__actions { flex-direction: row; }
}
