@use "../teydea-admin" as *;

/**
 * Help panel, fixed to the right edge under the admin bar
 */
.tsc-help-panel {
	bottom: 8px;
	max-width: 100vw;
	position: fixed;
	right: 8px;
	top: var(--wp-admin--admin-bar--height, 32px);
	width: $tsc-help-panel-width;
	z-index: 99990;

	&__frame {
		background: $tsc-surface;
		border-top-right-radius: var(--wpds-border-radius-xl, 8px);
		border-bottom-right-radius: var(--wpds-border-radius-xl, 8px);
		box-shadow: $tsc-shadow-drawer;
		box-sizing: border-box;
		color: $tsc-ink;
		display: flex;
		flex-direction: column;
		font-size: 13px;
		height: 100%;
		line-height: 20px;
	}

	&__header {
		align-items: center;
		border-bottom: 1px solid $tsc-hairline;
		display: flex;
		justify-content: space-between;
		padding: $tsc-space-4 $tsc-space-4 $tsc-space-4 $tsc-space-6;
	}

	&__title {
		font-size: 16px;
		font-weight: 600;
		line-height: 22px;
		margin: 0;
	}

	&__body {
		flex: 1;
		overflow-y: auto;
		overscroll-behavior: contain;
		padding: $tsc-space-4 $tsc-space-6;
	}

	&__search {
		margin-bottom: $tsc-space-4;
	}

	&__section + &__section {
		border-top: 1px solid $tsc-hairline;
		margin-top: $tsc-space-4;
		padding-top: $tsc-space-4;
	}

	&__section-title {
		@include tsc-overline;

		margin: 0 0 $tsc-space-2;

		&:not(:first-child) {
			margin-top: $tsc-space-4;
		}
	}

	&__links,
	&__plugins {
		list-style: none;
		margin: 0;
		padding: 0;

		li {
			margin: 0;
		}
	}

	&__link {
		align-items: center;
		border-radius: $tsc-radius-md;
		color: $tsc-ink;
		display: flex;
		gap: $tsc-space-3;
		margin: 0 (-$tsc-space-2);
		padding: $tsc-space-2;
		text-decoration: none;

		&:hover,
		&:focus {
			background: $tsc-surface-hover;
			color: $tsc-ink;
		}

		&:focus-visible {
			box-shadow: 0 0 0 2px $tsc-accent;
			outline: 2px solid transparent;
		}

		svg {
			fill: $tsc-ink-muted;
			flex: none;
		}
	}

	&__link-text,
	&__plugin-text {
		display: flex;
		flex: 1;
		flex-direction: column;
		min-width: 0;
	}

	&__link-title,
	&__plugin-name {
		font-weight: 500;
	}

	&__link-description,
	&__plugin-status {
		color: $tsc-ink-muted;
		font-size: 12px;
		line-height: 18px;
	}

	&__plugin-status--error {
		color: $tsc-error;
	}

	&__plugin {
		align-items: flex-start;
		display: flex;
		gap: $tsc-space-3;
		padding: 6px 0;

		.tsc-product-icon {
			flex: none;
			height: 32px;
			width: 32px;
		}
	}

	&__footer {
		border-top: 1px solid $tsc-hairline;
		display: flex;
		flex-direction: column;
		gap: $tsc-space-3;
		padding: $tsc-space-4 $tsc-space-6;
	}

	&__meta {
		color: $tsc-ink-muted;
		font-size: 12px;
		margin: 0;
	}

	&__visually-hidden {
		@include tsc-visually-hidden;
	}

	@media (max-width: $tsc-narrow-breakpoint) {
		width: 100vw;
	}
}
