:root {
    --navigation-bar-height: 60px;
}

body {
    margin: 0;
    padding: 0;
    background-color: black;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: system-ui;
    user-select: none;
}

html {
    overflow: auto;
    scroll-snap-type: y mandatory;
    overscroll-behavior-y: contain;
    scroll-behavior: smooth;

    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

footer {
    opacity: 0.8;
    font-size: 0.8rem;
}

/* Generic elements */
button, input[type="text"] {
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
}

button {
    background-color: rgb(255, 0, 144);
    color: white;
    border: none;
    display: flex;
    flex-direction: row;
    gap: 5px;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

button > img {
    display: block;
    flex: 0 0;
    height: 1.3rem;
    aspect-ratio: 1/1;
}

/* Icon only button */
button:has(img) {
    padding: 5px;
}

/* Icon + text button */
button:has(img):has(span) {
    padding: 5px 10px 5px 5px;
}

button.destructive {
    background-color: rgba(255, 49, 49, 0.2);
}

input[type="text"] {
    background-color: rgb(234, 234, 234);
}

:focus-visible {
    outline: 3px rgb(255, 0, 144) solid;
}

button:not(.share):focus-visible {
    outline: 3px rgb(52, 13, 35) solid;
}

.fill-height {
    height: 100%;
}

.fake-tabs {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 2px;
    z-index: 1;

    height: 3rem;
    width: fit-content;
    padding: 0px 50px;
    background-image: radial-gradient(ellipse at top, rgba(0, 0, 0, 0.8) 0, rgba(0, 0, 0, 0) 70%);
}

.fake-tabs button {
    background-color: transparent;
    border: none;
    color: white;
    flex: 1 1 0px;
    text-align: center;
    display: flex;
    align-items: center;
    overflow-x: visible;
    height: 100%;
    white-space: nowrap;
}

.fake-tabs button:disabled {
    cursor: not-allowed;
}

.vertical-divider {
    background-color: rgba(255, 255, 255, 0.5);
    width: 2px;
    height: 30%;
    border-radius: 99px;
}

.blur-effect-container {
    display: flex;
    aspect-ratio: 9/16;
    box-sizing: border-box;

    min-height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    overflow: hidden;
    border-radius: 25px;

    position: fixed;
    top: 0;

    filter: blur(100px);

    pointer-events: none;
}

.blur-effect-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    transition: opacity 0.5s ease-in-out;
}

nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    gap: 10px;
    align-content: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 8px;

    left: 0px;
    top: 0px;
    width: var(--navigation-bar-height);
    display: flex;
}

.navigation-item {
    appearance: none;

    background-color: transparent;
    border: none;

    color: white;
    text-decoration: none;
    font-size: 0.8rem;

    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;

    gap: 5px;
}

/* Navigate pages with css */
/* Hide pages by default */
.page {
    visibility: hidden;
    scroll-padding-top: 0px;
}

/* Show page when it is targeted */
.page:target {
    visibility: visible;
}

#you {
    position: fixed;
    display: flex;
    flex-direction: column;
    background-color: white;
    width: 100%;
    height: 100%;
    top: 0px;
    left: 0px;
    padding: 25px;
    padding-left: calc(var(--navigation-bar-height) + 25px);
    box-sizing: border-box;
    overflow-y: auto;
    scrollbar-color: black white;
}

#addAccountForm {
    display: flex;
    flex-direction: row;
    gap: 5px;
    margin-bottom: 10px;
}

#addAccountForm input {
    width: 100%;
    flex-shrink: 1;
}

#followingList {
    margin: 0px;
    padding: 0px;
    list-style: none;
    border-radius: 20px;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    gap: 1px;
}

#followingList > li {
    background-color: rgb(243, 243, 243);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 2px;
}

body:has(#you:target) nav {
    background-color: white;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

body:has(#you:target) nav .navigation-item {
    filter: invert(100%);
}

/* Change icon states */
/* Hide filled icons by default */
.filled-icon {
    display: none;
}

/* You page */
body:has(#you:target) nav a[href="#you"] > img {
    display: none;
}

body:has(#you:target) nav a[href="#you"] > .filled-icon {
    display: block;
}

/* Home page */
body:has(#home:target) nav a[href="#home"] > img {
    display: none;
}

body:has(#home:target) nav a[href="#home"] > .filled-icon {
    display: block;
}

#feed {
    box-sizing: border-box;

    height: max-content;
    min-height: 100vh;
    /* min-height: calc(100vh - var(--navigation-bar-height));
    max-height: calc(100vh - var(--navigation-bar-height)); */

    max-width: 100vw;

    display: flex;
    flex-direction: column;
    gap: 25px;

    margin-bottom: 0px;

    color: white;
}

#feed:has(.center) {
    margin-bottom: 0px;
}

.center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    padding: 25px;
    box-sizing: border-box;
}

article {
    box-sizing: border-box;
    border: 1px rgba(255, 255, 255, 0.2) solid;
    position: relative;
    aspect-ratio: 9/16;
    min-height: 100vh;
    max-width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    border-radius: 25px;
    overflow: hidden;
    flex: 0 0;
}

article > img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

article .content {
    position: absolute;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;

    background-image: linear-gradient(transparent, black);
    padding: 20px;
    padding-right: 65px;
    color: white;
    user-select: text;
}

article .content .profile-link {
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

article .fake-actions {
    position: absolute;
    right: 0;
    top: 0;
    width: 65px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 25px;
    padding: 20px 5px;
    box-sizing: border-box;
}

.fake-actions li {
    width: 100%;
    position: relative;
}

.fake-actions button {
    border: 0;
    background-color: transparent;
    width: 100%;
    height: 100%;
    aspect-ratio: 1/1;
    padding: 0;
}

.fake-actions button > img {
    flex: unset;
    height: 80%;
    width: 80%;
    pointer-events: none;
}

.fake-actions button img,
.fake-actions .fake-like img {
    filter: drop-shadow(0px 0px 10px black);
    width: 100%;
}

.fake-actions .like {
    appearance: none;
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: 1;
    margin: 0;
}

.fake-actions li:has(.like:checked) img {
    filter: brightness(0) saturate(100%) invert(21%) sepia(72%) saturate(7198%) hue-rotate(350deg) brightness(90%) contrast(95%);
    animation: like 0.4s cubic-bezier(.1, .96, .55, 1.1);
}

.fake-actions .like:checked::before {
    content: url(/assets/likeGlow.svg);
    width: 100%;
    height: 100%;
    position: absolute;
    animation: like-glow 0.5s ease-out forwards;
}

@keyframes like {
    from {
        transform: scale(15%);
    }

    to {
        transform: scale(100%);
    }
}

@keyframes like-glow {
    from {
        transform: scale(0.2);
        opacity: 1;
    }

    to {
        transform: scale(1.5);
        opacity: 0;
    }
}

.like-ripple {
    opacity: 0;
    width: 12vh;
    position: fixed;
    pointer-events: none;
    display: block;
    filter: brightness(0) saturate(100%) invert(21%) sepia(72%) saturate(7198%) hue-rotate(350deg) brightness(90%) contrast(95%);
    animation: like-ripple 0.8s cubic-bezier(0.075, 0.82, 0.165, 1) forwards;
}

@keyframes like-ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1.5);
        opacity: 0.8;
    }

    100% {
        transform: translateY(-200%);
        opacity: 0;
    }
}

.profile-picture {
    display: flex;
    flex-grow: 0;
    flex-shrink: 0;

    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 999px;
    border: 2px white solid;
    box-sizing: border-box;
}

.profile-picture.turntable {
    border: 10px rgba(134, 87, 0, 0.5) solid;
    animation: turn 5s infinite linear;
}

@keyframes turn {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.scroll-aid-buttons {
    position: fixed;
    left: calc(0.5 * (100vw - (900vh / 16)) + (900vh / 16));
    top: 0;
    height: 100vh;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    gap: 8px;
    box-sizing: border-box;
}

.scroll-aid-buttons button {
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    width: 50px;
    height: 50px;
    margin: 0;
    padding: 10px;
    border-radius: 999px;
}

/* Don't mess with js press targets */
button:has(> img) {
    display: flex;
    justify-content: center;
    align-items: center;
}

a {
    color: white;
}

/* Custom color for you page */
#you a {
    color: rgb(0, 85, 255);
}

a:hover,
button:hover,
li:has(.like:hover) .fake-like {
    opacity: 0.8;
}

a:active,
button:active,
li:has(.like:active) .fake-like {
    opacity: 0.5;
}

@media (max-width: 580px) {
    .scroll-aid-buttons {
        display: none;
    }

    #feed {
        margin-bottom: var(--navigation-bar-height);
    }

    article {
        max-height: calc(100vh - var(--navigation-bar-height));
        min-height: calc(100vh - var(--navigation-bar-height));
    }

    nav {
        width: 100vw;
        height: var(--navigation-bar-height);
        bottom: 0px;
        top: unset;
        flex-direction: row;
        gap: 0px;

        background-color: black;
    }

    .navigation-item {
        width: 100%;
        gap: unset;
    }

    #you {
        padding-left: 25px;
        padding-bottom: calc(var(--navigation-bar-height) + 25px);
    }
}

@media (max-width: 500px) {
    #feed {
        gap: 0;
        width: 100vw;
    }

    article {
        border: none;
        border-radius: 0;
    }

    html {
        scrollbar-width: none;
    }
}