@import url('https://fonts.googleapis.com/css2?family=Doto:wght@100..900&display=swap');

:root {
    --bg-color: #100808;
    --text-color: #7CFC00;
    --hover-bg-color: #7CFC0010;

    --border-color-bright: #549B10;
    --border-color-dark: #1b2211;

    --transparent-border: solid 0.125rem transparent;
    --dotted-border-bright: dotted 0.125rem var(--border-color-bright, seagreen);
    --solid-border-bright: solid 0.125rem var(--border-color-bright, seagreen);
    --solid-border-dark: solid 0.125rem var(--border-color-dark, #222);

    --sticky-top: 137px;
    --sticky-top-2: 129px;
    --sticky-top-3: 169px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Doto', monospace;
    background-color: var(--bg-color, black);
    color: var(--text-color, chartreuse);
    margin: 0;
    padding: 1rem;
}

/*Header styling.*/

header {
    padding: 0;
    position: fixed;
    left: 1rem;
    right: 1rem;
    top: -1rem;
    margin-bottom: -1rem;
    background-color: var(--bg-color, black); /*for fixed*/
    z-index: 2;
}

header h1 {
    text-align: center;
    font-weight: 600;
    font-size: 2rem;
    padding: 1.5rem 0 0.5rem 0;
}

.date-bar {
    width: 100%;
    max-width: 32rem;
    border-top: var(--dotted-border-bright);
    margin: 0 auto;
    padding: 0.6rem 1rem;
    text-align: center;
    font-weight: 300;
}

/*Main positioning to clear header.*/
main {
    position: relative;
    top: 7.6rem;
}

/* Stats styling.*/
.stats {
    max-width: 32rem;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: min-content min-content min-content;
    margin: 0 auto;
}

.stats-box {
    border-right: var(--solid-border-dark);
    border-bottom: var(--solid-border-dark);
    display: inline-block;
    text-align: center;
}

.stats-bar {
    display: none;
    grid-column: 1 / -1;
    border-bottom: var(--dotted-border-bright);
    padding: 0.6rem 1rem;
    text-align: center;
    font-weight: 600;
}

.stats-box:nth-child(2) {
    grid-column: 1 / 5;
    border-left: var(--solid-border-dark);
    border-top: var(--solid-border-dark);
}

.stats-box:nth-child(3) {
    grid-column: 5 / -1;
    border-top: var(--solid-border-dark);
}

.stats-box:nth-child(4) {
    grid-column: 1 / 3;
    border-left: var(--solid-border-dark);
}

.stats-box:nth-child(5) {
    grid-column: 3 / -1;
}

.stat-num {
    font-weight: 600;
    font-size: 6rem;
    width: 100%;
    line-height: 8rem;
}

.stat-desc {
    font-size: 1.5rem;
    font-weight: 600;
    margin: -0.5rem 0 1rem 0;
}

.stats-box:hover {
    background-color: var(--hover-bg-color);
    cursor: default;
    border-bottom: var(--dotted-border-bright);
}

/* Table styling.*/

.table {
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
    max-width: 32rem;
    margin: 0 auto;
}

.table-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    font-weight: 300;
    width: 100%;
    border-left: var(--transparent-border);
    border-right: var(--transparent-border);
    position: relative;
    border-collapse: collapse;
}

.table-header {
    order: 1;
    font-weight: 600;
    position: sticky;
    top: var(--sticky-top);
    background-color: var(--bg-color, black); /*for sticky*/
    border-bottom: var(--dotted-border-bright);
}

.table-row:not(.table-header, .skip) {
    border-left: var(--solid-border-dark);
}

.table-row:nth-child(2)::after {
    content:"";
    position: absolute;
    top: 0;
    left: -0.3rem;
    height: 100%;
    width: 0.5rem;
    border-bottom: var(--solid-border-dark);
}

.table-row.skip {
    color: var(--border-color-bright);
}

.table-row.skip::before {
    content:"";
    position: absolute;
    top: 0;
    left: -0.3rem;
    height: 100%;
    width: 0.5rem;
    border-top: var(--solid-border-dark);
}

.table-row.skip::after {
    content:"";
    position: absolute;
    top: 0;
    left: -0.3rem;
    height: 100%;
    width: 0.5rem;
    border-bottom: var(--solid-border-dark);
}

.table-row:not(.table-header, .skip):hover {
    background-color: var(--hover-bg-color);
    border-left: var(--solid-border-bright);
    cursor: default;
}

.table-row.skip :hover {
    cursor: not-allowed;
}

.day-num {
    min-width: 2.5rem;
    text-align: center;
}

.date {
    min-width: 5rem;
}

.time {
    min-width: 3.25rem;
}

.topics {
    width: calc(100% - 13rem);
}

/*Stats & table styling for smaller screens.*/
@media screen and (max-width: 560px) {
    .hide {
        display: none;
    }
    .date {
        min-width: 3rem;
    }
    .topics {
        width: calc(100% - 11rem);
    }
}

@media screen and (max-width: 520px) {
    body {
        padding: 0.5rem;
    }

    header {
        left: 0.5rem;
        right: 0.5rem;
    }

    header h1 {
        padding-top: 1.5rem;
    }

    main {
        top: var(--sticky-top-2);
    }

    .table-header {
        top: 8.58rem;
    }
}

@media screen and (max-width: 505px) {
    .stat-num {
        font-size: 5rem;
        line-height: 6rem;
    }
    .stat-desc {
        font-size: 1.25rem;
        margin: 0 0 1rem 0;
    }
    .time {
        display: none;
    }
    .topics {
        width: calc(100% - 7.75rem);
    }
}

@media screen and (max-width: 416px) {
    main {
        top: var(--sticky-top-3);
    }
    .table-header {
        top: var(--sticky-top-3);
    }
}

/*Styling for larger screens.*/
@media screen and (min-width: 1090px) {
    .date-bar {
        max-width: 1260px;
        width: 100%;
    }
    main {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }
    .stats {
        width: 32rem;
        align-self: flex-start;
        position: sticky;
        top: var(--sticky-top);
        margin: unset;
        flex-shrink: 0;
    }
    .stats-bar {
        display: block;
    }
    .stats-box:nth-child(2) {
        border-top: unset;
    }
    .stats-box:nth-child(3) {
        border-top: unset;
    }
    .table {
        margin: unset;
        max-width: 732px;
        flex-grow: 1;
    }
}