/**
 * AddonCraft Read More Show Less — branded admin panel styles.
 */

.addoremo-app {
	--addoremo-accent: #4f46e5;
	--addoremo-accent-2: #7c3aed;
	--addoremo-ink: #11171d;
	--addoremo-muted: #667085;
	--addoremo-line: #e6e8ec;
	--addoremo-bg: #f6f7fb;
	--addoremo-card: #fff;
	--addoremo-radius: 14px;
	--addoremo-shadow: 0 6px 24px rgba(17, 23, 29, .06);
	max-width: 1180px;
	margin: 20px 20px 40px 0;
}

/* Hero */
.addoremo-hero {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 24px;
	border-radius: var(--addoremo-radius);
	background: linear-gradient(120deg, var(--addoremo-accent), var(--addoremo-accent-2));
	color: #fff;
	box-shadow: var(--addoremo-shadow);
}

.addoremo-hero__brand { display: flex; align-items: center; gap: 14px; }

.addoremo-hero__icon {
	font-size: 26px;
	width: 46px;
	height: 46px;
	line-height: 46px;
	text-align: center;
	border-radius: 12px;
	background: rgba(255, 255, 255, .18);
}

.addoremo-hero__title { margin: 0; font-size: 19px; line-height: 1.2; color: #fff; font-weight: 700; }
.addoremo-hero__sub { margin: 3px 0 0; font-size: 12.5px; opacity: .9; }

.addoremo-hero__version {
	background: rgba(255, 255, 255, .2);
	padding: 6px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
}

/* Layout */
.addoremo-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 20px;
	margin-top: 16px;
	align-items: start;
}

@media (max-width: 960px) {
	.addoremo-layout { grid-template-columns: 1fr; }
}

/* Tabs */
.addoremo-tabs {
	display: flex;
	gap: 6px;
	background: var(--addoremo-card);
	padding: 5px;
	border-radius: 12px;
	box-shadow: var(--addoremo-shadow);
	margin-bottom: 14px;
	flex-wrap: wrap;
}

.addoremo-tab {
	flex: 1;
	min-width: 110px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 12px;
	border: 0;
	background: transparent;
	color: var(--addoremo-muted);
	font-size: 13px;
	font-weight: 600;
	border-radius: 9px;
	cursor: pointer;
	transition: all .18s ease;
}

.addoremo-tab .dashicons { font-size: 17px; width: 17px; height: 17px; }
.addoremo-tab:hover { color: var(--addoremo-ink); background: var(--addoremo-bg); }

.addoremo-tab.is-active {
	color: #fff;
	background: linear-gradient(120deg, var(--addoremo-accent), var(--addoremo-accent-2));
	box-shadow: 0 4px 12px rgba(79, 70, 229, .3);
}

/* Panels & cards */
.addoremo-panel { display: none; animation: addoremo-fade .25s ease; }
.addoremo-panel.is-active { display: block; }

@keyframes addoremo-fade {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

.addoremo-card {
	background: var(--addoremo-card);
	border: 1px solid var(--addoremo-line);
	border-radius: var(--addoremo-radius);
	box-shadow: var(--addoremo-shadow);
	padding: 4px 24px 12px;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 28px;
}

/* The how-to card is prose, not a field grid. */
.addoremo-card.addoremo-howto { display: block; padding: 8px 26px 16px; }

@media (max-width: 782px) {
	.addoremo-card { grid-template-columns: 1fr; }
}

.addoremo-field { padding: 12px 0; border-bottom: 1px solid var(--addoremo-line); }
.addoremo-field:last-child { border-bottom: 0; }

/* Wide fields span the full row. */
.addoremo-field--full { grid-column: 1 / -1; }

.addoremo-field--inline {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

.addoremo-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--addoremo-ink); margin-bottom: 6px; }
.addoremo-field--inline .addoremo-label { margin-bottom: 2px; }
.addoremo-help { margin: 5px 0 0; font-size: 12px; color: var(--addoremo-muted); line-height: 1.45; }

.addoremo-badge {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 9px;
	border-radius: 999px;
	background: var(--addoremo-bg);
	color: var(--addoremo-accent);
	font-size: 12px;
	font-weight: 700;
	vertical-align: middle;
}

/* Inputs */
.addoremo-input {
	width: 100%;
	max-width: 460px;
	padding: 8px 12px;
	border: 1px solid var(--addoremo-line);
	border-radius: 9px;
	font-size: 13.5px;
	color: var(--addoremo-ink);
	background: #fff;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.addoremo-input:focus {
	border-color: var(--addoremo-accent);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
	outline: none;
}

.addoremo-input--sm { max-width: 240px; }

.addoremo-range { width: 100%; max-width: 460px; accent-color: var(--addoremo-accent); height: 6px; }

/* Segmented control */
.addoremo-segment {
	display: inline-flex;
	background: var(--addoremo-bg);
	border-radius: 10px;
	padding: 4px;
	gap: 4px;
}

.addoremo-segment__item {
	position: relative;
	padding: 8px 18px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--addoremo-muted);
	cursor: pointer;
	transition: all .15s ease;
}

.addoremo-segment__item input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.addoremo-segment__item.is-active { background: #fff; color: var(--addoremo-accent); box-shadow: 0 2px 6px rgba(17, 23, 29, .08); }

/* Toggle switch */
.addoremo-switch { position: relative; display: inline-block; width: 50px; height: 28px; flex-shrink: 0; }
.addoremo-switch input { opacity: 0; width: 0; height: 0; }

.addoremo-switch__slider {
	position: absolute;
	inset: 0;
	background: #cfd4dc;
	border-radius: 999px;
	cursor: pointer;
	transition: background .2s ease;
}

.addoremo-switch__slider::before {
	content: "";
	position: absolute;
	height: 22px;
	width: 22px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
	transition: transform .2s ease;
}

.addoremo-switch input:checked + .addoremo-switch__slider { background: linear-gradient(120deg, var(--addoremo-accent), var(--addoremo-accent-2)); }
.addoremo-switch input:checked + .addoremo-switch__slider::before { transform: translateX(22px); }

/* Media field */
.addoremo-media-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.addoremo-media-preview {
	width: 42px;
	height: 42px;
	border: 1px dashed var(--addoremo-line);
	border-radius: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--addoremo-bg);
	flex-shrink: 0;
}

.addoremo-media-preview img { max-width: 24px; max-height: 24px; }
.addoremo-media-preview .dashicons { color: #b6bcc6; }
.addoremo-media-url { flex: 1; min-width: 180px; max-width: none; }
.addoremo-media-field .button { border-radius: 9px; height: auto; padding: 7px 12px; }
.addoremo-media-clear .dashicons { margin-top: 3px; }

/* How-to */
.addoremo-howto h3 { margin: 18px 0 12px; font-size: 15px; }
.addoremo-howto ol { margin: 0 0 18px 18px; }
.addoremo-howto li { margin-bottom: 14px; font-size: 13.5px; line-height: 1.6; }
.addoremo-howto code {
	display: inline-block;
	margin-top: 6px;
	padding: 8px 12px;
	background: var(--addoremo-bg);
	border-radius: 8px;
	font-size: 12.5px;
	color: var(--addoremo-accent);
	word-break: break-word;
}

/* Save bar */
.addoremo-savebar { position: sticky; bottom: 0; margin-top: 18px; padding: 14px 0; display: flex; justify-content: flex-end; }

.addoremo-save.button-primary {
	background: linear-gradient(120deg, var(--addoremo-accent), var(--addoremo-accent-2)) !important;
	border: 0 !important;
	border-radius: 10px !important;
	padding: 8px 26px !important;
	height: auto !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	box-shadow: 0 6px 16px rgba(79, 70, 229, .3);
	text-shadow: none !important;
}

/* Preview */
.addoremo-side { position: sticky; top: 46px; }

.addoremo-preview-card {
	background: var(--addoremo-card);
	border: 1px solid var(--addoremo-line);
	border-radius: var(--addoremo-radius);
	box-shadow: var(--addoremo-shadow);
	padding: 22px;
}

.addoremo-preview-card__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
	font-size: 14px;
	font-weight: 700;
	color: var(--addoremo-ink);
}

.addoremo-preview-card__title .dashicons { color: var(--addoremo-accent); }
.addoremo-preview { background: var(--addoremo-bg); border-radius: 12px; padding: 18px; }
.addoremo-preview__box { position: relative; }

.addoremo-preview__text {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.6;
	color: #3a424c;
	overflow: hidden;
	max-height: 90px;
	transition: max-height .35s ease;
}

.addoremo-preview__fade {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 50px;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(246, 247, 251, 0), #f6f7fb 92%);
}

.addoremo-preview__actions { margin-top: 12px; }

.addoremo-preview__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	font-weight: 600;
	color: var(--addoremo-accent);
}

.addoremo-preview__arrow {
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform .3s ease;
}

.addoremo-preview__toggle.is-open .addoremo-preview__arrow { transform: rotate(-135deg); }
.addoremo-preview__note { margin-top: 14px; }
