/**
 * LangRelay Admin Styles
 *
 * Design tokens aligned with langrelay.com (warm ink/stone palette).
 */

/* ------------------------------------------------------------------ */
/* Settings Layout                                                      */
/* ------------------------------------------------------------------ */

.lr-settings-wrap {
	/* Remove default WP wrap top margin on our page */
}

.lr-settings-wrap h1 {
	display: none; /* We render our own header */
}

/* Plugin header bar */
.lr-settings-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	background: #fff;
	border: 1px solid #dedad4;
	border-radius: 8px;
	margin: 20px 0 0;
}

.lr-settings-header__brand {
	display: flex;
	align-items: center;
	gap: 10px;
}

.lr-settings-header__logo svg {
	display: block;
	height: 22px;
	width: auto;
}

.lr-settings-header__meta {
	font-size: 11px;
	color: #9e9890;
	font-weight: 500;
}

.lr-settings-header__actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Shared button styles */
.lr-btn {
	display: inline-flex;
	align-items: center;
	padding: 7px 16px;
	font-size: 13px;
	font-weight: 500;
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	border: 1px solid transparent;
	line-height: 1.4;
}

.lr-btn--outline {
	color: #58534b;
	border-color: #dedad4;
	background: #fff;
}

.lr-btn--outline:hover {
	border-color: #9e9890;
	color: #363532;
}

.lr-btn--primary {
	color: #fffbf6;
	background: #363532;
	border-color: #363532;
	font-weight: 600;
}

.lr-btn--primary:hover {
	background: #2e2a25;
	border-color: #2e2a25;
	color: #fffbf6;
}

.lr-btn--large {
	padding: 10px 24px;
	font-size: 15px;
}

/* Language grid */
.lr-language-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 6px 16px;
}

/* Success notice */
.lr-notice {
	margin: 12px 0 0;
	border-radius: 8px;
	padding: 10px 16px;
}

.lr-notice--success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
}

.lr-notice--success p {
	margin: 0;
	color: #15803d;
	font-size: 13px;
	font-weight: 500;
}

.lr-notice--error {
	background: #fff7f7;
	border: 1px solid #fecaca;
}

.lr-notice--error p {
	margin: 0;
	color: #dc2626;
	font-size: 13px;
	font-weight: 500;
}

/* Two-column settings body */
.lr-settings-body {
	display: flex;
	margin: 12px 0 40px;
	border: 1px solid #dedad4;
	border-radius: 8px;
	overflow: hidden;
	background: #f0eeeb;
	min-height: 600px;
}

/* Left navigation */
.lr-settings-nav {
	width: 220px;
	flex-shrink: 0;
	background: #fff;
	border-right: 1px solid #dedad4;
	display: flex;
	flex-direction: column;
}

.lr-settings-nav__label {
	padding: 18px 20px 8px;
	font-size: 11px;
	font-weight: 600;
	color: #6b655c;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.lr-settings-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.lr-settings-nav__item {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 9px 20px;
	font-size: 13px;
	color: #58534b;
	cursor: pointer;
	border-right: 3px solid transparent;
	transition: background 0.1s;
	user-select: none;
}

.lr-settings-nav__item svg {
	flex-shrink: 0;
	opacity: 0.6;
}

.lr-settings-nav__item:hover {
	background: #faf4e8;
	color: #363532;
}

.lr-settings-nav__item--active {
	background: #faf4e8;
	color: #363532;
	font-weight: 600;
	border-right-color: #363532;
}

.lr-settings-nav__item--active svg {
	opacity: 1;
}

.lr-settings-nav__divider {
	margin: 8px 20px;
	border: 0;
	border-top: 1px solid #dedad4;
}

.lr-settings-nav__item--muted {
	color: #6b655c;
}

.lr-settings-nav__item--muted a {
	color: inherit;
	text-decoration: none;
}

.lr-settings-nav__item--muted:hover {
	color: #58534b;
}

.lr-settings-nav__item--muted:hover a {
	color: #58534b;
}

.lr-settings-nav__status {
	margin-top: auto;
	padding: 14px 20px;
	border-top: 1px solid #dedad4;
}

.lr-nav-status-row {
	display: flex;
	align-items: center;
	gap: 7px;
}

.lr-status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	flex-shrink: 0;
}

.lr-status-dot--green { background: #22c55e; }
.lr-status-dot--gray  { background: #9e9890; }

.lr-nav-status-label {
	font-size: 12px;
	color: #58534b;
}

/* Right content panel */
.lr-settings-content {
	flex: 1;
	min-width: 0;
	background: #f0eeeb;
}

/* Tab panels */
.lr-settings-tab {
	display: none;
	padding: 0 24px 24px;
}

.lr-settings-tab--active {
	display: block;
}

.lr-settings-tab__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 0 18px;
}

.lr-settings-tab__header h2 {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	color: #363532;
	letter-spacing: -0.01em;
}

.lr-settings-tab__header p {
	margin: 3px 0 0;
	font-size: 13px;
	color: #6b655c;
}

/* Status badge */
.lr-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 500;
}

.lr-badge::before {
	content: '';
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
}

.lr-badge--connected {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #15803d;
}

.lr-badge--connected::before { background: #22c55e; }

.lr-badge--disconnected {
	background: #fff7f7;
	border: 1px solid #fecaca;
	color: #dc2626;
}

.lr-badge--disconnected::before { background: #ef4444; }

/* Settings cards */
.lr-settings-card {
	background: #fff;
	border: 1px solid #dedad4;
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 12px;
}

.lr-settings-card:last-of-type {
	margin-bottom: 0;
}

.lr-settings-card__header {
	display: flex;
	align-items: center;
	padding: 11px 20px;
	background: #faf4e8;
	border-bottom: 1px solid #dedad4;
	font-size: 11px;
	font-weight: 700;
	color: #363532;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.lr-settings-card__footer {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 12px 20px;
	border-top: 1px solid #f0eeeb;
	font-size: 12px;
	color: #6b655c;
}

/* Form rows */
.lr-form-row {
	display: flex;
	align-items: flex-start;
	gap: 32px;
	padding: 18px 20px;
	border-bottom: 1px solid #f0eeeb;
}

.lr-form-row--last {
	border-bottom: none;
}

.lr-form-row__label {
	width: 220px;
	flex-shrink: 0;
}

.lr-form-row__title {
	font-size: 13px;
	font-weight: 600;
	color: #363532;
}

.lr-form-row__title .required {
	color: #d63638;
}

.lr-form-row__description {
	font-size: 12px;
	color: #6b655c;
	margin: 4px 0 0;
	line-height: 1.5;
}

.lr-form-row__control {
	flex: 1;
	min-width: 0;
}

.lr-form-row__hint {
	font-size: 11px;
	color: #9e9890;
	margin: 5px 0 0;
}

/* Input styles */
.lr-input-prefixed {
	display: flex;
	align-items: center;
	border: 1px solid #dedad4;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	transition: border-color 0.15s;
}

.lr-input-prefixed:focus-within {
	border-color: #363532;
	box-shadow: 0 0 0 1px #363532;
}

.lr-input-prefix {
	padding: 7px 12px;
	background: #faf4e8;
	border-right: 1px solid #dedad4;
	font-size: 12px;
	font-weight: 600;
	color: #6b655c;
	font-family: monospace;
	flex-shrink: 0;
}

.lr-input-prefixed input[type="text"] {
	flex: 1;
	padding: 7px 10px;
	font-size: 13px;
	color: #363532;
	border: none;
	outline: none;
	box-shadow: none;
	background: transparent;
	min-width: 0;
}

.lr-input-valid {
	padding: 7px 12px;
	font-size: 12px;
	font-weight: 600;
	color: #22c55e;
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.lr-input-full {
	width: 100%;
	padding: 7px 12px;
	font-size: 13px;
	color: #363532;
	border: 1px solid #dedad4;
	border-radius: 8px;
	background: #fff;
	box-sizing: border-box;
}

.lr-input-full:focus {
	border-color: #363532;
	box-shadow: 0 0 0 1px #363532;
	outline: none;
}

.lr-input-small {
	width: 100px;
	padding: 7px 12px;
	font-size: 13px;
	color: #363532;
	border: 1px solid #dedad4;
	border-radius: 8px;
	background: #fff;
	box-sizing: border-box;
}

.lr-input-small:focus {
	border-color: #363532;
	box-shadow: 0 0 0 1px #363532;
	outline: none;
}

.lr-textarea {
	width: 100%;
	padding: 7px 12px;
	font-size: 13px;
	font-family: monospace;
	color: #363532;
	border: 1px solid #dedad4;
	border-radius: 8px;
	background: #fff;
	box-sizing: border-box;
	resize: vertical;
}

.lr-textarea:focus {
	border-color: #363532;
	box-shadow: 0 0 0 1px #363532;
	outline: none;
}

.lr-select {
	padding: 7px 12px;
	font-size: 13px;
	color: #363532;
	border: 1px solid #dedad4;
	border-radius: 8px;
	background: #fff;
}

.lr-select:focus {
	border-color: #363532;
	box-shadow: 0 0 0 1px #363532;
	outline: none;
}

/* Checkbox / toggle label */
.lr-checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #363532;
	cursor: pointer;
}

.lr-checkbox-label + .lr-checkbox-label {
	margin-top: 8px;
}

/* Stats row */
.lr-stats-row {
	display: flex;
	border-bottom: none;
	padding: 0;
}

.lr-stat {
	flex: 1;
	padding: 18px 20px;
	border-right: 1px solid #f0eeeb;
}

.lr-stat:last-child {
	border-right: none;
}

.lr-stat__label {
	font-size: 11px;
	font-weight: 700;
	color: #6b655c;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin-bottom: 4px;
}

.lr-stat__value {
	font-size: 24px;
	font-weight: 700;
	color: #363532;
	letter-spacing: -0.03em;
	line-height: 1.1;
	margin-bottom: 4px;
}

.lr-stat__meta {
	font-size: 12px;
	color: #6b655c;
}

.lr-stat__meta--green {
	color: #22c55e;
	font-weight: 500;
}

/* Language tags (legacy) */
.lr-lang-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.lr-lang-tag {
	display: inline-block;
	padding: 2px 8px;
	background: #f0eeeb;
	border: 1px solid #dedad4;
	border-radius: 6px;
	font-size: 12px;
	color: #58534b;
	font-weight: 500;
}

.lr-lang-tag--source {
	background: #faf4e8;
	border-color: #dedad4;
	color: #4a4742;
}

/* Language pills (flag + name badges) */
.lr-lang-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 4px;
}

.lr-lang-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 10px 3px 6px;
	background: #f0eeeb;
	border: 1px solid #dedad4;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 500;
	color: #58534b;
	line-height: 1.3;
	white-space: nowrap;
}

.lr-lang-pill img {
	border-radius: 50%;
	flex-shrink: 0;
}

.lr-lang-pill--outline {
	background: #fff;
	border-color: #dedad4;
	color: #363532;
}

/* Save bar */
.lr-settings-save-bar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	padding-top: 14px;
}

.lr-settings-save-bar > span {
	font-size: 12px;
	color: #6b655c;
}

.lr-settings-save-bar .button-primary,
.lr-btn-save {
	background: #363532 !important;
	border-color: #363532 !important;
	color: #fffbf6 !important;
	font-weight: 600 !important;
	padding: 6px 20px !important;
	font-size: 13px !important;
	height: auto !important;
	line-height: 1.5 !important;
	border-radius: 8px !important;
}

.lr-settings-save-bar .button-primary:hover,
.lr-btn-save:hover {
	background: #2e2a25 !important;
	border-color: #2e2a25 !important;
	color: #fffbf6 !important;
}

.lr-settings-save-bar .button-primary:focus,
.lr-btn-save:focus {
	box-shadow: 0 0 0 1px #2e2a25, 0 0 0 3px rgba(54,53,50,0.2) !important;
}

/* Action buttons */
.lr-btn-action {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	font-size: 13px;
	font-weight: 500;
	border-radius: 8px;
	cursor: pointer;
	border: 1px solid #dedad4;
	background: #fff;
	color: #58534b;
	transition: border-color 0.15s, background 0.15s;
}

.lr-btn-action:hover {
	border-color: #9e9890;
	background: #faf4e8;
}

.lr-btn-action:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.lr-btn-action--danger {
	color: #d63638;
	border-color: #d63638;
}

.lr-btn-action--danger:hover {
	background: #fff7f7;
}

/* Status inline text */
.lr-status {
	margin-left: 8px;
	font-size: 13px;
}

.lr-status--success { color: #22c55e; font-weight: 500; }
.lr-status--error { color: #dc2626; font-weight: 500; }
.lr-status--checking { color: #6b655c; }

.lr-status a {
	color: inherit;
	text-decoration: underline;
}

/* Button link */
.lr-btn-link {
	background: none;
	border: none;
	padding: 0;
	font-size: 13px;
	color: #6b655c;
	cursor: pointer;
	text-decoration: underline;
	text-decoration-color: transparent;
}

.lr-btn-link:hover {
	color: #58534b;
	text-decoration-color: currentColor;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media screen and (max-width: 960px) {
	.lr-settings-body {
		flex-direction: column;
	}

	.lr-settings-nav {
		width: 100%;
		border-right: none;
		border-bottom: 1px solid #dedad4;
	}

	.lr-settings-nav__list {
		display: flex;
		flex-wrap: wrap;
	}

	.lr-settings-nav__item {
		border-right: none;
		border-bottom: 3px solid transparent;
	}

	.lr-settings-nav__item--active {
		border-bottom-color: #363532;
		border-right-color: transparent;
	}

	.lr-settings-nav__status {
		display: none;
	}

	.lr-form-row {
		flex-direction: column;
		gap: 10px;
	}

	.lr-form-row__label {
		width: auto;
	}

	.lr-stats-row {
		flex-direction: column;
	}

	.lr-stat {
		border-right: none;
		border-bottom: 1px solid #f0eeeb;
	}
}

/* ------------------------------------------------------------------ */
/* Setup Wizard                                                         */
/* ------------------------------------------------------------------ */

.lr-wizard-steps {
	display: flex;
	align-items: center;
	gap: 0;
	padding: 0 0 20px;
}

.lr-wizard-step {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #6b655c;
}

.lr-wizard-step + .lr-wizard-step::before {
	content: '';
	display: block;
	width: 32px;
	height: 1px;
	background: #dedad4;
	margin: 0 12px;
}

.lr-wizard-step__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	font-size: 12px;
	font-weight: 600;
	flex-shrink: 0;
}

.lr-wizard-step--upcoming .lr-wizard-step__number {
	background: #f0eeeb;
	color: #6b655c;
}

.lr-wizard-step--active .lr-wizard-step__number {
	background: #363532;
	color: #fffbf6;
}

.lr-wizard-step--active {
	color: #363532;
	font-weight: 600;
}

.lr-wizard-step--completed {
	cursor: pointer;
}

.lr-wizard-step--completed:hover {
	opacity: 0.8;
}

.lr-wizard-step--completed .lr-wizard-step__number {
	background: #22c55e;
	color: #fff;
}

.lr-wizard-step--completed + .lr-wizard-step::before {
	background: #22c55e;
}

/* Wizard divider */
.lr-wizard-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
	color: #6b655c;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.lr-wizard-divider::before,
.lr-wizard-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #dedad4;
}

/* Wizard error */
.lr-wizard-error {
	background: #fcf0f0;
	border: 1px solid #d63638;
	color: #d63638;
	padding: 10px 16px;
	border-radius: 8px;
	font-size: 13px;
	margin: 12px 20px;
}

/* Project cards */
.lr-project-list,
.lr-project-cards {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.lr-project-card {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 14px 16px;
	border: 1px solid #dedad4;
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}

.lr-project-card:hover {
	border-color: #363532;
	background: #fffbf6;
}

.lr-project-card--selected {
	border-color: #363532;
	background: #faf4e8;
}

.lr-project-card__name {
	font-size: 14px;
	font-weight: 600;
	color: #363532;
}

.lr-project-card__url {
	font-size: 12px;
	color: #6b655c;
}

.lr-project-card__lang {
	font-size: 11px;
	font-weight: 500;
	color: #8a8477;
	margin-top: 2px;
}

.lr-wizard-notice {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.5;
	margin-bottom: 16px;
}

.lr-wizard-notice--warning {
	background: #fef3cd;
	border: 1px solid #f0d78c;
	color: #6b5c00;
}

.lr-wizard-notice--warning svg {
	flex-shrink: 0;
	margin-top: 1px;
	color: #a38700;
}

/* Save bar for wizard */
.lr-settings-save-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
}

/* ------------------------------------------------------------------ */
/* Logs                                                                 */
/* ------------------------------------------------------------------ */

.lr-log-filters {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	flex-wrap: wrap;
}

.lr-log-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.lr-log-table th {
	text-align: left;
	padding: 8px 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	color: #6b655c;
	border-bottom: 1px solid #dedad4;
}

.lr-log-table td {
	padding: 8px 12px;
	border-bottom: 1px solid #f0eeeb;
	vertical-align: top;
}

.lr-log-row[data-has-meta] {
	cursor: pointer;
}

.lr-log-row[data-has-meta]:hover {
	background: #fffbf6;
}

.lr-log-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
}

.lr-log-badge--error {
	background: #fcf0f0;
	color: #d63638;
}

.lr-log-badge--warning {
	background: #fff8e5;
	color: #996800;
}

.lr-log-badge--info {
	background: #faf4e8;
	color: #58534b;
}

.lr-log-meta {
	background: #faf4e8;
	padding: 10px 12px;
	border-radius: 6px;
	font-size: 12px;
	white-space: pre-wrap;
	word-break: break-all;
	max-height: 200px;
	overflow-y: auto;
	margin: 0;
}

.lr-log-loading,
.lr-log-empty {
	padding: 24px;
	text-align: center;
	color: #6b655c;
	font-size: 13px;
}

.lr-log-pagination {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 0;
}

.lr-log-page-info {
	font-size: 13px;
	color: #6b655c;
}
