/*
 * Copyright (c) The Zephyr Project Contributors
 * SPDX-License-Identifier: Apache-2.0
 *
 * Styles for the POSIX API symbol search page.
 * Mirrors the structure of kconfig.css.
 */

/* -------------------------------------------------------------------------
 * Search input container
 * ---------------------------------------------------------------------- */

#__posix-search .input-container {
    border-radius: 5px;
    border: 1px solid var(--code-border-color, rgba(149, 157, 165, 0.2));
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px !important;
    margin-bottom: 0.5rem;
    width: 100%;
    height: 60px;
    background: var(--input-background-color, #fff);
}

#__posix-search .input-container input {
    border-radius: 5px 0 0 5px;
    font-size: 18px;
    width: 90%;
    height: 100%;
    padding: 0.75rem;
    border: none;
    box-shadow: none !important;
    background: var(--input-background-color, #fff);
    color: var(--body-color, inherit);
}

#__posix-search .input-container input:focus,
#__posix-search .input-container input:active {
    outline: none;
}

#__posix-search .input-container button {
    font-size: 22px;
    border-radius: 0 5px 5px 0;
    float: right;
    width: 10%;
    height: 100%;
    border: none;
    background-color: var(--btn-neutral-background-color, lightgrey);
    color: var(--body-color, inherit);
    cursor: pointer;
}

#__posix-search .input-container button:hover {
    background-color: var(--btn-neutral-hover-background-color, #ddd);
}

#__posix-search select {
    border-radius: 5px;
    border: 1px solid var(--code-border-color, rgba(149, 157, 165, 0.2));
    box-shadow: unset;
    color: var(--body-color, inherit);
    background: var(--input-background-color, #fff);
}

/* -------------------------------------------------------------------------
 * Search tools bar (result count + per-page selector)
 * ---------------------------------------------------------------------- */

#__posix-search .search-tools {
    display: flex;
    flex-direction: row;
    margin: 0.25rem 0.1rem 1.5rem;
}

#__posix-search .results-per-page-container {
    margin-left: auto;
}

#__posix-search .results-per-page-title {
    padding-right: 1rem;
}

/* -------------------------------------------------------------------------
 * Pagination
 * ---------------------------------------------------------------------- */

#__posix-search .search-nav {
    display: flex;
    justify-content: center;
    align-items: center;
}

#__posix-search .search-nav > p {
    padding: 0 1rem;
    margin: 0;
}

/* -------------------------------------------------------------------------
 * Symbol entries  (dl.posix-symbol mirrors dl.kconfig)
 * ---------------------------------------------------------------------- */

.posix-symbol {
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--color-brand-primary, #0083c8);
    padding-left: 0.75rem;
}

.posix-symbol ul {
    margin-bottom: 0 !important;
}

.posix-symbol dt.sig {
    background: var(--code-background-color, var(--color-background-secondary, #f8f9fb));
    border-radius: 4px;
    padding: 0.35rem 0.6rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.posix-symbol a.symbol-name {
    font-family: var(--font-stack--monospace, monospace);
    font-size: 1.05rem;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}

.posix-symbol a.symbol-name:hover {
    text-decoration: underline;
}

.posix-symbol span.symbol-name {
    font-family: var(--font-stack--monospace, monospace);
    font-size: 1.05rem;
    font-weight: 600;
}

/* Kind badges */
.posix-symbol .symbol-kind {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 3px;
    padding: 0.15rem 0.4rem;
    margin-left: 0.4rem;
    color: #fff;
    background: #666;
    flex-shrink: 0;
}

.posix-symbol .kind-fn     { background: #2e8b57; }   /* function  → green */
.posix-symbol .kind-type   { background: #1e5fa8; }   /* type      → blue  */
.posix-symbol .kind-macro  { background: #8b4513; }   /* macro     → brown */
.posix-symbol .kind-struct { background: #555;    }   /* struct    → grey  */
.posix-symbol .kind-union  { background: #555;    }
.posix-symbol .kind-enum   { background: #6a0dad; }   /* enum      → purple*/
.posix-symbol .kind-var    { background: #b8860b; }   /* variable  → gold  */

.posix-symbol a.headerlink {
    margin-left: auto;
    opacity: 0.4;
    font-size: 0.85rem;
    text-decoration: none;
}

.posix-symbol a.headerlink:hover {
    opacity: 1;
}

.posix-symbol dd {
    margin-left: 0;
    padding: 0.4rem 0 0.2rem 0.25rem;
}

.posix-symbol dd > p:first-child {
    margin-top: 0;
}

/* Metadata table inside a symbol entry */
.posix-symbol .field-list.simple dt {
    font-weight: 600;
    min-width: 7rem;
}
