@font-face {
    font-family: "Hack";
    src: local("Hack Regular"), url("ttf/Hack-Regular.ttf");
}

:root {
    --base: #1e1e2e;
    --mantle: #181825;
    --crust: #11111b;
    --text: #cdd6f4;
    --subtext0: #a6adc8;
    --subtext1: #bac2de;
    --surface0: #313244;
    --surface1: #45475a;
    --surface2: #585b70;
    --overlay0: #6c7086;
    --blue: #89b4fa;
    --green: #a6e3a1;
    --red: #f38ba8;
    --yellow: #f9e2af;
    --lavender: #b4befe;
    --mauve: #cba6f7;
    --teal: #94e2d5;
    --pink: #f5c2e7;
    --peach: #fab387;
}

* {
    box-sizing: border-box;
}

html {
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: "Hack", monospace;
    background-color: var(--mantle);
    color: var(--text);
}

body {
    height: 100%;
    margin: 0;
    padding: 2vh;
}

#main {
    height: 100%;
    width: 100%;
    background-color: var(--base);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 2vh;
}

#search {
    width: 80%;
    text-align: center;
    padding: 0.75rem;
    margin: 1rem 0;
    font-size: 1rem;
    color: var(--text);
    background-color: var(--surface0);
    border: 1px solid var(--surface0);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

#search:focus {
    border-color: var(--blue);
    box-shadow: 0 0 5px var(--blue);
    border-color: var(--lavender);
}

#categories {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    row-gap: 100px;
    height: 100%;
    width: 100%;
    overflow-y: auto;
    padding: 1rem;
}

.category {
    background-color: var(--surface0);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    width: 200px;
    overflow: hidden;
}

.category:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
}

.category-header {
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--surface0), var(--surface1));
    color: var(--crust);
    border-bottom: 1px solid var(--surface2);
    position: relative;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s ease;
}

.category-header:hover {
    background: linear-gradient(135deg, var(--surface1), var(--surface2));
}

.category-header .hint {
    background: var(--crust);
    color: var(--blue);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
}

.collapsed .links {
    display: none;
}

.links {
    padding: 8px 0;
}

.link {
    display: block;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: var(--text);
    background-color: var(--surface1);
    border-top: 1px solid var(--surface2);
    position: relative;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.link:hover {
    background-color: var(--surface2);
}

.hint {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--crust);
    color: var(--lavender);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    display: none;
    z-index: 10;
}

.hint-mode .hint {
    display: block;
}

mark {
    background-color: var(--yellow);
    color: var(--base);
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 500;
}

.faint {
    opacity: 0.3;
}

/* Scrollbar container */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

/* Scrollbar track (background) */
::-webkit-scrollbar-track {
    background: var(--base);
    border-radius: 10px;
}

/* Scrollbar thumb (draggable part) */
::-webkit-scrollbar-thumb {
    background-color: var(--surface2);
    border-radius: 10px;
    border: 2px solid var(--base); /* Same as track to create inner padding */
}

/* Scrollbar thumb on hover */
::-webkit-scrollbar-thumb:hover {
    background-color: var(--overlay0);
}
