/**
 * LexiPic — Public Stylesheet
 * All selectors are scoped under .lexipic-wrap to avoid theme conflicts.
 */

/* ── Reset / Base ─────────────────────────────────────────────────────────── */
.lexipic-wrap *,
.lexipic-wrap *::before,
.lexipic-wrap *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

.lexipic-wrap {
	font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	color: #2d3748;
	line-height: 1.5;
	max-width: 600px;
	margin: 0 auto;
	background: #f7fafc;
	border-left:  1px solid #e2e8f0;
	border-right: 1px solid #e2e8f0;
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

/* ── App header ──────────────────────────────────────────────────────────── */
.lp-app-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 15px 20px;
	background: #4a5568;
	color: #fff;
	flex-wrap: wrap;
}

.lp-app-header .lp-title {
	font-size: 1.2rem;
	font-weight: 700;
	white-space: nowrap;
}

/* ── Set bar ─────────────────────────────────────────────────────────────── */
.lp-set-bar {
	display: flex;
	gap: 8px;
	align-items: center;
	flex: 1 1 220px;
	min-width: 0;
}

.lp-set-bar-icon {
	color: #cbd5e0;
	flex: 0 0 auto;
}

.lp-set-bar select {
	flex: 1;
	min-width: 0;
	height: 38px;
	padding: 0 8px;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	font-size: 0.85rem;
	background: #fff;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.lp-tabs {
	display: flex;
	width: 100%;
	background: #fff;
	border-bottom: 2px solid #e2e8f0;
	position: sticky;
	top: 0;
	z-index: 10;
}

.lp-tab-btn {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 12px 8px;
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	color: #718096;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	transition: color 0.15s, border-color 0.15s, background 0.15s;
	white-space: nowrap;
}

.lp-tab-btn:hover {
	color: #4a5568;
	background: #f7fafc;
}

.lp-tab-btn.active {
	color: #4a90e2;
	border-bottom-color: #4a90e2;
}

.lp-tab-btn i {
	font-size: 1rem;
}

/* ── Tab panels ──────────────────────────────────────────────────────────── */
.lp-tab-panels {
	width: 100%;
}

.lp-tab-panel[hidden] {
	display: none;
}

/* ── Panel (sets tab) ────────────────────────────────────────────────────── */
.lp-panel {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 14px;
	margin: 12px 15px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.lp-panel-heading {
	font-size: 0.95rem;
	font-weight: 700;
	color: #4a5568;
	margin-bottom: 2px;
}

.lp-panel-hint {
	font-size: 0.8rem;
	color: #a0aec0;
	margin-bottom: 4px;
}

.lp-panel input[type="text"],
.lp-panel select {
	width: 100%;
	height: 38px;
	padding: 0 10px;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	font-size: 0.85rem;
}

.lp-create-set-panel .lp-save-btn {
	margin-top: 4px;
}

/* ── Data controls ───────────────────────────────────────────────────────── */
.lp-data-controls {
	display: flex;
	gap: 6px;
	padding: 10px 0 6px;
	flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.lp-util-btn {
	flex: 1;
	min-width: 0;
	background: #4a5568;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 8px 6px;
	font-size: 0.75rem;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	transition: background 0.15s;
}

.lp-util-btn:hover:not(:disabled) { background: #2d3748; }
.lp-util-btn:disabled             { opacity: 0.5; cursor: not-allowed; }
.lp-util-btn.lp-danger            { background: #e53e3e; }
.lp-util-btn.lp-danger:hover      { background: #c53030; }

.lp-primary-btn {
	background: #4a90e2;
	color: #fff;
	border: none;
	border-radius: 10px;
	height: 40px;
	font-size: 0.85rem;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	transition: background 0.15s;
}

.lp-primary-btn:hover          { background: #357abd; }
.lp-primary-btn.lp-active-rec { background: #e53e3e; animation: lp-pulse 1s infinite; }

.lp-save-btn {
	width: 100%;
	background: #38a169;
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 14px;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s;
}

.lp-save-btn:hover:not(:disabled)   { background: #276749; }
.lp-save-btn:disabled                { opacity: 0.5; cursor: not-allowed; }

@keyframes lp-pulse {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0.7; }
}

/* ── New entry form ──────────────────────────────────────────────────────── */
.lp-new-entry h4 {
	margin: 10px 0 5px;
	color: #4a5568;
}

.lp-creator-card {
	background: #fff;
	padding: 14px;
	border-radius: 12px;
	box-shadow: 0 4px 10px -3px rgba(0, 0, 0, 0.1);
	margin: 12px 15px 15px;
}

.lp-control-group {
	display: flex;
	gap: 6px;
	margin-bottom: 6px;
	flex-wrap: wrap;
}

.lp-control-group > * {
	flex: 1 1 0;
	min-width: 0;
}

#lp-image-input {
	height: 40px;
	border: 2px solid #e2e8f0;
	border-radius: 10px;
	background: #f8fafc;
	padding: 6px;
	font-size: 0.85rem;
}

.lp-creator-card input[type="text"] {
	display: block;
	width: 100%;
	height: 40px;
	margin: 8px 0;
	padding: 8px 10px;
	border: 2px solid #e2e8f0;
	border-radius: 10px;
	font-size: 0.85rem;
}

.lp-creator-card input[type="text"]:focus {
	outline: none;
	border-color: #4a90e2;
}

#lp-preview-container {
	display: none;
	min-height: 80px;
	background: #f0f0f0;
	border: 2px dashed #ccc;
	border-radius: 8px;
	margin-bottom: 8px;
	overflow: hidden;
}

#lp-preview-container.visible {
	display: block;
}

#lp-preview-container img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 6px;
}

.lp-status {
	font-size: 0.8rem;
	margin: 4px 0;
	min-height: 18px;
}

.lp-status-success { color: #276749; }
.lp-status-error   { color: #c53030; }

/* ── Login notice ─────────────────────────────────────────────────────────── */
.lp-login-notice {
	padding: 16px 20px;
	font-size: 0.9rem;
}

/* ── Archive slider ─────────────────────────────────────────────────────── */
.lp-app-container {
	padding: 10px 20px 20px;
	width: 100%;
	box-sizing: border-box;
}

.lp-slider-wrapper {
	position: relative;
	margin: 10px 0;
	width: 100%;
	overflow: hidden; /* clip the absolute-positioned nav buttons */
}

.lp-slider-container {
	display: flex;
	width: 100%;    /* explicit width so overflow-x:auto actually constrains */
	min-height: 400px;
	overflow-x: auto;
	scroll-behavior: smooth;
	gap: 0;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.lp-slider-container::-webkit-scrollbar {
	display: none;
}

.lp-slider-container:empty::before {
	content: 'No entries yet — add one above.';
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 380px;
	border: 2px dashed #cbd5e0;
	border-radius: 15px;
	color: #a0aec0;
	font-size: 1rem;
	background: #fdfdfd;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.lp-card {
	flex: 0 0 100%;
	min-width: 0;   /* prevent flex item from overriding the flex-basis */
	scroll-snap-align: start;
	background: #fff;
	border-radius: 12px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
}

.lp-card img {
	width: 100%;
	max-width: 100%;
	height: auto;
	max-height: 300px;
	object-fit: contain;
	background-color: #fff;
	border-radius: 8px;
	margin-bottom: 15px;
	display: block;
}

.lp-card img[src=""] {
	display: none;
}

.lp-script-display {
	font-size: 1.2rem;
	text-align: center;
	font-weight: 700;
	background: #f1f5f9;
	padding: 12px;
	border-radius: 8px;
	margin-bottom: 10px;
	line-height: 1.6;
}

.lp-script-display small {
	display: block;
	font-size: 0.85rem;
	font-weight: 400;
	color: #718096;
}

.lp-card-desc {
	font-size: 0.9rem;
	color: #666;
	text-align: center;
	font-style: italic;
	margin-bottom: 15px;
}

.lp-card-actions {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 15px;
	margin-top: auto;
	padding-top: 10px;
}

.lp-play-btn {
	background: #4a90e2;
	color: #fff;
	border: none;
	padding: 10px 20px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 1rem;
	transition: background 0.15s;
}

.lp-play-btn:hover { background: #357abd; }

.lp-delete-btn {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1.2rem;
	color: #a0aec0;
	transition: color 0.15s;
}

.lp-delete-btn:hover { color: #e53e3e; }

/* ── Nav buttons ─────────────────────────────────────────────────────────── */
.lp-nav-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	cursor: pointer;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	transition: background 0.15s;
}

.lp-nav-btn:hover { background: #edf2f7; }
.lp-prev         { left: -10px;  }
.lp-next         { right: -10px; }