@import url(/fonts/fontFaces.css);

html {
    font-family: arial;
    background-color: #2d2e2e;

    line-height: initial;
    letter-spacing: initial;
    font-size: initial;
    word-spacing: initial;
}

body {
    margin: 0;
    padding: 0;
}

main {
    margin: 0;
    margin-top: 2rem;
    padding: 0;

    --scheduleUI-button-width: 70px;
    --main-gap: 50px;
    padding-left: calc(var(--main-gap) + var(--scheduleUI-button-width));

    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: var(--main-gap);
    color: black;
}

main>* {
    flex: 0 0 auto;
}

#buttonBox {
    position: sticky;
    top: 20px;

    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: fit-content;
    width: 0;
    min-width: fit-content;
}

#buttonBox .scheduleButton {
    transform: translate(0, 0);
    font-size: 2.5rem;
    border-radius: 10px;
    box-shadow: 5px 5px 10px 5px black;
    text-align: center;
    width: var(--scheduleUI-button-width);
    aspect-ratio: 1/1;
    background: darkgrey;
    cursor: pointer;
    text-decoration: none;
    line-height: var(--scheduleUI-button-width);

    transition: background-color, box-shadow, transform;
    transition-duration: .1s;
    transition-timing-function: ease-in-out;
}

#buttonBox .scheduleButton:hover {
    transform: translate(1px, 1px);
    box-shadow: 4px 4px 8px 4px #000;
}

#buttonBox .scheduleButton:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 6px 3px black;
    background: #ccc;
    transition-duration: .05s;
}

#pages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.page {
    flex: 0 0 auto;
    background: #fff;
    width: 8.5in;
    height: 11in;
    border: outset #ccc 3px;
    border-radius: 10px;
    box-shadow: 5px 5px 10px 5px black;
    margin: 0;
    margin-bottom: 1rem;
    padding: 10px;
}

h1.editable {
    font-size: 24px;
    margin: 0;
    padding-block: .25em;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 0.25em;
    border-width: 2px;
}

#week-selector {
    display: flex;
    justify-content: space-evenly;
    font-size: 1rem;
    margin-block: 5px;
    padding: 5px;
    border-radius: 5px;
    border: solid #ccc 2px;
}

#weekTitle {
    font-size: 1rem;
    padding-inline: .5rem;
}

.week-option {
    display: flex;
    flex-direction: column;
    place-items: center;
    justify-content: space-evenly;
    gap: .25em;
    padding: .1em;
    border-radius: 5px;
    border: solid transparent 1px;
}

.week-option input {
    cursor: pointer;
}

.week-option:has(input:checked) {
    background-color: #eee;
    border: solid #ccc 1px;
}

#schedule {
    display: grid;
    grid-template-rows: auto auto 1fr auto auto;
    font-size: 12px;
    white-space: nowrap;
}

.grid-header h2 {
    font-size: 1rem;
    text-transform: uppercase;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-auto-rows: fit-content repeat(12, 1fr);
    border: 2px solid #ccc;
    border-radius: 5px;
    background: #fff;
}

.grid-header,
.grid-time {
    display: flex;
    background: #f2f2f2;
    font-weight: bold;
    border: 1px solid #ccc;
    padding: 4px 8px;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    text-align: center;
    margin: 0;
}

.grid-header>* {
    margin: 0;
}

.editable {
    padding: .25em .5em;
    border: solid #ccc 1px;
    border-radius: 5px;
}

.date {
    font-weight: normal;
}

.grid-cell {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    border: 1px solid #ccc;
    padding-inline: 1ch;
    text-align: center;
    justify-items: center;
    margin: 0;
}

.cellNote {
    outline: none;
}

.cellSelect {
    width: 100%;
    border: solid #ccc 1px;
    margin: 0;
    padding: .25em .5em;
    height: fit-content;
    white-space: wrap;
    appearance: none;
    overflow: visible;
    text-align: center;
}

.toggleBox:hover,
.colorBox:hover,
.colorBox:focus,
.editable:hover,
.editable:focus {
    position: relative;
    outline: outset #007bff 2px;
    box-shadow: 2px 2px 5px 3px black;
    border-radius: 5px;
}

#keyTitle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#grid-key-section {
    display: flex;
    justify-content: space-evenly;
    padding: 0;
}

#grid-key {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 1fr);
    margin-top: 10px;
}

.key-item {
    display: flex;
    gap: 5px;
    padding: 5px;
    flex-direction: column;
    align-items: center;
    border: solid #ccc 1px;
    margin: -.5px;
}

.colorBox {
    border: none;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

p.key {
    margin: 0;
    white-space: wrap;
    text-align: center;
}

#topLeft {
    border-top-left-radius: 10px;
}

#topRight {
    border-top-right-radius: 10px;
}

#bottomLeft {
    border-bottom-left-radius: 10px;
}

#bottomRight {
    border-bottom-right-radius: 10px;
}

.cellNote {
    margin: 0;
}

/* Restrict generic select styling to schedule cells so global prefs selects keep their native look */
#schedule .grid-cell select.cellSelect {
    width: 100%;
    height: 1.2em;
    background: transparent;
    border: none;
    font-size: inherit;
    color: inherit;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.toggleWrapper {
    font-size: 1rem;
    display: flex;
    width: fit-content;
    flex-direction: column;
    place-items: center;
    gap: 10px;
    max-height: fit-content;
    max-width: fit-content;
    margin-bottom: auto;
    margin-top: auto;
    padding: 5px;
    border: solid #ccc 2px;
    border-radius: 5px;
}

.toggleBox {
    display: flex;
    place-items: center;
    gap: 1ch;
    cursor: pointer;
    padding: .25em;
}

.toggleBox>* {
    pointer-events: none;
    user-select: none;
}


.toggle {
    width: 30px;
}

#studyTips h2 {
    text-align: center;
}

li {
    margin-left: 2em;
}


@media print {

    body,
    main,
    .pages {
        display: contents;
    }

    .page {
        break-after: page;
        break-inside: avoid;
        border: none;
        background: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }


    .noPrint {
        display: none !important;
    }

    .cellSelect,
    .editable {
        border: none;
    }

    .grid-header,
    .grid-time,
    .grid-cell,
    .colorBox {
        border: 1px solid #000;
        color: #000;
        background: none;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .colorBox {
        border: none;
    }

    .grid-header,
    .grid-time {
        background: #eee !important;
    }

    #schedule {
        box-shadow: none;
        border: none;
        margin: 0;
        padding: 0;
        width: 8.5in;
        height: 11in;
    }

    .key-item,
    .date {
        border: none;
    }

    #week-selector {
        display: flex;
        justify-content: space-evenly;
        font-size: 1rem;
        padding: 0px;
        border-radius: 0;
        border: none;
    }

    .week-option>input {
        display: none;
    }

    .week-option:has(input:checked) {
        border: solid black 1px;
    }
}