/* Pointercrate-inspired theme */

:root {
    color-scheme: light;

    --font: "Montserrat", sans-serif;
    --header-h: 70px;
    --page-width: 1072px;

    --text: #444446;
    --text-strong: #222222;
    --text-dim: #777777;
    --bg: #ffffff;
    --surface: #ffffff;
    --border: #d3d3d3;
    --border-strong: #999999;

    --link: #0000ff;
    --accent: #0881c6;
    --accent-dark: #076696;
    --accent-soft: #e6eeff;

    --btn-bg: #0881c6;
    --btn-bg-hover: #076696;
    --btn-bg-click: #055075;
    --btn-text: #ffffff;

    --btn-red: #ff003c;
    --btn-red-hover: #ff2457;

    --table-odd: #fefeff;
    --table-even: #e6eeff;
    --table-head: #0881c6;

    --ok-bg: #eeffe4;
    --ok-border: #a8ff93;
    --ok-text: #074d07;

    --error-bg: #ffdddd;
    --error-border: #ff9393;
    --error-text: #4d0707;

    --header-bg: #ffffff;
    --nav-hover: #dddddd;
    --footer-bg: #171921;
    --footer-text: #dddddd;
    --footer-link: #f77e39;

    --shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

main.dark,
body > header.dark,
body > footer.dark {
    color-scheme: dark;

    --text: #e2dfd8;
    --text-strong: #dce6e3;
    --text-dim: #9aa1ad;
    --bg: #121720;
    --surface: #252d3c;
    --border: #393f4e;
    --border-strong: #8a8a8a;

    --link: #1ca4f3;
    --accent: #1ca4f3;
    --accent-dark: #0d7fc0;
    --accent-soft: #1c2230;

    --table-odd: #242c3c;
    --table-even: #1c2230;
    --table-head: #1c2f44;

    --ok-bg: rgba(105, 176, 64, 0.37);
    --ok-border: #a8ff93;
    --ok-text: #f3ffeb;

    --error-bg: rgba(152, 88, 88, 0.72);
    --error-border: rgba(255, 147, 147, 0.56);
    --error-text: #fff7f7;

    --header-bg: #252d3c;
    --nav-hover: #181d27;
    --shadow: 0 0 20px rgba(0, 0, 0, 0.35);
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    padding-top: var(--header-h);

    display: flex;
    flex-direction: column;

    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body:has(main.dark) {
    background: #121720;
}

main {
    flex: 1;
    color: var(--text);
    background: var(--bg);
}

body > header,
body > footer,
main {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* ————— Page shell ————— */

.page {
    width: min(var(--page-width), 100%);
    margin: 0 auto;
    padding: 20px 10px 30px;
}

/* ————— Panel ————— */

.panel {
    margin: 0 0 20px;
    padding: 20px;
    background: var(--surface);
    border: 1px dashed var(--border);
    box-shadow: var(--shadow);
    text-align: center;
}

.panel > h1,
.panel > h2,
.panel > h3 {
    margin-top: 0;
}

.underlined {
    border-bottom: 1px solid var(--border);
}

.underlined.pad {
    padding-bottom: 10px;
}

/* ————— Header / footer ————— */

body > header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    height: var(--header-h);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.header-inner {
    width: min(var(--page-width), 100%);
    height: 100%;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

body > footer {
    flex-shrink: 0;
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 300;
}

.footer-inner {
    width: min(var(--page-width), 100%);
    margin: 0 auto;
    padding: 18px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 24px;
}

body > footer a {
    color: var(--footer-link);
}

body > footer a:hover {
    text-decoration: underline;
}

.footer-note {
    color: #9aa0aa;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 14px;
}

.footer-legal a {
    color: var(--footer-text);
}

.footer-legal a:hover {
    color: #ffffff;
}

/* ————— Search ————— */

.search-field {
    display: flex;
    align-items: center;
    margin: 10px 0;
    border: 1px solid var(--border-strong);
    background: var(--surface);
}

.search-field input {
    flex: 1;
    min-width: 0;
    height: 2.2em;
    margin: 3px;
    padding: 0 6px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
}

.search-field input::placeholder {
    color: var(--text-dim);
}

/* ————— Errors / notes ————— */

.errors {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.error {
    padding: 5px 15px;
    border: 1px solid var(--error-border);
    background: var(--error-bg);
    color: var(--error-text);
    font-size: 0.82rem;
    text-align: center;
}

.empty-note {
    padding: 10px 0;
    color: var(--text-dim);
    font-size: 0.85rem;
    text-align: center;
}

/* ————— Loading ————— */

.spinner {
    min-height: 50vh;
    display: grid;
    place-items: center;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* ————— Misc ————— */

::selection {
    background: rgba(8, 129, 198, 0.25);
    color: var(--text-strong);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border: 3px solid transparent;
    border-radius: 99px;
    background-clip: padding-box;
}

@media (max-width: 860px) {
    body {
        padding-top: 0;
    }

    body > header {
        position: static;
        height: auto;
    }

    .header-inner {
        flex-wrap: wrap;
        padding: 10px;
        gap: 6px 14px;
    }

    .nav {
        order: 3;
        width: 100%;
        height: auto;
        overflow-x: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
