:root {
    --info-panel-padding: .75rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #476386 0%, #152b27 100%);
    min-height: 100vh;
    color: white;
    font-size: .9vw;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2em;
}

.header {
    text-align: center;
    margin-bottom: 3em;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 0.5em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2em;
    margin-bottom: 2em;
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}

.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2em;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.progress-section h2 {
    font-size: 1.5em;
    margin-bottom: 1em;
    text-align: center;
}

.progress-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    height: 30px;
    overflow: hidden;
    margin-bottom: 1em;
    position: relative;
}

.progress-bar {
    background: linear-gradient(90deg, #4ade80, #22c55e);
    height: 100%;
    border-radius: 50px;
    transition: width 1s ease-in-out;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.3);
}

.goal-info {
    display: flex;
    justify-content: space-between;
    margin-top: 1em;
    font-size: 0.9em;
    opacity: 0.8;
}

.donations-section h2 {
    font-size: 1.5em;
    margin-bottom: 1em;
    text-align: center;
}

.donations-section {
    position: relative;
}

#donationsList {
    position: relative;
}

.donation-item {
    box-sizing: border-box;
    font-size: .85em;
    margin-bottom: 1em;
    animation: slideIn 0.5s ease-out;
    transition: transform 0.4s cubic-bezier(.4, 0, .2, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        max-height: 0px;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

.donation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25em;
}

.donor-name {
    font-weight: 600;
    font-size: .85em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    overflow: hidden;
    flex-grow: 1;
}

.donation-amount {
    font-weight: 700;
    color: #4ade80;
    font-size: 1em;
    word-wrap: none;
}

.amount {
    font-weight: 700;
    color: #4ade80;
    font-size: 1em;
    word-wrap: none;
    flex-grow: 0;
}

.donation-comment {
    font-style: italic;
    font-size: .85em;
    opacity: 0.8;
    margin-bottom: 0.3em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    overflow: hidden;
}

.donation-time {
    font-size: 0.8em;
    opacity: 0.6;
}

.donationCount {
    text-align: center;
    opacity: 0.7;
    margin-top: .75em;
    font-size: .75em;
}

.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #8c1919;
    padding: 1em;
    border-radius: 12px;
    text-align: center;
}

.settings {
    position: fixed;
    top: 20px;
    right: 20px;
}

.settings input {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.5em;
    color: white;
    width: 120px;
}

.settings input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#updateIndicator {
    transition: opacity .15s;
}

#sliced-grid-container {
    width: 100%;
}

.main-view {
    max-width: 100vw;
    max-height: 100vh;
    padding: 1em;
    margin: auto;
    display: grid;
    grid-template-columns: 1fr 10%;
    grid-template-rows: 1fr;
    grid-column-gap: 1em;
    grid-row-gap: 0px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    touch-action: manipulation;
}

.info-panel {
    background-color: white;
    color: #222730;
    padding: var(--info-panel-padding, .75rem);
    display: grid;
    grid-template-rows: auto 3fr 2fr auto;
    gap: var(--info-panel-padding, .75rem);
    align-items: center;

    .logo {
        max-width: 100%;
    }

    .info-panel-section {
        width: 100%;
    }
}

#fullscreen-button {
    position: fixed;
    bottom: 0;
    left: 0;
    border: none;
    padding: 0px;
    padding-bottom: 2px;
    width: 1em;
    height: 1em;
    font-size: 1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff63;
    background: transparent;
}

#update-progress-circle {
    --progress-deg: 0deg;
    position: fixed;
    bottom: .1em;
    left: 1.1em;
    width: .8em;
    height: .8em;
    border-radius: 50%;
    background: conic-gradient(transparent 0deg var(--progress-deg), #ffffff63 var(--progress-deg) 360deg);
}

.donation-link {
    margin-top: 1em;

    a {
        font-size: .75em;
        text-decoration: none;
        color: #222730 !important;
        text-align: center;
        margin-top: .75em;
        display: block;
        letter-spacing: -2%;
    }
}

.qr-code-container {
    width: 100%;

    img {
        width: 100%;
        height: auto;
    }
}

.plus-heart {
    font-size: .75em;
    font-weight: normal;
    opacity: .5;
    display: none;
    /*not yet shown*/
}

.info-text {
    text-align: center;
    margin-inline: calc(var(--info-panel-padding, .75rem) * -1);
    padding: var(--info-panel-padding, .75rem);
    background-color: #d8e2ef;
}

section.progress {
    display: grid;
    justify-content: flex-start;
    align-items: center;
    grid-template-columns: auto 1fr;
    gap: var(--info-panel-padding);
    height: 100%;
}

.progress-text-container {
    font-size: .85em;
    display: flex;
    flex-direction: column;
    gap: .75rem
}

.progress-text,
.tiles-progress-text {
    text-align: left;
}

.vertical-progress-bar-container {
    width: 1.5em;
    height: 100%;
    min-height: 6em;
    background-color: #e5e7eb;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 1.5em;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    box-shadow:
        .125em .25em .5em rgba(0, 0, 50, .2)
        /* outer shadow */
        ,
        inset .125em .25em .5em rgba(0, 0, 50, .2)
        /* inner shadow */
        ,
        inset -.25em -.25em .25em rgba(255, 255, 255, 0.8)
        /* inner glow */
    ;
}

#vertical-progress-bar {
    width: 100%;
    background: linear-gradient(180deg, #4ade80, #22c55e);
    transition: height 1s ease-in-out;
    border-bottom-right-radius: 1.5em;
    border-bottom-left-radius: 1.5em;
    border-top-left-radius: .5em;
    border-top-right-radius: .5em;
    box-shadow:
        inset -.25em 0 .5em rgba(0, 0, 50, .2)
        /* inner shadow */
        ,
        inset .25em 0 .25em rgba(255, 255, 255, 0.3)
        /* inner glow */
    ;

    &.full {
        background:
            linear-gradient(30deg,
                rgb(255, 0, 0) 0%,
                rgb(255, 154, 0) 10%,
                rgb(208, 222, 33) 20%,
                rgb(79, 220, 74) 30%,
                rgb(63, 218, 216) 40%,
                rgb(47, 201, 226) 50%,
                rgb(28, 127, 238) 60%,
                rgb(95, 21, 242) 70%,
                rgb(186, 12, 248) 80%,
                rgb(251, 7, 217) 90%,
                rgb(255, 0, 0) 100%) !important;
        animation: scroll-gradient 5s linear infinite;
    }
}

@keyframes scroll-gradient {
    from {
        background-position-y: 0;
    }

    to {
        background-position-y: 100%;
    }
}

#sliced-grid-container {
    max-width: 100%;
    max-height: 100%;
}

.grid-container {
    display: grid;
    width: 100%;
    height: 100%;
    position: relative;
    top: 0;
    left: 0;
    box-sizing: border-box;
    margin: 0 auto;
    background-color: rgba(0, 0, 0, 0.091);
    background-size: cover;
}

.tile {
    box-sizing: border-box;
    transition: all 1.5s ease, scale .5s, border-radius .5s;
    outline: 2em solid white;
    outline-offset: 5em;
    opacity: 0;

    background-repeat: no-repeat;
    background-size: 100% 100%;

    &[data-revealed="true"] {
        opacity: 1;
        box-shadow: none;
        outline: 1px solid transparent;
        outline-offset: 0px;

        &:hover,
        &:focus-visible {
            scale: 10;
            z-index: 10;
            border-radius: 5%;
            transition-delay: .5s;
            transition-duration: scale .3s, border-radius .3s;
        }
    }
}

@media screen and (aspect-ratio < 1.5) {
    .main-view {
        aspect-ratio: unset;
        display: flex;
        flex-direction: column;
    }

    .info-panel {
        grid-template-rows: auto;
        grid-template-columns: 1fr 1fr 1fr 1fr;

        .logo {
            height: 1.5rem;
        }
    }
}