/* GÉNÉRALITÉS */

html, body {
	position: relative;
	margin: 0;
	padding: 0;
	background-color: #FFC;
}

.nowrap {
	white-space: nowrap;
}

h1, h2, h3 {
	text-align: center;
}



/* BLOCS */

#filters, #results {
	margin: 0;
	padding: 10px;
	box-sizing: border-box;
}

#filters {
	position: fixed;
	left: 0;
	width: 60%;
	height: 100%;
	overflow-y: auto;
	text-align: center;
	background-color: #FFF;
}

#results {
	position: absolute;
	left: 60%;
	min-width: 40%;
	min-height: 100vh;
	border-left: 2px solid #DD0;
	background-color: #FFC;
}

#results table {
	border-collapse: collapse;
	margin: auto;
}

#results i {
	color: #66A;
}

#results td:not(.loading) {
	border: 1px black solid;
	padding: 2px;
}

#error {
	display: none;
	width: 80%;
	margin: auto;
	background-color: #F55;
	border: 4px solid #B33;
	padding: 5px;
}



/* FILTRES ET GROUPES */

.filter, .addfilter, .group {
	position: relative;
	margin: 10px 0;
	border: 2px solid black;
	padding: 5px;
	text-align: center;
}

.addfilter {
	background-color: #8D8;
}

.filter:first-of-type p:not(:first-of-type) {
	text-align: left;
}

.filter:nth-of-type(2n+1) {
	background-color: #D88;
}

.filter:nth-of-type(2n) {
	background-color: #B68;
}

.filter h2 {
	text-align: center;
	margin-top: 0.1em;
	margin-bottom: 0.5em;
}

.filter input[type="text"] {
	min-width: 100px;
	width: 50%;
}

[data-filter='SIZE_LETTERS'] input[type="number"], [data-filter='SIZE_SYLLABLES'] input[type="number"] {
	width: 3em;
	margin-right: 20px;
}

.group:nth-of-type(2n+1) {
	background-color: #AAF;
}

.group:nth-of-type(2n) {
	background-color: #779;
}

.remove {
	position: absolute;
	z-index: 20;
	top: 5px;
	right: 5px;
	padding: 2px;
	border: 1px solid black;
	background-color: #FFF;
	cursor: pointer;
}

.remove:hover {
	background-color: #CCC;
	border-style: inset;
}

.link {
	position: relative;
}

.link .remove {
	top: 0;
}

.debug-addlink {
	text-align: right;
	font-size: 0.7em;
	cursor: pointer;
	text-decoration: underline;
}



/* POPUP */

.popup {
	z-index: 50;
	position: absolute;
	max-width: 90%;
	padding: 10px;
	border: 1px solid black;
	border-radius: 5px;
	background-color: #8D8;
}

.phonhelp {
	text-align: left;
	cursor: pointer;
	font-style: italic;
	color: #333;
}

.phontable {
	border-collapse: collapse;
	display: inline-block;
	vertical-align: top;
}

.phontable:first-of-type {
	margin-right: 10px;
}

.cellgap {
	width: 20px;
}

.phontable th:not(.cellgap) {
	background-color: #DDD;
	font-weight: bold;
}

.phontable td:not(.cellgap) {
	background-color: white;
}

.phontable td:not(.cellgap), .phontable th:not(.cellgap) {
	border: 1px solid black;
	padding-left: 2px;
	padding-right: 2px;
}



/* SOUS-FILTRE VERBES */

.subfilter label {
	margin-right: 10px;
}

.subfilter h3, .subfilter h4 {
	margin-bottom: 0.5em;
}

.nowrap {
	display: inline-block;
	white-space: nowrap;
}

.verbdiv {
	margin: 5px auto;
	text-align: left;
}

.verbfilter {
	display: inline-block;
	vertical-align: top;
}

.verbfilter:not(:last-of-type) {
	margin-right: 15px;
	margin-bottom: 15px;
}

.verbfilter ul {
	list-style: none;
	padding-left: 10px;
	margin-top: 5px;
}



/* BOUTONS */

#refresh {
	display: inline-block;
	margin: 15px auto;
	background-color: #7BF;
	border: 2px solid black;
	font-size: 1.5em;
	padding: 10px;
	cursor: pointer;
}

#refresh:hover {
	background-color: #9DF;
	border-style: inset;
}


#switch {
	position: absolute;
	top: 5px;
	right: 42%;
	padding: 0 4px;
	font-size: 2em;
	font-weight: bold;
	text-align: center;
	border: 2px black solid;
	background-color: #DDF;
	z-index: 20;
	cursor: pointer;
	width: 1em;
}

#switch:hover {
	background-color: #EEF;
	border-style: inset;
}



/* PARAMÈTRES */

#paramsbutton {
	position: absolute;
	top: 5px;
	right: 5px;
	padding: 0 4px;
	border: 2px black solid;
	background-color: #DDF;
	z-index: 21;
	cursor: pointer;
}

#paramsbutton:hover {
	background-color: #EEF;
	border-style: inset;
}

#params {
	display: none;
	position: relative;
	margin-left: auto;
	margin-right: auto;
	width: 400px;
	border: 2px black solid;
	border-radius: 5px;
	background-color: #DDF;
}

.fieldline {
	position: relative;
	min-height: 2em;
}

.sortbutton {
	position: absolute;
	right: 5px;
	cursor: pointer;
}

#mobile_display_table {
	display: none;
}



/* MOBILE */
@media (max-width: 799px) {
	#filters, #results {
		position: relative;
		left: 0;
		width: 100%;
	}
	
	#results {
		min-height: 100%;
		border-left: none;
		border-top: 2px solid #DD0;
	}

	#switch {
		display: none;
	}
	
	#params {
		width: auto;
		margin-top: 25px;
	}
	
	.sortbutton {
		position: relative;
		left: 0;
		right: 0;
		display: block;
		margin: 5px 2em;
	}
	
	#mobile_display_table {
		display: block;
		margin: 1em;
		text-align: center;
	}

	
	/* RÉSULTATS EN AFFICHAGE MOBILE */
	
	#results:not(.force_table) table {
		display: block;
		width: calc(100vw - 20px);
	}
	
	#results:not(.force_table) tr {
		display: block;
		width: 100%;
		height: auto;
		margin-bottom: 8px;
	}
	
	#results:not(.force_table) td:not(.loading) {
		display: block;
		border: none;
		padding: none;
	}
	
	#results:not(.force_table) td:empty {
		display: none;
	}
	
	#results:not(.force_table) td:first-child {
		font-weight: bold;
	}
	
	#results:not(.force_table) td:first-child::after {
		content: " :";
	}
	
	#results:not(.force_table) td:not(:first-child) {
		margin-left: 15px;
	}
	
	#results:not(.force_table) td:not(:first-child)::before {
		content: "- ";
	}
	
	#results:not(.force_table) .field-nblettres::after {
		content: " lettres";
	}
	
	#results:not(.force_table) .field-nbphons::after {
		content: " phonèmes";
	}
	
	#results:not(.force_table) .field-nbsyll::after {
		content: " syllabes";
	}
	
	
	/* POPUP PHONÉTIQUE */
	.popup {
		position: relative;
		top: 0;
		left: 0;
	}

	.phontable:first-of-type {
		margin-right: 5px;
		margin-bottom: 15px;
	}
}