/* Shadcn (Grok-like) Theme for Borvo Apolo */
:root {
    --background: 0 0% 100%;
    --foreground: 0 0% 0%;
    /* Pure black text */
    --card: 0 0% 100%;
    --card-foreground: 0 0% 0%;
    --primary: 0 0% 0%;
    /* Black brand */
    --primary-foreground: 0 0% 100%;
    --secondary: 0 0% 96%;
    /* Very light gray for buttons */
    --secondary-foreground: 0 0% 0%;
    --muted: 0 0% 60%;
    --muted-foreground: 0 0% 60%;
    --border: 0 0% 90%;
    --input: 0 0% 90%;
    --ring: 0 0% 80%;
    --radius: 9999px;
    /* PILL SHAPE GLOBAL */

    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: 0 0% 0%;
        --foreground: 0 0% 100%;
        --card: 0 0% 5%;
        --card-foreground: 0 0% 100%;
        --primary: 0 0% 100%;
        --primary-foreground: 0 0% 0%;
        --secondary: 0 0% 15%;
        --secondary-foreground: 0 0% 100%;
        --muted: 0 0% 40%;
        --muted-foreground: 0 0% 60%;
        --border: 0 0% 20%;
    }
}

/* Global Reset & Typography */
body {
    background-color: hsl(var(--background)) !important;
    color: hsl(var(--foreground)) !important;
    font-family: var(--font-sans) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6 !important;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center vertically like Grok */
}

/* Make results page top-aligned */
body.search_endpoint main {
    justify-content: flex-start;
    align-items: stretch;
}

a {
    color: inherit;
    text-decoration: none;
}

/* LOGO Area (Index) */
.index_endpoint #main_index {
    margin-top: -10vh;
    /* Visual optical adjustments */
    text-align: center;
    width: 100%;
    max-width: 650px;
}

h1,
h2,
h3 {
    font-weight: 600 !important;
    letter-spacing: -0.02em !important;
}

/* Search Box - PILL SHAPE */
.search_box {
    background: hsl(var(--card)) !important;
    border: 1px solid hsl(var(--border)) !important;
    border-radius: 9999px !important;
    /* GROK STYLE */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    /* Subtle uplift */
    padding: 0.75rem 1.5rem !important;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.search_box:focus-within {
    border-color: hsl(var(--primary)) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

#q {
    color: hsl(var(--foreground)) !important;
    font-size: 1.1rem !important;
}

/* Buttons - PILL SHAPE & MINIMAL */
button,
.btn,
input[type="submit"] {
    background-color: hsl(var(--secondary)) !important;
    color: hsl(var(--secondary-foreground)) !important;
    border-radius: 9999px !important;
    /* PILL */
    border: 1px solid transparent !important;
    font-weight: 500 !important;
    padding: 0.6rem 1.25rem !important;
    font-size: 0.9rem !important;
    transition: background 0.2s;
    margin: 0 0.5rem;
}

button:hover,
.btn:hover,
input[type="submit"]:hover {
    background-color: hsl(var(--border));
}

/* Primary Search Button (Hidden or minimal in Grok, usually icon, putting styling here) */
#search_submit {
    background-color: transparent !important;
    color: hsl(var(--primary)) !important;
    padding: 0 !important;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Categories (Tabs) - Minimal Pill or Text */
#categories {
    border: none !important;
    justify-content: center;
    margin-top: 1rem;
    gap: 0.5rem;
}

#categories a {
    border-radius: 9999px !important;
    border: 1px solid hsl(var(--border)) !important;
    padding: 0.4rem 1rem !important;
    color: hsl(var(--muted-foreground)) !important;
    background: transparent !important;
    font-size: 0.85rem !important;
    transition: all 0.2s;
}

#categories a.selected {
    background: hsl(var(--foreground)) !important;
    /* Black active */
    color: hsl(var(--background)) !important;
    /* White text */
    border-color: hsl(var(--foreground)) !important;
}

/* Results Page Tweaks */
.result {
    border: none !important;
    padding: 1.5rem 0 !important;
    border-bottom: 1px solid hsl(var(--border)) !important;
}

.result h3 {
    font-size: 1.25rem !important;
}

/* Footer */
footer {
    padding: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: hsl(var(--muted));
    border: none !important;
}

.borvo-branding {
    font-weight: 500;
    letter-spacing: 0.05em;

    display: block;
}

/* Shadcn Components (Reproduced) */

/* Card Component */
.shadcn-card {
    background-color: hsl(var(--card)) !important;
    border: 1px solid hsl(var(--border)) !important;
    border-radius: 0.75rem !important;
    /* radius-xl */
    padding: 1.5rem !important;
    margin-bottom: 1rem !important;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    /* Extremely subtle */
}

.shadcn-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    border-color: hsl(var(--foreground), 0.2) !important;
}

/* Metadata Badge (Pill) */
.shadcn-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px !important;
    border: 1px solid transparent !important;
    padding: 0.125rem 0.625rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    transition: colors 0.2s focus-visible;
    background-color: hsl(var(--secondary)) !important;
    color: hsl(var(--secondary-foreground)) !important;
    margin-right: 0.5rem;
    margin-top: 0.5rem;
}

.shadcn-badge:hover {
    background-color: hsl(var(--secondary), 0.8) !important;
}

/* Typography Overrides for Cards */
.shadcn-card h3 {
    margin-top: 0 !important;
    font-size: 1.125rem !important;
    line-height: 1.5 !important;
}

.shadcn-card .url {
    font-size: 0.825rem !important;
    color: hsl(var(--muted-foreground)) !important;
    margin-bottom: 0.75rem !important;
    display: block;
}

.shadcn-card .content {
    font-size: 0.925rem !important;
    color: hsl(var(--card-foreground)) !important;
    line-height: 1.6 !important;
}

/* Separator */
.shadcn-separator {
    height: 1px;
    background-color: hsl(var(--border));
    margin: 1.5rem 0;
    width: 100%;
}