:root {
    --bg-color: #262626;
}

:has([data-bs-theme="light"]) {
    --bg-color: #fff;
}

html {
    box-sizing: border-box;
    font-size: 16px;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body, h1, h2, h3, h4, h5, h6, p, ol, ul {
    margin: 0;
    padding: 0;
    font-weight: normal;
}

ol, ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

html, body {
    height: 100%;
}

body {
    background-color: var(--bg-color);
    font-family: PT Sans, sans-serif;
    text-align: left;
    transition: background .3s, color .3s;
}

[x-cloak] {
    display: none;
}

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

.flex-1 {
    flex: 1;
}

.pointer {
    cursor: pointer;
}

.input-plain {
    border: none;
    background: transparent;
    outline: none;
    padding: 0;
    margin: 0;
    resize: none;
    display: block;
    width: 100%;
    appearance: none;
}

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

.loader {
    --size: 28px;
    --color: #fff;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    display: inline-block;
    border-top: 4px solid var(--color);
    border-right: 4px solid transparent;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}
.loader::after {
    content: '';
    box-sizing: border-box;
    position: absolute;
    left: 0;
    top: 0;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    border-left: 4px solid #7a8cff;
    border-bottom: 4px solid transparent;
    animation: rotation 0.5s linear infinite reverse;
}
:has([data-bs-theme="light"]) {
    .loader {
        --color: #ccc;
    }
}
@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* dark-mode-toggle */

#dark-mode-toggle {
    display: none;
}

.dark-mode-toggle {
    --toggle-bg: #94a3b8;
    --toggle-circle: #ffffff;
    display: inline-block;
    width: 36px;
    height: 20px;
    background: var(--toggle-bg);
    border-radius: 30px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.dark-mode-toggle::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--toggle-circle);
    border-radius: 50%;
    transition: transform 0.3s;
}

:has([data-bs-theme="light"]) {
    .dark-mode-toggle {
        --bg-color: #fff;
        --toggle-bg: #475569;
        --toggle-circle: #0f172a;
    }

    .dark-mode-toggle::before {
        transform: translateX(16px);
    }
}
