:root {
    --accent2: #a45821;
    --lunch: #a45821;

    --bg1: #2a2a80;
    --bg2: #6464ee;

    --bg3: #312626;
    --bg4: #4d2424;

    --background-active-gradient: linear-gradient(0deg, var(--bg1) 0%, var(--bg2) 100%);
    --background-cancelled-gradient: linear-gradient(0deg, transparent 0%, rgba(80,80,80,.2) 100%);
    --background-changed-gradient: linear-gradient(0deg, var(--background4) 0%, var(--bg4) 100%);
}

main {
    flex-direction:column;
}

#spinner {
  width:3em;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  mix-blend-mode: plus-lighter;
}

#statusmsg {
    font-size:1.2em;
    text-align:center;
    margin-top:20px;
    margin-bottom:10px;
}
#errormsg {
    text-align:center;
    margin-bottom:20px;
    font-size:.7em;
    color:var(--text-depressed);
}

#notice-div {
	margin:30px;
	margin-left:auto;
	margin-right:auto;
	padding: 10px;

    width:75vw;
    max-width:600px;

    height: fit-content;

	text-align:center;

	background: var(--background-tile-gradient);
	border-radius: 6px;
	box-shadow: 0px 0px 15px rgb(0,0,0,50%);
    font-size: 0.9em;

    display: flex;
    flex-direction: column;
    align-items:center;
}
#notice-div p {
    font-size: .9em;
}
#notice-div > * {
    padding: 10px;
    width:fit-content;
}
#notice-div button {
    background: var(--background4);
    padding:4px 10px;
    border: 3px solid var(--accent);
    border-radius: 6px;
    font-weight: bold;
    font-size: .7em;
}
#notice-div button:hover {
    background: var(--background-accent);
}
#notice-div button:active {
    background: var(--background-depressed);
    border-color: white;
}

/*----------------------------------------------*/

.lunchbar {
    width:100vw;
    display:inline-flex;
    justify-content:space-evenly;
    align-items:center;
}
.lunchbar > hr {
    margin:6px;
    width: inherit;
    height:2px;
    border: none;
    background: var(--lunch);
}
.lunchbar > p {
    font-size: .70em;
    color: var(--lunch);
}

#day-div {
    display: flex;
    flex-direction: column;
    margin-bottom:200px; /* for details window */
    align-items:center; /* only for group selector TODO patch */ 
}

#day-title {
    text-align:center;
    margin:10px;
}


#groupselector {
    margin:15px;
    width:150px;
    text-align:center;
    border:none;
}

.period {
    display:flex;
    flex-direction:row;
    align-items:center;
    max-width:400px;
    justify-content:center;
    width:97vw;
/*    height:100px; */
    margin: 5px 5px;
}
.period-num {
    color: var(--text-depressed);
    margin:5px;
}
.lessons-div {
    width:100%;
    display:flex;
    flex-direction:row;
    align-items:center; /* fix borderless alignment */
}
.lessons-div.tabbed {
    flex-wrap: wrap-reverse;
    justify-content:space-evenly;
}

@keyframes update {
	1% { box-shadow: inset 0px 0px 8px rgb(235,235,255,80%); }
	100% { box-shadow: none; }
}
@keyframes nextlesson {
	0% { box-shadow: 0px 0px 6px rgb(235,235,255,70%); }
	15% { box-shadow: 0px 0px 6px rgb(235,235,255,70%); }
	50% { box-shadow: none; }
	85% { box-shadow: 0px 0px 6px rgb(235,235,255,70%); }
	100% { box-shadow: 0px 0px 6px rgb(235,235,255,70%); }
}

.lesson {
    animation: update 1s;

    height: 100%;
    width: inherit;
    margin:0px 4px;
	padding: 6px;

    border: 2px solid transparent;

	background: var(--background-tile-gradient);
	border-radius: 5px;
	box-shadow: 0px 0px 8px rgb(0,0,0,30%);
}
.lesson.inline {
    display:inline-flex;
    justify-content:space-between;
    max-width: calc(50% - 24px);
    height:18px;
    align-items:center;
    margin-top: 2px;
    margin-bottom: 2px;
}
.lesson.inline > .field-targy {
    font-size:0.45em;
    text-align:left;
    max-width:40%;
}
.lesson.inline > .lesson-bottom-div  {
    margin:0;
    justify-content:space-between;
}
.lesson.inline > .lesson-bottom-div  > div {
    font-size:0.55em;
}

.field-targy {
    font-weight:bold;
    font-size:0.9em;
    text-align:center;
    padding: 5px 5px;
}

.lesson-bottom-div {
    display:flex;
    flex-direction: row;
    justify-content:space-between;
    max-width:200px;
    margin:auto;
}
.lesson-bottom-div > div {
    font-size: .60em;
    padding:2px 4px;
}


.lesson.cancelled {
	background: var(--background-cancelled-gradient);
	box-shadow: none;
    color:gray;
}
.lesson.cancelled > .field-targy {
    text-decoration:line-through;
    color:gray;
}
.lesson.cancelled > .lesson-bottom-div > * {
    color:gray;
}
.lesson.changed {
	background: var(--background-changed-gradient);
	box-shadow: 0px 0px 8px var(--accent2);
    border: 4px solid var(--accent2);
}
.field-changed {
    background: var(--accent2);
    border-radius:3px;
    font-weight:bold;
}
.lesson.current {
	background: var(--background-active-gradient);
	box-shadow: 0px 0px 8px rgb(255,255,255,30%);
}
.lesson.happened {
	background: var(--background-cancelled-gradient);
}
.lesson.next {
    animation: nextlesson 3s linear infinite;
}
.lesson.selected {
    background: var(--background-accent);
    border:2px solid var(--accent);
}

/*----------------------------------------------*/

#lesson-details-div {
    position:fixed;
    bottom:0;
    width:100%;
    height:200px;

	background: var(--background-tile-gradient);
	box-shadow: 0px 0px 12px rgb(0,0,0,50%);
    transition-duration:.2s;
}
#lesson-details-div.closed {
    bottom:-210px;
}

#details-close {
    font-size:.85em;
    padding:4px; /* enlarge size to make pressing easier */
}
#details-close:active {
    font-weight:bold;
}

#details-container {
    margin: 4px 12px;
}
#details-bar {
    width:100%;
    display:inline-flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0px;
}
#details-bar > div > span {
    font-weight:bold;
    font-size: 0.8em;
}

#details-bar > div > .arrow {
    font-size: 0.7em;
    height:100%;
    font-weight:normal;
    color: var(--text-depressed);
}
#details-content {
    display:flex;
    flex-direction:column;
    overflow-y:scroll;
    padding:6px;
    height:inherit;
}
#details-content > div > span {
    font-size:.75em;
}
#details-content > span {
    font-size:.75em;
}
.details-entry {
    color: var(--text-depressed);
    margin-right: 6px;
}
.details-item {
    background: rgb(225,205,255,20%);
    border-radius: 4px;
    padding: 3px 5px;
    font-size: .7em;
    margin: 5px;
}
