@import url("https://fonts.googleapis.com/css2?family=Outfit&display=swap");

:root {
    --accent: #da86eb;
    --accent-darker: #cf67e4;
    --background: #f2efe9;
    --background-2: #f9f9f9;
    --border: #ddd9d2;
    --text: #000;
    --link: rgb(0, 101, 252);
}

@media (prefers-color-scheme: dark) {
    :root {
        --accent: #c860dd;
        --accent-darker: #be41d7;
        --background: #1e1f20;
        --background-2: #282828;
        --border: #3a3e41;
        --text: #fff;
        --link: rgb(64, 139, 251);
        color-scheme: dark;
    }
}

* {
    font-family: inherit;
    accent-color: var(--accent-darker);
}

body {
    margin: 0;
    font-family: Outfit, sans-serif;
    background-color: var(--background);
    color: var(--text);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 5em 0;
    box-sizing: border-box;
}

.center-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
}

.center-container h1 {
    font-size: 5rem;
    margin: 0;
}

.center-container p {
    font-size: 1.5rem;
    margin: 0;
}

.center-container p:nth-of-type(1) {
    color: var(--accent);
}

footer {
    text-align: center;
    font-size: 1rem;
    padding: 20px;
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer span:not(:first-child)::before {
    content: '- ';
}

a:hover {
    text-decoration: underline;
}

/* admin panel */
#adminPanel {
    width: 100%;
    max-width: 1200px;
}

.auth-section {
    padding: 20px;
    border-radius: calc(2rem + 20px);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.auth-section button {
    width: 100%;
}

input[type="password"],
input[type="text"],
input[type="url"],
textarea {
    padding: 8px;
    width: 100%;
    margin: 5px 0 15px;
    border: 2px solid var(--border);
    border-radius: 2rem;
    outline: none;
    box-sizing: border-box;
    font-size: inherit;
}

input[type="password"]:focus-visible,
input[type="text"]:focus-visible,
input[type="url"]:focus-visible {
    border-color: var(--accent);
}

textarea {
    border-radius: 1rem;
    width: 100%;
    min-width: 500px;
}

button {
    background-color: var(--accent);
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-size: inherit;
}

button:hover {
    background-color: var(--accent-darker);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 8px;
    text-align: left;
    max-width: 300px;
    text-overflow: ellipsis;
    overflow: hidden;
}

td a {
    color: var(--link);
    text-decoration: none;
}

tr:nth-child(even) {
    background-color: var(--background-2);
}

td:nth-child(2) a {
    color: inherit;
}

th:not(:nth-child(3)) {
    width: 0;
}

td {
    border: solid 2px var(--border);
    border-style: none solid solid none;
}

tr:first-child td:first-child {
    border-top-left-radius: 1em;
}

tr:first-child td:last-child {
    border-top-right-radius: 1em;
}

tr:last-child td:first-child {
    border-bottom-left-radius: 1em;
}

tr:last-child td:last-child {
    border-bottom-right-radius: 1em;
}

tr:first-child td {
    border-top-style: solid;
}

tr td:first-child {
    border-left-style: solid;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

#addLinkForm,
#massImportForm {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: hsla(0, 0%, 0%, 0.5);
    z-index: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.form {
    background-color: var(--background);
    box-sizing: border-box;
    padding: 1.5em;
    border-radius: 2.5em;
}

.form h3 {
    margin-top: 0;
}

.form .actions,
td .actions {
    margin: 0;
    width: fit-content;
}

#tableWrapper {
    overflow-x: auto;
    margin: 0 1em;
    border-radius: 1em;
}

#searchInput {
    display: block;
    margin: 15px auto;
    width: 300px;
}

#searchInput:not(:placeholder-shown)~#linksTable tbody tr td,
#tableWrapper:has(#searchInput:not(:placeholder-shown)) {
    border-radius: 0 !important;
}

#searchInput:not(:placeholder-shown)~#linksTable {
    border-collapse: collapse;
}

#searchInput:not(:placeholder-shown)~#linksTable tbody tr td {
    border-style: solid;
}

.hidden {
    display: none !important;
}

@media screen and (max-width: 930px) {
    body {
        align-items: normal;
        padding: 3em 0;
    }

    .form {
        border-radius: 0;
        border: unset;
        height: 100%;
        width: 100%;
    }

    .center-container h1 {
        font-size: 3.5em;
    }
}

.warning-box {
    background: #fff3cd;
    padding: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #ffc107;
}

@media (prefers-color-scheme: dark) {
    .warning-box {
        background: rgb(61, 46, 0);
        border-color: rgb(176, 132, 0);
    }
}