/* GLOBAL VARIABLES */

:root {
    --main-bg-color: #cfe3f6;
    --secondary-bg-color: #d1ead1;
    --footer-bg-color: #004d2c;

    --button-bg-color: #a9c5e8;
    --button-active-bg-color: #a7c7a5;
    --button-active-border-color: #004d2c;

    --main-border: 0.15rem solid black;
    --medium-border: 0.12rem solid black;
    --small-border: 0.08rem solid black;
}

/* GENERAL STYLING */

html,
body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overscroll-behavior: none;
}

body {
    background-color: var(--main-bg-color);
    display: flex;
    flex-direction: column;
    font-size: 1.15rem;
    box-sizing: border-box;
    font-family: Arial, Sans-serif;
}

header,
footer {
    flex-shrink: 0;
}

main {
    margin: 0 1.5rem;
    flex-grow: 1;
    padding-bottom: 1.2rem;

    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    margin-top: 0;
    font-size: 1.8em;
}

ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

hr {
    border: var(--small-border);
    margin: 1.5rem auto;
}

/* GREEN BUBBLE CONTAINER STYLING */

table,
.container,
#preview {
    background-color: var(--secondary-bg-color);
    border: var(--main-border);
    border-spacing: 0;
    border-radius: 1rem;
    margin-top: 1.2rem;
    align-self: center;
    width: 40%;
    min-width: fit-content;
}

.container,
#preview {
    padding: 1em;
}

/* HEADER STYLING */

#top {
    padding-bottom: 1rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

header {
    margin: 1.5rem;
    padding: 0.5rem;
    border-bottom: var(--main-border);
    text-align: center;
}

#logo {
    grid-column-start: 2;
    justify-self: center;
    object-fit: contain;
    height: 7rem;
    max-width: min(calc(100vw - 32.5rem), 100%);
}

nav ul {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

nav:has(>a) {
    display: flex;
    justify-content: center;
}

#top>form {
    text-align: right;
    justify-self: end;
    align-self: start;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

header button {
    padding: 0.3rem 0.6rem;
    background-color: var(--button-bg-color);
    font-size: 0.9em;
}

nav a:not(.active) {
    background-color: var(--button-bg-color);
}

nav a.active {
    background-color: var(--button-active-bg-color);
    border-color: var(--button-active-border-color);
}

/* FOOTER STYLING */
footer {
    position: sticky;
    bottom: 0;
    width: 100%;
    background-color: var(--footer-bg-color);

    box-sizing: border-box;
    padding: 0.7rem 1.4rem;
    display: grid;
    grid-template-columns: 1fr 6rem 1fr;
    gap: 1rem;
    place-items: center;
}

footer>ul {
    justify-self: left;
}

footer>a {
    justify-self: right;
    text-align: right;
}

footer a {
    color: #ffc72c;
    text-decoration: none;
}

footer a:hover {
    color: #ffeea9;
}

/* FORM & BUTTON STYLING */
form {
    justify-content: center;

    display: grid;
    grid-template-columns: repeat(2, minmax(auto, max-content));
    gap: 1em;
    align-items: center;
    justify-items: center;
}

form p {
    margin: inherit;
}

form>label {
    justify-self: end;
}

form>input,
form>select,
form>output {
    justify-self: start;
}

fieldset {
    border: var(--medium-border);
}

form>fieldset {
    grid-column: 1 / -1;
    display: flex;
    gap: 1em;
}

form>fieldset label {
    margin-left: -0.75em;
}

:not(fieldset)>label,
legend {
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="file"],
select {
    padding: 0.4em;
    font-size: inherit;
    border: var(--small-border);
    border-radius: 0.2em;
}

input[type="checkbox"] {
    width: auto;
    margin-left: 0;
}

select {
    max-width: 13em;
}

button,
.action-btn,
nav a {
    display: inline-block;
    background-color: white;
    border: var(--main-border);
    border-radius: 0.5em;
    padding: 0.6em 1.3em;
    font-weight: bold;
    cursor: pointer;

    transition: filter 0.2s;

    text-decoration: none;
    font-family: inherit;
    color: inherit;
    font-size: inherit;
}

button:hover,
.action-btn:hover,
nav a:hover {
    filter: brightness(0.9);
}

.submit-group {
    display: block;
    grid-column: 1 / -1;
}

/* LOGIN PAGE STYLING */

main.container {
    text-align: center;
    flex-grow: 0;
    width: fit-content;
    padding: 1rem;
}

main.container h1 {
    font-size: 1.5em;
}

/* EVENT SLIP CREATION PAGE STYLING */

/* Grey out button when no file is uploaded */

#event-slip:invalid button {
    opacity: 0.3;
    pointer-events: none;
}

#preview {
    aspect-ratio: 8.5 / 11;
}

/* ROOM MANAGEMENT PAGE STYLING */

table th,
table td {
    border: var(--small-border);
    padding: 0.4em 0.5em;
    text-align: left;
}

table th {
    font-weight: bold;
    border-top: none;
    border-bottom: var(--medium-border);
}

table tr:last-of-type td {
    border-bottom: none;
}

table th:first-of-type,
table tr td:first-of-type {
    border-left: none;
}

table th:last-of-type,
table tr td:last-of-type {
    border-right: none;
}

.center-cell {
    text-align: center;
}

#room_num {
    width: 8em;
}

#room_name {
    width: 13.5em;
}

/* USER MANAGEMENT PAGE STYLING */

#current_role {
    text-transform: capitalize;
}

/* CREDITS PAGE STYLING */

.grid {
    max-width: 75rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media screen and (max-width: 75rem) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.grid section {
    min-width: 15rem;
    min-height: 30rem;
    background-color: var(--secondary-bg-color);
    border: var(--main-border);
    border-radius: 1.5rem;
    padding: 1rem 2.5rem;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 100%;
    grid-template-rows: 12.5rem 1.5rem min-content 3rem min-content min-content;
    align-items: start;
}

details {
    padding: 0.5rem 0;
}

.major {
    margin: 0;
}

.role-list,
.role-list li {
    display: inline;
}

.role-list li:after {
    content: ", ";
}

.role-list li:last-of-type:after {
    content: "";
}