@import "reset.css";
@import url("../fonts/sourcesans3/source-sans-3.css");

:root {
    --font-base: 'Source Sans 3', sans-serif;

    --color-light: #ffffff;
    --color-dark: #373737;
    --color-brand: #6556a3;

    --color-medium-gray: #b1b1b1;
    --color-passive: #e6e6e6;
    --color-passive-light: #f5f5f5;

    --color-status-intime: #4CAF50;
    --color-status-late: #DC3545;
    --color-status-missing: #DC3545;
    --color-status-lateping: darkred;
    --color-status-waiting: #dfdfdf;
    --color-status-suspicious: #ff9800;

    /* subdued orange_ FF9800 */

    --flow-gap: 1rem;
    --default-shadow: 0 0 3px rgba(0,0,0,0.2);
}

@keyframes FadeAnimation {
    0% {
      opacity: 1;
      visibility: visible;
    }

    75% {
        opacity: 1;
        visibility: visible;
    }
  
    100% {
      opacity: 0;
      visibility: hidden;
    }
  }
  

body {
    font-family: var(--font-base);
    font-size: 20px;

    /*display: flex;
    flex-direction: column;
    flex-wrap: nowrap;*/
    display: grid;
    grid-template-rows: auto 1fr auto;
}

footer {
    /*margin-top: calc(var(--flow-gap)*2);*/

    background-color: var(--color-passive-light);
    
    
    > .flex {

        flex-wrap: wrap;

        @media screen and (max-width: 430px) {
            flex-direction: column;
            gap: 1rem;
        }

        > * {
            width: 33%;
            
            @media screen and (max-width: 430px ) {
                width: auto;
            }
        }

    }
}

a:not([class]), a[class=""] {
    text-decoration: underline;
    color:inherit;

    &:hover {
        color: var(--color-brand);
    }
}

label {
    font-size: 0.9em;
    margin-bottom: 0.2em;
}

/* composition */


#layout-header {
    flex-grow: 0;
    /*margin-bottom: calc(var(--flow-gap) * 2);*/
    box-shadow: var(--default-shadow);
    z-index: 1;
}

#layout-footer {
    flex-grow: 0;
    z-index: 1;
}

#layout-content {
    flex-grow: 1;
    position: relative;
}

/* blocks */

.site-header {
    width: 100%;
    background-image: linear-gradient(to bottom, rgba(0, 0, 255, 0.2) 0%,rgba(255, 255, 0, 0.1) 100%), linear-gradient(to right bottom, rgba(255, 0, 0, 0.1) 0%,rgba(0, 0, 255, 0.2) 100%);
    padding-block: 2.5rem;
    margin-block-end: var(--flow-gap)f;

    .header-band {
        background: var(--color-brand);
        background: linear-gradient(to bottom, var(--color-brand) 0%, color-mix(in srgb, var(--color-brand) 85%, transparent) 50%, var(--color-brand) 100%);
        color: var(--color-light);
        padding-block: 1rem;
    }

    .lead-title {
        text-transform: uppercase;
        font-weight: 200;
        margin-block-start: 2.5rem;
    }

    .site-navigation a {
        
    }
}

.flash-message {
    animation: FadeAnimation 3s ease-in .2s forwards;
    position: absolute;
    right: 0;

    border-radius: 3px;
    width: auto;

    padding: calc(var(--flow-gap) / 4) var(--flow-gap);

    &.flash-success {
        background-color: var(--color-status-intime);
        color: var(--color-light);
    }
}

.button {
    display: inline-block;
    background-color: var(--color-passive);
    color: var(--color-dark);
    padding: 0.5em 2.5em;
    border-radius: 0.5em;
    text-decoration: none;
    /*border: 0.2em solid var(--color-passive-light);*/
    border: 0;
    transition: all 0.2s;

    &:hover {
        background-color: color-mix( in srgb, var(--color-passive) 85%, white );
    }

    &.button-small {
        border-width: 0;
        background-color: color-mix( in srgb, var(--color-brand) 50%, white);
        border-radius: 0.2em;
        padding: 0.2em 0.5em;
        text-decoration: none;
        transition: 0.2s all;

        &:hover,
        &.current {
            background-color: color-mix(in srgb, var(--color-brand) 25%, white);
            color: var(--color-brand);
        }
    }

    &.button-cta {
        background-color: var(--color-brand);
        color: var(--color-light);
        text-transform: uppercase;
        font-weight: bold;

        &:hover {
            background-color: color-mix( in srgb, var(--color-brand) 85%, white );
        }
    }

    &.button-danger {
        background-color: var(--color-status-missing);
        color: var(--color-light);

        &:hover {
            border-color: color-mix( in srgb, var(--color-status-missing) 25%, white);
        }
    }

    &.button-okay {
        background-color: var(--color-status-intime);
        color: var(--color-light);
    }

    &.button-narrow {
        padding-inline: 0.5em;
    }

    &.button-large {

        padding-block: 1em;
        border-width: 0.5em;
        border-radius: 1em;
        font-size: 1.5em;
    }

    &:hover {
        border-color: color-mix( in srgb, var(--color-brand) 25%, white);
        cursor: pointer;
    }
}

.project-card {

    aspect-ratio: 177/240;
    background-color: var(--color-passive-light);
    border-radius: calc(var(--flow-gap) / 4);
    position: relative;

    width: 15.2rem;
    padding: var(--flow-gap);

    transition: all 0.2s;

    box-shadow: 0 2px 3px rgba(150,150,150, 0.2);
    
    @media screen and (max-width: 33rem) {
        width: 100%;

        aspect-ratio: auto;
    }

    @media screen and (max-width: 17rem) {
        .intervals-wrapper {
            display: none;
        }
    }

    &:hover {
        /*background-color: color-mix( in srgb, var(--color-passive-light) 50%, white);*/
        box-shadow: 0 2px 7px rgba(150,150,150, 0.5);
        transform: translateY(-1px);

        .card-batch {
            /*top: -3px;*/
            /*background-color: color-mix( in srgb, var(--color-medium-gray) 85%, white);
            border-radius: 1.5rem;
            transform: scale(1.4);*/
        }
    }

    .project-name {
        width: 10rem;
        color: var(--color-dark);
        text-decoration: none;
        font-weight: 700;

    }

    .card-batch {
        position: absolute;
        top: -2px;
        right: calc(var(--flow-gap) / 2);
        
        background-color: var(--color-medium-gray);
        border-radius: 2px 2px 1.5rem 1.5rem;

        width: 3rem;
        height: 3rem;

        font-weight: 700;
        color: var(--color-light);
        font-size: 1.5rem;

        transition: 0.2s all;

        &.batch-status-good {
            background-color: var(--color-status-intime);
        }

        &.batch-status-sus {
            background-color: var(--color-status-suspicious);
        }

        &.batch-status-bad {
            background-color: var(--color-status-missing);
        }
    }

    .bar-wrapper {
        height: 6.5rem;
        background-color: var(--color-status-waiting);
        border-radius: 3px;
        position: relative;
        overflow: hidden;

        &.status-missing {
            border: 2px dotted var(--color-status-missing);
            background:none;
        }

        &.status-late {
            background: var(--color-status-late);
        }

        &.status-lateping {
            background: var(--color-status-lateping);
        }

        &.status-placeholder {
            width: 1rem;
            background-color: rgb(245,245,245);
        }

        > .time-bar {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            background-color: var(--color-status-intime);
        }
    }

    .status-icon {
        &.status-missing {
            color: var(--color-status-missing);
        }

        &.status-late {
            color: var(--color-status-late);
        }

        &.status-lateping {
            color: var(--color-status-lateping);
        }

        &.status-intime {
            color: var(--color-status-intime);
        }

        &.status-waiting,
        &.status-new {
            color: var(--color-status-waiting);
        }
    }

    &.card-addproject {
        color: var(--color-dark);
        text-decoration: none;
    }
}

.composition-sidebar {
    display: grid;
    grid-template-columns: 30ch 1fr;
}

.brand-bar {
    background-color: var(--color-brand);
    color: white;
    padding-block: var(--flow-gap);
}

.features-table {
    margin: auto;

    th, td {
        padding: calc(var(--flow-gap) / 4) var(--flow-gap);
    }

    td {
        text-align: center;
    }

    tbody th {
        text-align: right;
    }
}

.form-group {
    display: flex;
    flex-direction: column;

    input,
    select,
    textarea {
        background-color: var(--color-passive-light);
        border: 1px solid var(--color-medium-gray);
        border-radius: 3px;
        padding: calc(var(--flow-gap) / 4) calc(var(--flow-gap) / 2);
    }
    select {
        padding-block-start: calc(var(--flow-gap) / 16 * 5);

        &.has-empty-option {
            > option:first-child {
                color: #ccc;
            }
        }
    }
    input[type='checkbox'] {
        width: 1.5em;
        height: 1.5em;
    }
}

/* utilities */

.wrapper {
    --content-width: 80rem;
    --inline-spacer: 1rem;
    
    width: min( var(--content-width), 100% - (2 * var(--inline-spacer)));
    margin-inline: auto;

    &.--padded {
        padding-block: 1rem;
    }
}
.hidden {
    display: none;
}

.relative {
    position: relative;
}

.flex {
    display: flex;
    flex-direction: row;

    &.flex-column {
        flex-direction: column;
    }

    &.flex-center {
        align-items: center;
        justify-content: center;
    }

    &.flex-block-center {
        align-items: center;
    }

    &.flex-inline-center {
        justify-content: center;
    }

    &.flex-inline-justify {
        justify-content: space-between;
    }
    
    &.flex-inline-end {
        justify-content: end;
    }

    &.flex-gap {
        gap: var(--flow-gap);

        &.tiny-gap {
            gap: calc(var(--flow-gap) / 4);
        }
    }

    &.flex-wrap {
        flex-wrap: wrap;
    }

    &.flex-row-reverse {
        flex-direction: row-reverse;
    }
}

.full-height {
    height: 100%;
}

.double-column > * {
    @media screen and (min-width: 30rem) {
        flex-basis: 50%
    }
}

.double-column.double-column__25-75 > *:first-child {
    @media screen and (min-width: 30rem) {
        flex-basis: 33%
    }
}
.double-column.double-column__25-75 > *:not(:first-child) {
    @media screen and (min-width: 30rem) {
        flex-basis: 66%;
    }
}

.half-width {
    @media screen and (min-width: 30rem) {
        width: 50%;
    }
}

.flow > * + * {
    margin-top: var(--flow-gap);
}

.link-unstyled {
    text-decoration: none;
    color: inherit;
}

.list-unstyled {
    list-style: none;
    padding:0;
}

.site-homelink {
    line-height: 0;
    color: white;

    @media screen and (max-width: 430px ) {
        svg {
            height: 1em;
        }
    }
}

.layout-sidebar {
    display: grid;
    grid-template-columns: 32ch 1fr;
    height: 100%;

    > aside {
        background-color: #efefef;

        z-index: 1;
    }
}

aside ol {
    list-style:none;
    padding: 0;
    margin-inline: .5rem;
    margin-block: 0;

    li {
        display: block;

        &:not(:last-child) {
            margin-block-end: .3em;
        }

        a {
            display: block;
            padding-inline: .5em;
            padding-block: 0.3em;
            transition: background-color 0.1s;
            border-radius: 0.25em;
            text-decoration: none;
            color: black;
            display:flex;
            justify-content: space-between;
            align-items: center;

            &:hover {
                background-color: rgba(255,255,255,0.5);
            }

            &.current {
                font-weight: bold;
                background-color: white;

            }

            .statusicon-wrapper {
                display:flex;
                width:2rem;
                padding:.5rem 0 .5rem .5rem;
                flex-shrink: 0;

                &.status-good {
                    color: var(--color-status-intime);
                }
                &.status-sus {
                    color: var(--color-status-suspicious);
                }
                &.status-bad {
                    color: var(--color-status-missing);
                }
            }

        }
    }
}
.counter-bubble {
    background-color: rgba(55,55,55,0.6); /*#373737;*/
    color: white;
    border-radius: 1em;
    font-size: 0.8em;
    padding-inline:0.5em;
    text-decoration: none;
}
