/* Import Assets */
@import 'https://deanwagner.github.io/modules/modal/modal.css';

/* * * * * * * * * * * *\
 *    Library App      *
 *                     *
 *  By: Dean Wagner    *
 * info@deanwagner.net *
 *                     *
 *   Assignment for:   *
 *  The Odin Project   *
 * theodinproject.com  *
\* * * * * * * * * * * */

:root {
    /* Default Colors */
    --color-bg: #666666;
    --color-text: #cccccc;
    --color-dark: #333333;
    --color-light: #eeeeee;
    --color-accent: #ff9c00;

    /* Shadows/Glow */
    --shadow-text: 0.05em 0.05em 0.2em rgba(0,0,0,0.6);
    --shadow-box: 0 0 1em rgba(0,0,0,0.5);
    --glow-text: 0 0 0.1em var(--color-accent);
    --glow-box: 0 0 0.3em var(--color-accent);

    /* Borders */
    --border-solid: 1px solid var(--color-dark);
    --outline-solid: 2px solid var(--color-accent);

    /* Browser Color Scheme */
    color-scheme: dark;

    /* Transitions */
    --transition-all : none;
    --enable-all     : all 0.3s ease-out;
}

* {
    accent-color: var(--color-accent);
    box-sizing: border-box;
    cursor: default;
}

/* * * * * * * * *\
 * Element Base  *
\* * * * * * * * */

html {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    background: var(--color-bg) radial-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.3));
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    font-family: Tahoma, Verdana, Geneva, sans-serif;
    font-size: 12pt;
    margin: 0;
    min-height: 100vh;
    padding: 2em 10vw;
    text-shadow: var(--shadow-text);
}

a, a * {
    cursor: pointer;
    transition: var(--transition-all);
}

a, a:link, a:visited {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover, a:focus, a:active {
    color: var(--color-accent);
    text-decoration: underline;
    text-shadow: var(--glow-text);
}

/* * * * * * * * *\
 *     Forms     *
\* * * * * * * * */

input[type='checkbox'],
button, select, option {
    cursor: pointer;
}

input[type='text'],
input[type='number'],
input[type='date'] {
    cursor: text;
}

input[type='text'],
input[type='number'],
input[type='date'],
select {
    background-color: var(--color-text);
    border: var(--border-solid);
    border-radius: 0.3em;
    box-shadow: inset var(--shadow-text);
    color: var(--color-dark);
    font-family: 'Courier New', Courier, monospace;
    padding: 0.3em;
}

input[type='text']:focus,
input[type='number']:focus,
input[type='date']:focus,
select:focus {
    outline: var(--outline-solid);
}

select option {
    padding: 0.5em;
}

input[type='color'] {
    background-color: var(--color-text);
    border: var(--border-solid);
    border-radius: 0.5em;
    box-shadow: var(--shadow-text);
    cursor: pointer;
    padding: 0;
}

input[type='color']:hover {
    background-color: var(--color-accent);
    box-shadow: 0 0 0.4em var(--color-accent);
}

button {
    background-color: var(--color-text);
    border: var(--border-solid);
    border-radius: 0.3em;
    box-shadow: var(--shadow-text);
    color: var(--color-dark);
    padding: 0.5em;
    transition: var(--transition-all);
}

button:hover,
button:focus,
button:active {
    background-color: var(--color-accent);
    box-shadow: var(--glow-box);
}

/* * * * * * * * *\
 *    Header     *
\* * * * * * * * */

header {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    white-space: nowrap;
}

header h1 {
    color: var(--color-light);
    font-weight: normal;
    letter-spacing: 0.5em;
    margin: 0 0 1rem 1rem;
    text-transform: uppercase;
}

header h1 svg {
    filter: drop-shadow(0.1em 0.1em 0.04em rgba(0,0,0,0.4));
    height: 1.5em;
    vertical-align: middle;
    white-space: nowrap;
    width: auto;
}

header h1 svg .cls-1 { fill: var(--color-light); }
header h1 svg .cls-1, .cls-5 { fill-rule: evenodd; }
header h1 svg .cls-2 { fill: none; stroke-width: 2px; }
header h1 svg .cls-2, .cls-3, .cls-4 { stroke: var(--color-dark); stroke-linecap: round; stroke-linejoin: round; }
header h1 svg .cls-3 { fill: var(--color-dark); stroke-width: 2px; }
header h1 svg .cls-4 { fill: var(--color-accent); stroke-width: 1; }
header h1 svg .cls-5 { fill: var(--color-accent); }

header div {
    margin-right: 1em;
}

header div a {
    display: inline-block;
    margin-left: 1em;
    transition: var(--transition-all);
}

header div a svg {
    filter: drop-shadow(var(--shadow-text));
    height: 2.5em;
    transition: var(--transition-all);
    width: 2.5em;
}

header div svg path,
header div svg path {
    fill: var(--color-accent);
}

header div a:hover,
header div a:focus {
    transform: rotate(-360deg) scale(1.5);
}

header div a:hover svg,
header div a:focus svg {
    filter: drop-shadow(var(--glow-text));
}

/* * * * * * * * *\
 *     Main      *
\* * * * * * * * */

main {
    flex: 1;
}

/* * * * * * * * *\
 *    Table      *
\* * * * * * * * */

main table {
    border: var(--border-solid);
    border-collapse: collapse;
    border-spacing: 0;
    box-shadow: var(--shadow-box);
    width: 100%;
}

/* * * * * * * * *\
 *  Table Head   *
\* * * * * * * * */

main thead tr {
    background-color: var(--color-dark);
}

main thead th {
    border: 0;
    font-weight: normal;
    padding: 0.3em 0;
}

main thead th .asc::after {
    content: '▾'; /* ▼ ↓ ⇓ ↧ */
    height: 1em;
    margin-right: 0;
    width: 1em;
}

main thead th .dec::after {
    content: '▴'; /* ▲ ↑ ⇑ ↥ */
    height: 1em;
    margin-right: 0;
    width: 1em;
}

main thead th label {
    display: none;
}

    /* * * * * * * * *\
     *  Table Body   *
    \* * * * * * * * */

main tbody tr {
    border: var(--border-solid);
    transition: var(--transition-all);
}

main tbody tr:nth-child(odd) {
    background-color: rgba(0,0,0,0.1);
}

main tbody tr:nth-child(even) {
    background-color: rgba(255,255,255,0.1);
}

main tbody tr:hover {
    outline: 1px solid var(--color-accent);
}

main tbody td {
    border: 0;
    padding: 1em;
    text-align: right;
}

main tbody tr td:nth-child(1) {
    text-align: center;
}

main tbody tr td:nth-child(2),
main tbody tr td:nth-child(3) {
    text-align: left;
}

main tbody tr td:last-child {
    white-space: nowrap;
}

main table td a svg {
    filter: drop-shadow(var(--shadow-text));
    height: 1.5em;
    width: 1.5em;
    transition: var(--transition-all);
}

main table td a svg path {
    fill: var(--color-accent);
}

main table td a:hover {
}

main table td a:hover svg {
    filter: drop-shadow(var(--glow-text));
    height: 1.5em;
    transform: scale(1.5);
    width: 1.5em;
}

main table td a:hover svg path {
    fill: var(--color-accent);
}

/* * * * * * * * *\
 *  Table Foot   *
\* * * * * * * * */

main tfoot tr {
    background-color: var(--color-dark);
}

main tfoot td {
    padding: 0.3em 1em;
}

main tfoot tr td:first-child {
    text-align: center;
}

main tfoot tr td:last-child {
    text-align: right;
    white-space: nowrap;
}

main tfoot td:last-child a {
    display: inline-block;
    margin-left: 0.4em;
}

main tfoot td:last-child a svg {
    height: 2em;
    width: 2em;
}

/* * * * * * * * *\
 *    Summary    *
\* * * * * * * * */

#summary {
    align-items: center;
    display: flex;
    gap: 1em;
    justify-content: center;
    margin: 1em 0 0;
    width: 100%;
}

#summary div {
    background-color: var(--color-dark);
    border: var(--border-solid);
    border-radius: 1em;
    box-shadow: var(--shadow-box);
    flex: 1;
    font-size: 0.8em;
    padding: 1em;
    text-align: center;
    white-space: nowrap;
}

#summary span {
    color: var(--color-light);
    display: block;
    font-size: 1.8rem;
}

/* * * * * * * * *\
 *  Page Footer  *
\* * * * * * * * */

footer {
    font-size: 0.8em;
    padding: 2em 0 0;
    text-align: center;
}

/* * * * * * * * *\
 *    Modals     *
\* * * * * * * * */

#modal > div {
    background-color: var(--color-bg);
    border: var(--border-solid);
    border-radius: 1em;
    box-shadow: var(--shadow-box);
    padding: 2em;
}

#modal div h3 {
    font-weight: normal;
    margin: 0 0 1em;
    text-align: center;
}

#modal .close_modal svg {
    filter: drop-shadow(var(--shadow-text));
}

#modal .close_modal svg path {
    fill: var(--color-accent);
}

#modal .close_modal:hover svg {
    filter: drop-shadow(var(--glow-text));
}

/* * * * * * * * *\
 *   Settings    *
\* * * * * * * * */

#modal_settings {
    display: none;
}

#modal_settings form {
    display: grid;
    grid-gap: 1em;
    grid-template-columns: 1fr 1fr;
}

#modal_settings form input[type='color'] {
    display: block;
    width: 100%;
}

/* * * * * * * * *\
 *  Edit Entry   *
\* * * * * * * * */

#modal_edit {
    display: none;
}

#modal_edit form {
    display: grid;
    grid-gap: 1em;
    grid-template-columns: 1fr 2fr;
}

#modal_edit form button {
    grid-column: 1 / span 2;
}

/* * * * * * * * *\
 *  Recycle Bin  *
\* * * * * * * * */

#modal_recycle {
    display: none;
}

#modal_recycle label {
    display: none;
}

#modal_recycle select {
    display: block;
    margin: 0 0 1em;
    padding: 0.5em;
    width: 100%;
}

#modal_recycle select option {
    border-radius: 0.5em;
    display: block;
    padding: 0.5em;
    margin: 0.2em 0;
    width: 100%;
}

#modal_recycle select option:checked {
    background: linear-gradient(0deg, var(--color-bg) 0%, var(--color-bg) 100%);
    color: var(--color-text);
}

#modal_recycle select:focus option:checked {
    background: linear-gradient(0deg, var(--color-accent) 0%, var(--color-accent) 100%);
    color: var(--color-dark);
}

#modal_recycle div {
    align-items: stretch;
    display: flex;
    gap: 0.5em;
    justify-content: stretch;
}

#modal_recycle button {
    flex: 1;
    padding: 0.5em 2em;
    white-space: nowrap;
}

/* * * * * * * * *\
 *    History    *
\* * * * * * * * */

#modal_default {
    display: none;
}

#modal_default p {
    max-width: 40ch;
}

#modal_default p:nth-child(4) {
    font-style: italic;
    max-width: 40ch;
    text-align: center;
}

#modal_default div {
    align-items: stretch;
    display: flex;
    gap: 0.5em;
    justify-content: stretch;
}

#modal_default button {
    flex: 1;
    padding: 0.5em 2em;
    white-space: nowrap;
}

/* * * * * * * * *\
 *  Mobile View  *
\* * * * * * * * */

#modal_mobile {
    display: none;
}

#modal_mobile div {
    max-width: 90vw;
    text-align: center;
    width: 18em;
}

#modal_mobile div svg {
    filter: drop-shadow(var(--shadow-text));
    height: 8em;
    margin: 0 auto;
    width: 8em;
}

#modal_mobile div svg path {
    fill: var(--color-text);
}

#modal_mobile div p {
    text-align: left;
}

#modal_mobile div button {
    font-weight: bold;
    padding: 1em 2em;
}

/* * * * * * * * *\
 *  Scrollbars   *
\* * * * * * * * */

body * {
    scrollbar-color: var(--color-bg) transparent;
}

body *::-webkit-scrollbar {
    width: auto;
    height: auto;
}

body *::-webkit-scrollbar-button,
body *::-webkit-scrollbar-thumb {
    background-color: var(--color-bg);
    background-clip: padding-box;
    border: 1px solid transparent;
    border-radius: 5px;
}

body *::-webkit-scrollbar-corner,
body *::-webkit-scrollbar-track {
    background-color: transparent;
}


body *::-webkit-scrollbar-button:hover,
body *::-webkit-scrollbar-thumb:hover,
body *::-webkit-scrollbar-thumb:active {
    background-color: var(--color-accent);
}

/* * * * * * * * *\
 * Media Queries *
\* * * * * * * * */

@media screen and (orientation: portrait) {
    #modal { display: flex; }
    #modal_mobile { display: block; }
    body { padding: 1em; }
}

@media screen and (max-width: 1000px) {
    body { padding: 1em; }
}