/**
 *
 * @ai-apps/angular v2.152.0 | _legend.scss
 *
 * Copyright 2014, 2023 IBM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


div.#{$prefix}--#{$charts-prefix}--legend {
	display: flex;
	user-select: none;
	-webkit-flex-wrap: wrap;
	flex-wrap: wrap;

	&[data-name='legend-items'] {
		width: 100%;
		margin: -5px;
	}

	div.legend-item {
		display: flex;
		align-items: center;
		margin: 5px;

		div.checkbox {
			width: 13px;
			height: 13px;
			margin-right: 4px;
			border-radius: 2px;
			border: solid 1px $ui-background;
			box-shadow: 0 0 0 2px transparent;

			@media (forced-colors: active) {
				forced-color-adjust: none;
			}

			&:not(.active) {
				border-color: $text-02;
				background: $ui-background;
			}

			svg {
				display: none;
				vertical-align: text-top;
				fill: $ui-background;
				stroke: $ui-background;
			}
		}

		&.additional {
			svg.icon {
				margin-right: 4px;
			}
		}

		p {
			font-size: 12px;
			fill: $text-02;
			line-height: 1rem;
		}
	}

	&.center-aligned {
		justify-content: center;
	}

	&.right-aligned {
		justify-content: flex-end;
	}

	&.has-deactivated-items {
		div.legend-item {
			div.checkbox {
				svg {
					display: block;
				}
			}
		}
	}

	&.vertical {
		margin: -5px;
		flex-direction: column;

		div.legend-item {
			margin-right: 0;
			margin-bottom: 10px;
		}
	}

	&.clickable div.legend-item:not(.additional):hover {
		cursor: pointer;

		div.checkbox {
			border: solid 1px $ui-background;
			box-shadow: 0 0 0 2px $carbon--blue-60;

			&:not(.active) {
				border-color: $text-02;
			}
		}
	}
}
