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

/**
 * Rule card
 */
.tsc-rule-card {
	background: $tsc-surface;
	border: 1px solid $tsc-border;
	border-radius: $tsc-radius-lg;

	&__header {
		align-items: center;
		display: flex;
		gap: $tsc-space-3;
		padding: 14px $tsc-space-4;
	}

	&__label {
		cursor: pointer;
	}

	&__title {
		align-items: center;
		color: $tsc-ink;
		display: flex;
		flex: 1;
		flex-wrap: wrap;
		font-size: 14px;
		font-weight: 600;
		gap: 6px;
		line-height: 20px;
		margin: 0;

		.tsc-changed-indicator {
			margin-left: 0;
		}
	}

	&__summary {
		color: $tsc-ink-muted;
		font-size: 12px;
		text-align: right;
	}

	/**
	 * The values start where the title's text does: the header's padding, core's 32 px switch
	 * and the gap after it.
	 */
	&__values {
		display: flex;
		flex-direction: column;
		gap: 14px;
		padding: 0 $tsc-space-4 $tsc-space-4 ($tsc-space-4 + 32px + $tsc-space-3);
	}

	/**
	 * Fields that depend on a checkbox start where its label's text does: core's 16 px
	 * checkbox and the 8 px gap after it.
	 */
	&__dependent {
		display: flex;
		flex-direction: column;
		gap: 14px;
		padding-left: 16px + $tsc-space-2;
	}

	&--without-switch &__values {
		padding-left: $tsc-space-4;
	}

	@media (max-width: $tsc-narrow-breakpoint) {
		&__header {
			flex-wrap: wrap;
			row-gap: 2px;
		}

		// The summary goes under the title, where the title's text starts.
		&__summary {
			flex-basis: 100%;
			padding-left: 32px + $tsc-space-3;
			text-align: left;
		}

		&--without-switch &__summary {
			padding-left: 0;
		}

		&__values {
			padding-left: $tsc-space-4;
		}
	}
}
