:root {
    --bg: #f8f8f8;
    --fg: #080808;
    --accent: var(--fg);

    --card-bg: #f0f0f0;
    --link-color: #333;

    --pride-gradient: linear-gradient(
        90deg,
        rgba(255, 112, 124, 1) 0%,
        rgba(255, 179, 92, 1) 20%,
        rgba(255, 211, 92, 1) 40%,
        rgba(170, 224, 123, 1) 60%,
        rgba(124, 146, 243, 1) 80%,
        rgba(174, 124, 243, 1) 100%
    );

    --logo-url: url("/assets/logo/text-light.svg");
    --favicon-url: url("/assets/logo/light.svg");
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1e1e1e;
        --fg: #f8f8f8;
        --card-bg: #292929;
        --link-color: #ddd;

        --logo-url: url("/assets/logo/text-dark.svg");
        --favicon-url: url("/assets/logo/dark.svg");
    }
}

html,
body {
    background-color: var(--bg);
    color: var(--fg);
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    font-family: sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.body-index {
    justify-content: center;
}

.body-search {
    justify-content: flex-start;
}

main {
    display: flex;
    flex-direction: column;
}

.main-index {
    max-width: 620px;
    width: min(620px, calc(100% - 32px));
    margin-top: -200px;
    justify-content: space-between;
    text-align: center;
}

.main-search {
    max-width: 900px;
    width: min(900px, calc(100% - 32px));
    align-items: flex-start;
    margin-top: 24px;
}

.logo-big {
    content: var(--logo-url);
    padding-bottom: 50px;
}

.search-wrapper {
    position: relative;
    width: 100%;
    height: 48px;
    &::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 40px;
        background: var(--pride-gradient);
        filter: blur(8px);
        opacity: 0;
        pointer-events: none;
        transition:
            opacity 0.2s ease,
            filter 0.2s ease;
        z-index: 0;
    }
    &:has(.search-bar:hover)::before {
        opacity: 0.4;
    }
    &:has(.search-bar:focus)::before {
        opacity: 1;
        filter: blur(10px);
    }

    .search-form {
        position: relative;
        z-index: 1;
        display: flex;
        width: 100%;
        height: 100%;
        border-radius: 40px;
        background-color: var(--bg);
        box-shadow: 0 0 1px 1px var(--accent);
        overflow: hidden;
        transition: box-shadow 0.1s ease;
        &:has(.search-bar:hover),
        &:has(.search-bar:focus) {
            box-shadow: none;
        }

        .search-bar {
            background-color: var(--bg);
            color: var(--fg);
            padding: 12px;
            margin-left: 18px;
            border: none;
            flex-grow: 1;
            padding-left: 2px;
            &:focus {
                outline: none;
            }
        }

        .search-button {
            background: none;
            border: none;
            display: inline-flex;

            img {
                content: var(--favicon-url);
                box-sizing: border-box;
                height: 36px;
                margin-top: 4px;
                margin-right: 4px;
            }
        }
    }
}

.results {
    padding-top: 20px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;

    .result {
        width: 100%;
        background-color: var(--card-bg);
        padding: 18px 24px;
        box-sizing: border-box;
        border-radius: 15px;

        .result-header {
            width: 100%;
            display: flex;
            flex-direction: row;
            justify-content: start;
            gap: 10px;
            margin-bottom: 2px;

            .result-header-favicon {
                width: 45px;
                height: 45px;
                border-radius: 100%;
            }

            .result-header-pageinfo {
                display: flex;
                flex-direction: column;
                justify-content: center;
            }

            .result-header-link {
                font-size: 12px;
                color: var(--link-color);
            }

            .result-header-name {
                display: flex;
                flex-direction: row;
                justify-content: start;
                gap: 7px;

                .result-header-page {
                    font-size: 24px;
                }

                .result-header-more-info {
                    display: flex;
                    flex-direction: column;
                    justify-content: center;

                    .result-header-author,
                    .result-header-license {
                        font-size: 15px;
                        font-style: italic;
                    }
                }
            }
        }

        .result-title {
            font-size: 24px;
            padding-bottom: 8px;

            .result-title-title {
                font-weight: bold;
            }
        }
    }
}
