:root {
    --text-color: black;
    --background-color: white;
    --primary-color: cornflowerblue;
    --accent-color: coral;
}

::selection {
    background-color: var(--accent-color);
}

@font-face {
    font-family: Pacifico;
    src: url("../assets/fonts/Pacifico-Regular.ttf");
}
@font-face {
    font-family: Archivo;
    src: url("../assets/fonts/Archivo-Regular.ttf");
}

body, html {
    padding: 0px;
    margin: 0px;
    height: 100%;
}

html {
    font-family: Archivo, Arial, sans-serif;
    scrollbar-color: var(--primary-color) var(--text-color);
}

h1 {
    text-shadow: -2px -2px 4px #FFF, 2px -2px 4px #FFF, -2px 2px 4px #FFF, 2px 2px 4px #FFF;
}

h1, h2 {
    font-family: Pacifico, Verdana, Impact;
    font-weight: 100;
}

h1, h2, h3, h4, h5, h6 {
    text-align: center;
}

.wip-warning {
    text-shadow: -1px -1px 1px #FFF, 1px -1px 1px #FFF, -1px 1px 1px #FFF, 1px 1px 1px #FFF;
}

body {
    display: flex;
    flex-direction: column;
    a {
        color: var(--text-color);
        text-align: center;
    }
    a:hover {
        font-weight: 900;
    }
    a:active {
        background-color: var(--accent-color);
    }
}

.admin-panel, header {
    a {
        text-decoration: none;
    }
}

footer, header {
    outline: 2px solid white;
    flex-shrink: 0;
    font-size: 1em;
    background-color: var(--primary-color);
    nav {
        display: flex;
        align-items: center;
    }
}

.login-logo {
    justify-content: center;
    * {
        width: auto;
    }
}

header {
    font-size: 1.2em;
    nav {
        flex-direction: row;
        a {
            width: 100%;
            padding: 10px 0px;
            margin: 0px;
            text-align: center;
        }
        a {
            outline-offset: -1px;
        }
        a:hover {
            outline: 1px solid var(--text-color);
        }
    }
}

footer {
    margin-top: 20px;
    nav {
        flex-direction: column;
    }
    a {
        padding: 10px 5px;
    }
    span {
        display: flex;
        flex-direction: row;
        justify-content: space-evenly;
        width: 100%;
    }
    p:not(:first-child) {
        padding: 0px 0px 10px 0px;
        margin: 0px;
    }
}

main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0px 10px;
}

section {
    min-width: 300px;
    max-width: 1260px;
    display: flex;
    flex-direction: column;
    p {
        text-align: center;
    }
}

section:not(.admin-panel section), .admin-panel {
    background-color: var(--primary-color);
    border-radius: 10px;
    padding: 10px;
}

.movie-section {
    min-width: 350px;
    width: 100%;
}

.list {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0px;
    background-color: white;
    outline: 1px solid var(--text-color);
    outline-offset: -1px;
    thead {
        background-color: var(--text-color);
        z-index: 2;
        position: sticky;
        top: 0;
    }
    thead th, tfoot td {
    font-weight: 700;
    border: 1px solid var(--text-color);
    background-color: rgb(192, 192, 192);
    }
    th, td, tr {
        padding: 0px;
        margin: 0px;
    }
    td {
        text-wrap: break-word;
    }

    tbody {
        tr:nth-child(even) {
            background-color: rgba(0, 0, 0, 0.1);
        }   
        tr {
            user-select: none;
        }
        tr:hover {
            background-color: var(--primary-color);
            cursor: pointer;
        }
        tr:active {
            background-color: var(--accent-color);
        }
    }
}

.mobile-hide {
    display: none;
}

.very-short-col {
    max-width: 10%;
    width: 10%;
}

.short-col {
    max-width: 15%;
    width: 15%;
}

.big-col {
    min-width: 20%;
    width: 30%;
}

th, td {
    text-align: center;
}

tr:not(:last-child) td {
    border-bottom: 1px solid var(--text-color);
}

b {
    font-weight: 700;
}

.admin-panel {
    width: calc(100% - 20px);
    max-width: 400px;
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    justify-items: center;
    column-gap: 10px;
    section {
        display: flex;
        flex-direction: column;
        min-width: 300px;
        width: 100%;
        h2 {
            background-color: rgb(192, 192, 192);
            border: 1px solid var(--text-color);
            margin: 10px 0px 0px 0px;
        }
        ul {
            margin: 0px;
        }
        li:nth-child(even) {
            background-color: rgba(0, 0, 0, 0.1);    
        }
    }
}

.admin-links {
    grid-column: 1;
    grid-row: 1;
    a {
        font-size: 1.2em;
        padding-bottom: 10px;
    }
    a:first-child {
        padding-top: 10px;
    }
}

.data-list {
    background-color: white;
    list-style: none;
    list-style-position: inside;
    padding: 0px;
    border: 1px solid var(--text-color);
    li {
        padding: 5px 3px;
    }
    li:not(:last-child) {
        border-bottom: 1px solid var(--text-color);
    }
}

form {
    display: flex;
    flex-direction: column;
    label {
        display: flex;
        flex-direction: column;
        margin-bottom: 20px;
    }
    button {
        align-self: center;
        background-color: var(--primary-color);
        border: 2px solid rgb(61, 107, 192);
        padding: 5px;
        box-shadow: 3px 3px 2px;
        border-radius: 5px;
        font-size: 1.1em;
    }
    button:disabled {
        border-color: rgb(134, 170, 235);
        background-color: rgb(134, 170, 235);
    }
    button:hover {
        border-color: var(--accent-color);
    }
    button:active {
        box-shadow: -3px -3px 2px;
        background-color: var(--accent-color);
    }
    .checkbox {
        display: flex;
        flex-direction: row;
    }
    select {
        margin-bottom: 10px;
    }
}

.inline-form {
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin-bottom: 10px;
    label {
        height: 100%;
        display: flex;
        flex-direction: row;
        align-items: center;
        text-align: center;
        margin: 0px;
        select {
            margin: 0px 10px;
            padding: 4px 10px;
            font-size: 1em;
        }
    }
}

.alert {
    background-color: rgb(255, 212, 212);
    border-color: red;
}

.add-movie-panels {
    display: grid;
    grid-template-rows: auto auto;
    gap: 20px;
    section:not(:last-child) {
        grid-column: 1;
    }
    section:last-child {
        grid-row: 1 / span 2;
        grid-column: 2;
    }
}

#search-results {
    min-width: 1000px;
}

.movie-page {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    .movie-poster {
        grid-row: 2;
        border-radius: 5px;
        align-self: center;
        justify-self: center;
        max-width: 400px;
        width: calc(100% - 50px);
        height: auto;
    }
    > *:not(h1) {
        outline: 2px solid white;
    }
    h1 {
        grid-row: 1;
    }
    h1, h2 {
        font-family: Archivo;
    }
    .movie-details, .cast, .crew {
        padding: 10px;
        max-width: calc(100% - 20px);
    }
    table {
        background-color: transparent;
        tr {
            background-color: transparent;
        }
        tr:not(:last-child) td {
            padding-bottom: 10px;
        }
        td {
            border: none;
        }
    }
    .movie-details {
        margin: inherit 0px;
        font-size: 1.1em;
        .synopsis {
            margin-top: 0px;
            text-align: justify;
        }
        td:first-child {
            text-align: left;
            vertical-align: top;
        }
    }
    ul {
        margin: 0px;
        font-size: 1.1em;
        list-style: none;
        list-style-position: inside;
        padding: 0px;
        a {
            display: grid;
            grid-template-columns: 1fr 5fr 5fr;
            align-items: center;
            text-decoration: none;
            p {
                margin: 0px;
                padding: 0px 5px;
                align-content: center;
            }
        }
        li {
            padding: 2px;
            border-radius: 5px;
            box-shadow: 3px 3px 6px black;
        }
        li:not(:last-child) {
            margin-bottom: 10px;
        }
    }
    
    img:not(.movie-poster) {
        border-radius: 5px;
        outline: 2px solid black;
        max-height: 64px;
    }
}

@media screen and (min-width:721px) {
    main {
        margin: 0px 50;
    }
    .mobile-hide {
        display: initial;
    }
    td.mobile-hide, th.mobile-hide {
        display: table-cell;
    }
    tr.mobile-hide {
        display: table-row;
    }
    .mobile-show, th.mobile-show, tr.mobile-show, td.mobile-show {
        display: none;
        color: red;
    }
    .mobile-show {
        display: none;
    }
    .list thead th, .list tfoot td {
    font-weight: 900;
    }
    header {
        font-size: 1.2em;
        nav {
            justify-content: center;
        }
        a {
            width: 100%;
            padding: 10px 10px;
        }
    }
    footer span {
        justify-content: center;
        a {
            padding: 10px 10px;
        }
    }
    .inline-form {
        justify-content: end;
    }
    .admin-panel {
        max-width: 800px;
        grid-template-columns: repeat(2, 1fr);
        .admin-links {
            grid-column: 1 / span 2;
            grid-row: 1;
            a {
                font-size: 1.2em;
                padding-bottom: 10px;
            }
            a:first-child {
                padding-top: 10px;
            }
        }
    }
    .movie-page {
        img:not(.movie-poster) {
            height: 96px;
            max-height: 96px;
        }
    }
}
@media screen and (min-width:1281px) {
    main {
        margin: 0px 100;
    }
    .admin-panel {
        max-width: 1440px;
        grid-template-columns: repeat(4, 1fr);
        section {
            max-width: 350px;
        }
        .admin-links {
            grid-column: 1 / span 4;
            grid-row: 1;
            a {
                font-size: 1.2em;
                padding-bottom: 10px;
            }
            a:first-child {
                padding-top: 10px;
            }
        }
    }
    .movie-page {
        display: grid;
        gap: 10px;
        grid-template-columns: 550px 550px;
        justify-content: center;
        align-items: center;
        margin-top: 20px;
        section {
            width: 100%;
            max-width: 100%;
        }
        .movie-poster {
            grid-column: 1;
            grid-row: 2;
            border-radius: 5px;
        }
        h1 {
            grid-row: 1;
            grid-column: 1 / span 2;
        }
        h1, h2 {
            font-family: Archivo;
        }
        .cast {
            grid-column: 1 / span 2;
            grid-row: 3;   
        }
        .crew {
            grid-column: 1 / span 2;
            grid-row: 4;   
        }
        img:not(.movie-poster) {
            height: 128px;
            max-height: 128px;
        }
        ul {
            font-size: 1.2em;
        }
    }
}