
/* Core variables (sharp black & white theme) */
:root {
    --accent: #ffffff; /* primary text/accent */
    --bg: #000000; /* page background (pure black)
                                        keep pure black for the page but give components a subtle lift */
    --card: #080808; /* slightly lighter than page for subtle contrast */
    --muted: #d0d0d0;
    --radius: 0px; /* sharp edges */
    --success: #ffffff;
    --tag: #0b0b0b; /* tag background slightly lifted */
    --border: rgba(255,255,255,0.06);
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', monospace;
}

/* Page layout */
html,
body {
    height: 100%;
}

body {
    margin: 0;
    padding: 24px;
    color: #ffffff;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

/* Header */
header {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

h1 {
    margin: 0;
    font-size: 18px;
    color: var(--accent);
}

/* Controls */
.controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
}

.search,
.search-rg {
    background: var(--card);
    padding: 8px;
    border-radius: 0;
    display: flex;
    gap: 8px;
    align-items: center;
    border: 1px solid var(--border);
}

input[type='text'],
textarea {
    background: transparent;
    border: none;
    color: inherit;
    outline: none;
    font-size: 14px;
    width: 320px;
}

textarea {
    min-height: 44px;
    resize: vertical;
}

/* Filters */
#filterContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: var(--tag);
    padding: 6px 10px;
    border-radius: 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    border: 1px solid var(--border);
}

.tag.active {
    background: var(--accent);
    color: #000;
}

/* Cards */
#cardContainer {
    display: grid;
    /* increase min width to make cards wider (approx. double) */
    grid-template-columns: repeat(auto-fill, minmax(640px, 1fr));
    gap: 28px;
    margin-top: 18px;
}

.card {
    /* keep card background same as page so contrast comes from code blocks */
    background: var(--bg);
    padding: 14px;
    border-radius: 0;
    box-shadow: none;
    border: 1px solid var(--border);
}

.card h2 {
    margin: 0 0 8px 0;
    color: var(--accent);
    font-size: 15px;
}

.meta {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

/* codeblock style: provides the subtle contrast requested */
.regex {
    display: block;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--mono);
    background: var(--card);
    padding: 10px 12px;
    color: var(--accent);
    font-size: 13px;
    border: 1px solid var(--border);
    cursor: pointer;
    margin-top: 6px;
    white-space: pre-wrap;
    word-break: break-word;
}

.example {
    /* match codeblock style so examples also sit in a lifted code block */
    display: block;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--mono);
    background: var(--card);
    padding: 10px 12px;
    color: var(--accent);
    font-size: 13px;
    border: 1px solid var(--border);
    cursor: pointer;
    margin: 6px 0 0 0;
    white-space: pre-wrap;
}

.revision-button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 0;
    cursor: pointer;
}

/* spacing for inherit tags and separation from revision button */
.inherit_tag {
    margin-right: 8px;
    margin-top: 6px;
    display: inline-block;
}

.card .revision-button {
    margin-top: 12px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card);
    padding: 18px;
    border-radius: 0;
    max-width: 720px;
    width: 92%;
    color: var(--muted);
    border: 1px solid var(--border);
}

.close {
    float: right;
    color: var(--muted);
    cursor: pointer;
}

#notification,
#notification_example {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--accent);
    color: #000;
    padding: 10px;
    border-radius: 0;
    display: none;
    border: 1px solid var(--border);
}

@media (max-width: 640px) {
    input[type='text'] {
        width: 160px;
    }

    #cardContainer {
        grid-template-columns: 1fr;
    }
}

/* Small helpers for future pages */
.muted {
    color: var(--muted);
}

.kbd {
    background: #071021;
    border-radius: 6px;
    padding: 4px 6px;
    font-family: var(--mono);
    font-size: 12px;
}
