/* ------------ Estils dels modals ------------ */

.modalOuter {

	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;

	display: flex;
	align-items: center;
	justify-content: center;

	background-color: rgba(0,0,0,0.5);

	animation-name: modalOuterEnter;
	animation-duration: 0.25s;

	z-index: 250;

}

.modalOuter.modalError {
	background-color: rgba(60,0,0,0.5);

	animation-name: modalErrorEnter;
	animation-duration: 0.75s;
}

.modalOuter.modalWarning {
	background-color: rgba(60,30,0,0.5);

	animation-name: modalWarningEnter;
	animation-duration: 0.75s;
}

.modalOuter.modalImmersive {
	background-color: rgba(0,0,0,0.9);
	animation-name: modalImmersiveEnter;
}

.modalInner {

	display: flex;
	flex-direction: column;

	width: 550px;
	max-width: 95%;
	max-height: 95%;

	/* Per solucionar les vores blanques de la barra superior */
	background-image: linear-gradient(180deg, var(--color-base) 15px, var(--background-color) 15px);

	border-radius: 10px;
	overflow-x: hidden;

	border: solid 2px var(--color-base);

	box-shadow: 0 0 20px rgba(0,0,0,0.5);

	animation-name: modalInnerEnter;
	animation-duration: 0.25s;

	position: relative;

}

.modalErorr .modalInner, .modalWarning .modalInner, .modalImmersive .modalInner {
	border-radius: 0;
}

.modalError .modalInner {
	border-color: darkred;
}

.modalWarning .modalInner {
	border-color: darkgoldenrod;
}

.modalImmersive .modalInner {
	box-shadow: none;
	color: var(--text-color-dark);
}

@media (prefers-reduced-motion: reduce) {

	.modalOuter, .modalInner {
		animation: none !important;
	}

}


.modalImmersive .modalInner,
.modalMenu .modalInner {
	background-image: unset;
	border: none;
}

.modalImmersive .modalInner {
	background: none;
	/*text-shadow: 0 0 4px rgba(0,0,0,0.75);*/
}

.modalMenu .modalInner {
	width: unset;
	min-width: 200px;
	background-color: var(--color-dark);
}


.modalInner .modalTitle {

	display: flex;
	align-items: center;

	background-color: var(--color-base);
	color: white;
	font-weight: bold;

	/* padding: 5px 30px 5px 10px; */
	padding: 5px;

	min-height: 28px;
	width: 100%;
	box-sizing: border-box;

}

.modalImmersive .modalInner .modalTitle,
.modalMenu .modalInner .modalTitle {
	justify-content: center;
	padding: 5px 10px;
	min-height: unset;
}

.modalImmersive .modalInner .modalTitle {
	/*margin-bottom: 0.5em;*/
	background: none;
}

.modalMenu .modalInner .modalTitle {
	font-size: 0.75em;
	background-color: var(--color-dark);
}


.modalInner .modalTitle .modalTitleIcon {
	font-weight: normal !important;
	margin-right: 0.3em;
}

.modalError .modalInner .modalTitle {
	background-color: darkred;
}

.modalWarning .modalInner .modalTitle {
	background-color: darkgoldenrod;
}

.modalInner .modalClose {

	background-color: var(--color-darker);
	color: white;

	position: absolute;
	top: 3px;
	right: 3px;

	display: flex;
	align-content: center;
	justify-content: center;

	height: 20px;
	width: 20px;
	border-radius: 5px;

}

.modalError .modalInner .modalClose {

	background-color: red;

}

.modalWarning .modalInner .modalClose {

	background-color: orange;

}


.modalInner .modalClose:hover, .modalInner .modalClose:active {

	/*filter: brightness(1.2);*/
	background-color: #bb0000;
	cursor: pointer;

}

/*.modalInner .modalClose:active {

	border-radius: 100%;

}*/

.modalInner .modalClose:active:after {

	font-size: 25px;

}


.modalInner .modalClose:after {
	/*content: 'x';*/
	content: '+';
	line-height: 20px;
	font-size:   20px;
	transform: rotate(45deg);
}

.modalInner .modalContent {
	padding: 16px 10px 10px 10px;
	word-break: break-word;
	overflow-y: auto;
}

.modalInner .modalContent > *:first-child,
.modalInner .modalContent > *:first-child > *:first-child,
.modalInner .modalContent > *:first-child > *:first-child > *:first-child {
	margin-top: 0;
}

.modalInner .modalContent > *:last-child {
	margin-bottom: 0;
}

.modalInner .modalContent .p {
	padding-left: 0;
	padding-right: 0;
}

.modalMenu .modalInner .modalContent {
	padding: 0;
}

/* Enlarges the width of the top border for the first button in each group to act as a separator of the same color */
.modalMenu .modalContent > div:not(:first-child) > button:first-child {
	border-top-width: 0.5em;
}
.modalOuter.modalMenu .button_label {
    text-align: var(--language-align);
}

.modalInner p {

	/*padding: 0 10px;
	margin:  10px 0;*/
	word-break: break-word;

}

.modalContent:empty {
	display: none;
}

.modalInner .modalBottomButtons {

	display: flex;

	padding: 10px;

	justify-content: space-evenly;

	width: 100%;
	box-sizing: border-box;

}

.modalInner .modalInput, .modalInner .modalInputDatalistLeft, .modalInner .modalInputDatalistRight {
	box-sizing: border-box;
}
.modalInner .modalInput {
	width: 100%;
}
.modalInner .modalInputDatalistLeft {
	width: 30%;
}
.modalInner .modalInputDatalistRight {
	width: 70%;
}

.modalChangelogVersionContainer {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 1em;
}
.modalChangelogVersionContainer .version_number, .modalChangelogVersionContainer .version_date {
	font-weight: bold;
	color: var(--color-base);
}
.modalChangelogVersionContainer .version_number {
	font-size: 1.75em;
}
.modalChangelogVersionContainer .version_date {
	font-size: 1.25em;
}
.modalChangelogVersionContainer .version_switch{
	display: flex;
	align-items: flex-start;
	justify-content: center;
	margin-top: 0.5em;
	gap: 0;
}

html.hasModals {
	overflow-y: hidden;
	padding-right: var(--scrollbar-width);
}

/* ------------ Animacions ------------ */

@keyframes modalOuterEnter {
	from { background-color: rgba(0,0,0,0);   }
	to   { background-color: rgba(0,0,0,0.5); }
}

@keyframes modalErrorEnter {
	0%   { background-color: rgba(60,0,0,0);    }
	50%  { background-color: rgba(150,0,0,0.7); }
	100% { background-color: rgba(60,0,0,0.5);  }
}

@keyframes modalWarningEnter {
	0%   { background-color: rgba(60,30,0,0);    }
	50%  { background-color: rgba(150,75,0,0.7); }
	100% { background-color: rgba(60,30,0,0.5);  }
}

@keyframes modalImmersiveEnter {
	from { background-color: rgba(0,0,0,0);   }
	to   { background-color: rgba(0,0,0,0.9); }
}

@keyframes modalOuterExit {
	from { background-color: rgba(0,0,0,0.5); }
	to   { background-color: rgba(0,0,0,0);   }
}

@keyframes modalErrorExit {
	from { background-color: rgba(60,0,0,0.5); }
	to   { background-color: rgba(0,0,0,0);    }
}

@keyframes modalWarningExit {
	from { background-color: rgba(60,30,0,0.5); }
	to   { background-color: rgba(0,0,0,0);     }
}

@keyframes modalImmersiveExit {
	from { background-color: rgba(0,0,0,0.9); }
	to   { background-color: rgba(0,0,0,0);   }
}

/*
@keyframes modalInnerEnter {
	from { transform: translate(0, 100vh); }
	to   { transform: translate(0, 0    ); }
}

@keyframes modalInnerExit {
	from { transform: translate(0, 0);      }
	to   { transform: translate(0, -100vh); }
}
*/

@keyframes modalInnerEnter {
	from { transform: scale(0.75); filter: opacity(0); }
	to   { transform: scale(1);    filter: opacity(1); }
}

@keyframes modalInnerExit {
	from { transform: scale(1);    filter: opacity(1); }
	to   { transform: scale(0.75); filter: opacity(0); }
}
