body {
	margin-top: 50px;
}

#refresh-questions {
	position: absolute;
	display: block;
	left: -40px;
	top: -20px;
	width: 60px;
	height: 60px;
	cursor: pointer;
}
#refresh-questions > img {
	width: 100%;
	height: 100%;
}


#refresh-questions:hover {
	filter: brightness(150%);
	animation: hithere 1s ease infinite;
}

#main {
	display: flex;
	position: relative;
	flex-direction: row;
	background-color: var(--grey4);
	padding: 20px;
	border-radius: 5px;
	z-index: 0;
}
#main .title {
	font-size: 1.1em;
	font-weight: bold;
	margin-bottom: 20px;
}

#main[mode="none"] > div {
	display: none;
}

#main:not([mode=questions]) #chapitres, #main:not([mode=questions]) #questions {
	display: none;
}

#main[mode="none"] h1 {
	position: relative;
	color: white;
	pointer-events: all;
}

#main h1 {
	display: inline-block;
	position: absolute;
	color: transparent;
	pointer-events: none;
	font-size: 2em;
	width: 100%;
	margin: 0;
	padding: 0;
	line-height: 100px;
	vertical-align: top;
}

#questions-list {
	display: flex;
	flex-direction: column;
}

#show-button {
	display: flex;
	align-items: end;
	justify-content: end;
}

#show-button div {
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	cursor: pointer;

	right: -20px;
	bottom: -20px;

	width: 50px;
	height: 50px;

	border: 1px solid white;
	background-color: var(--grey4);
	border-radius: 5px;

	transition: all ease .3s;
}

#show-button span {
	transform: rotate(90deg);
	font-size: 1.5em;
	transition: all ease .3s;
}

#show-button div:hover {
	background-color: var(--grey3);
}

#show-button div:hover span {
	transform: rotate(-90deg);
}

#questions, #chapitres {
	display: flex;
	flex-direction: column;
}

#chapitres {
	flex-grow: 1;
}

#questions {
	display: flex;
	flex-direction: column;
	max-height: 0;
	overflow: hidden;
	flex-grow: 2;
}
#questions.show {
	max-height: 1500px;
}

.chapitre {
	padding: 5px;
	margin: 5px 0 5px 0;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.chapitre .content {
	position: absolute;
	color: transparent;
	pointer-events: none;
	overflow: hidden;
	height: 0;
}
.chapitre .content img, .chapitre .content input {
	display: none;
}

#add-lecon {
	width: 90%;
	display: flex;
	margin-top: 10px;
}
#add-lecon > * {
	margin: 0 5px 0 5px;
}
#add-lecon > input[type=text] {
	flex-grow: 3;
}
#add-lecon > input[type=submit] {
	flex-grow: 1;
}

#questions input {
	width: 90%;
	margin-top: 10px;
	margin-left: 10px;
}

#questions .question {
	padding: 5px;
	cursor: pointer;
	display: flex;
	flex-direction: row;
	align-items: center;
}
#questions .question:hover {
	background-color: var(--grey5);
}
#questions .question.focus {
	padding: 4px;
	border: var(--orange2) 1px solid;
}
#questions .question.edit-mode {
	background-color: var(--orange2);
}
#questions .question.done .titre-question {
	color: var(--grey2);
}
#questions .question.done .bdd, #questions .question.done .intitule {
	color: var(--grey2);
	pointer-events: none;
}
#questions .question.drag-top {
	border-top: 2px var(--orange1) solid;
	padding-top: 3px;
}
#questions .question.drag-bot {
	border-bottom: 2px var(--orange1) solid;
	padding-bottom: 3px;
}
#questions .question.dragged {
	opacity: .3;
}

#questions .question img {
	width: 1em;
	height: 1em;
}
#questions .question > .bdd {
	font-weight: bold;
	margin-right: 1em;
	white-space: nowrap;
	min-width: 80px;
	width: 80px;
}

.question.focus > .intitule {
	max-height: 100px;
	overflow: scroll;
}

.intitule {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	text-overflow: ellipsis;
	max-height: 1em;
	transition: all ease .5s;
}

.intitule p {
	margin: 0;
	transition: all ease .5s;
}

.question.focus p {
	margin: 10px 0 10px 0;
}

.titre-question {
	font-weight: bold;
}

.admin-actions {
	display: flex;
	align-items: center;
	justify-content: end;
	flex-grow: 1;
}
.admin-actions .button {
	padding: 5px;
}

#room {
	display: flex;
	flex-direction: column;
}

input {
	background-color: var(--grey5);
	padding: 3px;
	border: 1px var(--grey3) solid;
	outline: none;
	color: white;
	font-family: monospace;
}

input:focus {
	box-shadow: 0 0 10px var(--orange1);
}

#room li {
	padding: 5px;
	margin-bottom: 10px;
}

#room li, #room li * {
	cursor: pointer;
}

#room li:hover {
	background-color: var(--grey5);
}

#add-question-button {
	display: flex;
	flex-direction: column;
	padding: 10px;
	margin-top: 10px;
}
#add-question-button.expand:not(.edit-mode) {
	border: var(--grey2) 1px solid;
	background-color: var(--grey5);
}
#add-question-button.edit-mode {
	border: var(--grey2) 1px solid;
	background-color: var(--orange3);
}
#add-question-button .label {
	padding: 5px;
	cursor: pointer;
	display: flex;
	flex-direction: row;
}
#add-question-button .label::after {
	content: "Ajouter une question";
}
#add-question-button.edit-mode .label::after {
	content: "Modifier cette question";
}
#add-question-button .label:hover {
	background-color: var(--grey5);
}
#add-question-button.edit-mode .label:hover {
	background-color: var(--orange3);
}

#add-question-button * {
	display: none;
}

#add-question-button.expand *:not(#id_lecon, label[for="id_lecon"]) {
	display: block;
}

#add-question-button.expand textarea, #add-question-button select {
	background-color: var(--grey4);
	color: white;
	border: 1px white dotted;
	border-radius: 5px;
	padding: 10px;
}
#add-question-button.expand textarea::selection {
	background-color: var(--orange3);
	color: white;
}
#add-question-button.expand label {
	margin-top: 20px;
}
#add-question-button.expand .label {
	font-weight: bold;
}

#id_lecon, label[for="id_lecon"] {
	display: none;
}

.question-pk {
	display: none !important;
}


#add-room {
	position: fixed;
	width: 100%;
	top: -50px;
	left: 0;
	opacity: 0;
	pointer-events: none;
	transition: all ease .3s;
}

#add-room #box {
	display: flex;
	flex-direction: column;
	align-items: center;

	position: relative;

	margin-top: 100px;
	background-color: var(--orange3);

	padding: 5%;
	width: 80%;
	left: 5%;
}

#add-room #background {
	position: fixed;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.768);
}

#add-room.focus {
	opacity: 1;
	pointer-events: all;
	top: 0;
}

#add-room .title {
	text-align: center;
	font-size: 1.1em;
	font-weight: bold;
}

#add-room label {
	margin-top: 20px;
}

#add-room input {
	width: 200px;
}

#add-room input[type=submit] {
	margin-top: 50px;
}

#add-room .help {
	font-style: italic;
	font-size: .9em;
	color: var(--orange1);
}

textarea {
	background-color: var(--grey4);

	border-radius: 5px;
	border: #ddd 1px solid;
	padding: 10px;

	font-family: monospace;
	font-size: 1.2em;
	color: rgba(255, 255, 255, 0);

	caret-color: #ddd;
	text-wrap: nowrap;
}

#command textarea, #commands textarea {
	position: absolute;
}

textarea::selection, textarea div::selection {
	color: rgba(255, 255, 255, 0);
}

textarea:focus { 
	outline: none !important;
	border-color: var(--orange1);
	box-shadow: 0 0 10px var(--orange1);
}

.showcode {
	position: absolute;
	pointer-events: none;
	padding: 10px;
	font-family: monospace;
	font-size: 1.2em;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	color: #eee;
}

textarea, .showcode {
    -moz-tab-size: 4;
    -o-tab-size:   4;
    tab-size:      4;
}

.clickable {
	display: inline-block;
	padding: 3px;
	text-decoration: none;
	color: white;
	cursor: pointer;
}
.clickable .name {
	background:  linear-gradient(to right, var(--orange1), var(--orange1));
	background-size: 0 2px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	transition: background-size 400ms;
}
.clickable:hover .name {
	background-size: 100% 2px;
}
.clickable.focused .name {
	background-size: 100% 100%;
	color: black;
	font-weight: bold;
	padding: 3px;
}
.clickable.focused {
	padding: 0 3px 0 3px;
}

.arrow.shrink {
	font-size: .8em;
}

.clickable.focused .arrow {
	color: var(--orange1);
}

.clickable .arrow {
	position: relative;
	right: 10px;
	color: white;
}

.question .button {
	width: 1em;
	height: 1em;
}




@media (max-width: 720px) {

	#refresh-questions {
		width: 40px;
		height: 40px;
		top: -10px;
		left: -20px;
	}

	#show-button div, #show-button span {
		display: flex;
		width: 30px;
		height: 30px;
		justify-content: center;
		align-items: center;
	}

	#show-button {
		width: 0;
	}

	#show-button span {
		font-size: 1em;
		transform: rotate(-90deg);
	}

	#chapitres {
		transition: all ease .4s;
		min-width: auto;
	}

	#main:has(#questions.show) #chapitres {
		min-width: 100px;
		overflow: hidden;
		text-overflow: ellipsis;
		flex-grow: 0;
	}

	#main:has(#questions.show) .chapitre {
		overflow: hidden;
		text-overflow: ellipsis;
		padding-left: 0;
		margin-left: 0;
	}

	#add-lecon {
		flex-direction: column;
	}
	
	#questions .question > .bdd {
		min-width: 60px;
		width: 60px;
	}
}