/**
 * Like Dislike admin screens: Settings, Stats, the list column and the post box.
 */

.ldfw-settings,
.ldfw-stats-screen {
	--ldfw-accent: var(--wp-admin-theme-color, #2271b1);
	max-width: 1180px;
}

/* Header */

.ldfw-header {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 22px 0 18px;
}

.ldfw-header img {
	flex: none;
	border-radius: 11px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.ldfw-header h1 {
	margin: 0;
	padding: 0;
	font-size: 23px;
	font-weight: 600;
	line-height: 1.25;
}

.ldfw-header p {
	margin: 2px 0 0;
	color: #646970;
}

.ldfw-header-links {
	display: flex;
	gap: 8px;
	margin-left: auto;
}

/* Layout and cards */

.ldfw-settings-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 20px;
	align-items: start;
}

.ldfw-settings-side {
	position: sticky;
	top: 46px;
}

.ldfw-card {
	margin: 0 0 20px;
	padding: 20px 24px;
	border: 1px solid #dcdcde;
	border-radius: 10px;
	background: #fff;
}

.ldfw-card h2 {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 600;
}

.ldfw-card-intro {
	max-width: 640px;
	margin: 0 0 16px;
	color: #646970;
}

.ldfw-note {
	margin: 12px 0 0;
}

/* Switches */

.ldfw-toggles {
	display: grid;
	gap: 18px;
	margin: 14px 0 0;
}

.ldfw-toggle {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
}

.ldfw-toggle input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.ldfw-toggle-track {
	position: relative;
	flex: none;
	width: 36px;
	height: 20px;
	margin-top: 1px;
	border-radius: 10px;
	background: #c3c4c7;
	transition: background-color 0.15s ease;
}

.ldfw-toggle-track::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}

.ldfw-toggle input:checked + .ldfw-toggle-track {
	background: var(--ldfw-accent);
}

.ldfw-toggle input:checked + .ldfw-toggle-track::after {
	transform: translateX(16px);
}

.ldfw-toggle input:focus-visible + .ldfw-toggle-track {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ldfw-accent);
}

.ldfw-toggle-text strong {
	display: block;
	margin-bottom: 2px;
	font-size: 14px;
	font-weight: 600;
}

.ldfw-toggle-text span {
	display: block;
	max-width: 620px;
	color: #646970;
}

/* Post types */

.ldfw-post-types,
.ldfw-choices {
	margin: 18px 0 0;
	padding: 0;
	border: 0;
}

.ldfw-post-types legend,
.ldfw-choices legend {
	margin-bottom: 8px;
	padding: 0;
	color: #1d2327;
	font-size: 14px;
	font-weight: 600;
}

.ldfw-post-types label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 18px 8px 0;
}

/* Choices shown as cards */

.ldfw-choice-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.ldfw-choice {
	position: relative;
	cursor: pointer;
}

.ldfw-choice input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.ldfw-choice-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 92px;
	min-height: 40px;
	padding: 12px 14px;
	border: 1px solid #dcdcde;
	border-radius: 10px;
	background: #fff;
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.is-compact .ldfw-choice-box {
	flex-direction: row;
	min-width: 0;
	padding: 9px 14px;
}

.ldfw-choice:hover .ldfw-choice-box {
	border-color: #8c8f94;
}

.ldfw-choice input:checked + .ldfw-choice-box {
	border-color: var(--ldfw-accent);
	box-shadow: 0 0 0 1px var(--ldfw-accent);
}

.ldfw-choice input:focus-visible + .ldfw-choice-box {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ldfw-accent);
}

.ldfw-choice-label {
	font-weight: 500;
}

.ldfw-choice-icons {
	display: inline-flex;
	gap: 8px;
	color: #1d2327;
}

.ldfw-choice-icons .ldfw-icon {
	width: 22px;
	height: 22px;
}

.ldfw-choice-text {
	font-size: 17px;
	font-weight: 600;
	line-height: 22px;
}

.ldfw-style-sample {
	display: block;
	width: 58px;
	height: 22px;
	border: 1.5px solid #8c8f94;
	border-radius: 11px;
	background: #f0f0f1;
	box-sizing: border-box;
}

.ldfw-style-sample.is-outline {
	border-radius: 5px;
	background: #fff;
}

.ldfw-style-sample.is-minimal {
	border-color: transparent;
	background: linear-gradient(90deg, #8c8f94 0 18px, transparent 18px 26px, #c3c4c7 26px 40px, transparent 40px);
	background-position: center;
	background-repeat: no-repeat;
	background-size: 100% 6px;
}

/* Presets and fields */

.ldfw-presets {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 10px 0 4px;
	color: #646970;
}

.ldfw-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px 18px;
	margin: 18px 0 0;
}

.ldfw-field {
	display: grid;
	gap: 6px;
}

.ldfw-field > span {
	font-weight: 600;
}

.ldfw-field.is-wide {
	grid-column: 1 / -1;
}

.ldfw-field input[type="text"],
.ldfw-field select {
	width: 100%;
	max-width: none;
}

.ldfw-field.is-color input {
	width: 64px;
	height: 34px;
	padding: 2px;
	border: 1px solid #8c8f94;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
}

.ldfw-settings .submit {
	margin-top: 0;
	padding-top: 0;
}

/* Preview */

.ldfw-preview-page {
	padding: 14px;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	background: #fcfcfc;
	color: #1d2327;
}

.ldfw-preview-line {
	display: block;
	height: 8px;
	margin: 0 0 8px;
	border-radius: 4px;
	background: #e6e6e6;
}

.ldfw-preview-line.is-short {
	width: 62%;
}

.ldfw-preview-page .ldfw {
	margin: 16px 0 0;
}

/* Sidebar: review and promos */

.ldfw-review .ldfw-stars {
	color: #f5a300;
	letter-spacing: 1px;
}

.ldfw-review .button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.ldfw-review p {
	color: #50575e;
}

.ldfw-support {
	margin: 12px 0 0;
}

.ldfw-promo h3 {
	margin: 18px 0 8px;
	font-size: 13px;
	font-weight: 600;
}

.ldfw-promo-featured {
	display: grid;
	gap: 8px;
	margin: 12px 0 0;
	padding: 14px;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	color: inherit;
	text-decoration: none;
}

.ldfw-promo-featured:hover,
.ldfw-promo-featured:focus {
	border-color: var(--ldfw-accent);
	color: inherit;
}

.ldfw-promo-head {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ldfw-promo-head img,
.ldfw-promo-list img {
	flex: none;
	border-radius: 8px;
}

.ldfw-promo-name {
	display: block;
	color: #1d2327;
	font-weight: 600;
}

.ldfw-promo-tagline {
	display: block;
	color: #646970;
	font-size: 12px;
}

.ldfw-promo-description {
	color: #50575e;
}

.ldfw-promo-cta {
	color: var(--ldfw-accent);
	font-weight: 600;
}

.ldfw-promo-list {
	margin: 0;
}

.ldfw-promo-list li {
	margin: 0;
}

.ldfw-promo-list a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	border-radius: 8px;
	color: inherit;
	text-decoration: none;
}

.ldfw-promo-list a:hover,
.ldfw-promo-list a:focus {
	background: #f6f7f7;
	color: inherit;
}

/* Stats */

.ldfw-periods {
	display: inline-flex;
	gap: 2px;
	margin: 0 0 18px;
	padding: 3px;
	border-radius: 9px;
	background: #e7e7e8;
}

.ldfw-periods a {
	padding: 6px 14px;
	border-radius: 7px;
	color: #50575e;
	font-weight: 500;
	text-decoration: none;
}

.ldfw-periods a:hover {
	color: #1d2327;
}

.ldfw-periods a.is-current {
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
	color: #1d2327;
}

.ldfw-stat-cards {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin: 0 0 20px;
}

.ldfw-stat {
	display: grid;
	gap: 4px;
	padding: 18px 20px;
	border: 1px solid #dcdcde;
	border-radius: 10px;
	background: #fff;
}

.ldfw-stat span {
	color: #646970;
	font-weight: 500;
}

.ldfw-stat strong {
	font-size: 28px;
	font-weight: 600;
	line-height: 1.15;
	font-variant-numeric: tabular-nums;
}

.ldfw-stat.is-like strong {
	color: var(--ldfw-like, #2563eb);
}

.ldfw-stat.is-dislike strong {
	color: var(--ldfw-dislike, #dc2626);
}

.ldfw-chart {
	display: flex;
	align-items: flex-end;
	gap: 4px;
	height: 160px;
	padding: 0 2px;
}

.ldfw-bar {
	display: flex;
	flex: 1 1 0;
	flex-direction: column-reverse;
	justify-content: flex-start;
	max-width: 36px;
	height: 100%;
	overflow: hidden;
	border-radius: 4px 4px 2px 2px;
	background: #f3f4f5;
}

.ldfw-bar-like {
	background: var(--ldfw-like, #2563eb);
}

.ldfw-bar-dislike {
	background: var(--ldfw-dislike, #dc2626);
}

.ldfw-legend {
	display: flex;
	gap: 16px;
	margin: 0 0 12px;
	color: #50575e;
}

.ldfw-legend span::before {
	content: "";
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 6px;
	border-radius: 3px;
	background: var(--ldfw-like, #2563eb);
}

.ldfw-legend .is-dislike::before {
	background: var(--ldfw-dislike, #dc2626);
}

.ldfw-columns {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.ldfw-top {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: ldfw-top;
}

.ldfw-top li {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 10px 0;
	border-top: 1px solid #f0f0f1;
	counter-increment: ldfw-top;
}

.ldfw-top li::before {
	content: counter(ldfw-top);
	flex: none;
	width: 22px;
	color: #8c8f94;
	font-weight: 600;
	text-align: right;
}

.ldfw-top-title {
	display: grid;
	flex: 1;
	min-width: 0;
}

.ldfw-top-title a {
	overflow: hidden;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.ldfw-top-type {
	color: #8c8f94;
	font-size: 12px;
}

.ldfw-top-counts {
	display: flex;
	flex: none;
	align-items: center;
	gap: 12px;
	font-variant-numeric: tabular-nums;
}

.ldfw-top-counts > span,
.ldfw-col > span,
.ldfw-box-counts > span {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-weight: 600;
}

.ldfw-top-counts .ldfw-icon,
.ldfw-col .ldfw-icon,
.ldfw-box-counts .ldfw-icon {
	width: 16px;
	height: 16px;
}

.ldfw-top-counts .is-like,
.ldfw-col .is-like,
.ldfw-box-counts .is-like {
	color: var(--ldfw-like, #2563eb);
}

.ldfw-top-counts .is-dislike,
.ldfw-col .is-dislike,
.ldfw-box-counts .is-dislike {
	color: var(--ldfw-dislike, #dc2626);
}

.ldfw-meter {
	display: block;
	width: 64px;
	height: 6px;
	overflow: hidden;
	border-radius: 3px;
	background: #f6c9c9;
}

.ldfw-meter span {
	display: block;
	height: 100%;
	background: var(--ldfw-like, #2563eb);
}

.ldfw-empty {
	margin: 12px 0 0;
	color: #646970;
}

.ldfw-feedback-list {
	margin: 12px 0 0;
}

.ldfw-feedback-list li {
	margin: 0;
	padding: 12px 0;
	border-top: 1px solid #f0f0f1;
}

.ldfw-feedback-list blockquote {
	margin: 0 0 6px;
	padding: 2px 0 2px 12px;
	border-left: 3px solid var(--ldfw-dislike, #dc2626);
	font-size: 14px;
}

.ldfw-feedback-list p {
	margin: 0;
	color: #646970;
}

/* List column and post box */

.column-ldfw_likes {
	width: 8.5em;
}

.ldfw-col {
	display: inline-flex;
	gap: 10px;
}

.ldfw-box-counts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin-top: 4px;
}

.ldfw-reset {
	color: #b32d2e;
}

.ldfw-reset:hover,
.ldfw-reset:focus {
	color: #8a2424;
}

@media (max-width: 1100px) {
	.ldfw-settings-layout,
	.ldfw-columns {
		grid-template-columns: minmax(0, 1fr);
	}

	.ldfw-settings-side {
		position: static;
	}

	.ldfw-stat-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.ldfw-header {
		flex-wrap: wrap;
	}

	.ldfw-header-links {
		margin-left: 0;
	}

	.ldfw-fields {
		grid-template-columns: minmax(0, 1fr);
	}
}
