/*!
 * Copyright (c) 2015 - 2020 Molkobain.
 *
 * This file is part of licensed extension.
 *
 * Use of this extension is bound by the license you purchased. A license grants you a non-exclusive and non-transferable right to use and incorporate the item in your personal or commercial projects. There are several licenses available (see https://www.molkobain.com/usage-licenses/ for more informations)
 */

/* Panels: Simple panel with an header and a body to display content nicely */

/* Variables */
$mhf-panel-color: #444 !default;
$mhf-panel-bg-color: #ffffff !default;
$mhf-panel-border: 1px solid $mhf-color-grey-400 !default;
$mhf-panel-empty-hint-color: #777 !default;
$mhf-panel-collapse-icon-color: $mhf-color-grey-900 !default;
$mhf-panel-collapsed-height: 50px !default;

/* Classes */
.mhf-panel{
	@extend %mhf-reset-box-sizing;
	position: relative;
	margin-bottom: 48px;

	.mhf-p-header{
		position: relative;
		z-index: 1;
		display: flex;
		align-items: center;
		margin-bottom: 8px;
		padding: 0 4px;
		@include mhf-font-size-14;

		.mhf-ph-icon{
			margin-right: 8px;

			img{
				max-width: 38px;
			}
		}
		.mhf-ph-actions{
			position: absolute;
			right: 0;

			.mhf-ph-toggler{
				color: $mhf-panel-collapse-icon-color;
				cursor: pointer;
				transition-property: transform;
				transition-duration: 0.2s;
				transition-timing-function: linear;
			}
		}
	}
	.mhf-p-body{
		position: relative;
		/*z-index: 0;*/ /* Must be below header */
		margin-top: 0;
		padding: 10px;
		background-color: $mhf-panel-bg-color;
		border: $mhf-panel-border;
		@include mhf-border-radius-300;
		transition: all 0.2s ease-in-out;

		&:empty{
			display: flex;
			justify-content: center;
			align-items: center;

			&::after{
				content: attr(data-empty-text);
				color: $mhf-panel-empty-hint-color;
				font-style: italic;
			}
		}
	}

	&:last-child{
		margin-bottom: 0;
	}
	&.mhf-collapsed{
		.mhf-ph-toggler{
			transform: rotateZ(90deg);
		}
		.mhf-p-body{
			margin-top: -$mhf-panel-collapsed-height;
			min-height: $mhf-panel-collapsed-height !important;
			max-height: $mhf-panel-collapsed-height !important;

			> *{
				display: none;
			}

			&:empty{
				&::after{
					content: "";
				}
			}
		}
	}
}