﻿:root {
    /* Warm Ko-fi palette */
    --gs-primary: #d8bf82; /* sand/gold */
    --gs-primary-dark: #b89e59; /* deeper sand */
    --gs-bg: #faf7f2; /* cream */
    --gs-text: #1f1a17; /* soft near-black */
    --gs-border: #eadfcc; /* warm border */
    --gs-surface: #ffffff;

    /* For rgba() tints */
    --gs-primary-rgb: 216, 191, 130; /* D8BF82 */
    --gs-text-rgb: 31, 26, 23;

    --gs-card-shadow: 0 16px 32px -12px rgba(31, 26, 23, 0.12);
}

body {
    background: var(--gs-bg);
    color: var(--gs-text);
}

.btn-primary {
    background-color: var(--gs-primary);
    border-color: var(--gs-primary);
    color: var(--gs-text);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--gs-primary-dark);
    border-color: var(--gs-primary-dark);
    color: var(--gs-text);
}

.btn-outline-secondary {
    border-color: var(--gs-border);
    color: var(--gs-text);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background-color: rgba(var(--gs-primary-rgb), 0.14);
    border-color: var(--gs-primary);
    color: #3b3127;
}

.card {
    border: 1px solid var(--gs-border);
    border-radius: 1rem;
    box-shadow: var(--gs-card-shadow);
    background: var(--gs-surface);
}

.badge-item {
    font-size: 0.7rem;
    border-radius: 999px;
    background-color: rgba(var(--gs-primary-rgb), 0.16) !important;
    color: var(--gs-primary-dark) !important;
}

#ac-list {
    max-height: 320px;
    overflow-y: auto;
    border-radius: 0.75rem;
    border: 1px solid var(--gs-border);
    background: var(--gs-surface);
}

#ac-list .ac-label {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#ac-list .item-icon {
    width: 22px;
    height: 22px;
    border-radius: 0.6rem;
}

#ac-list .list-group-item {
    gap: 0.75rem;
}

#ac-list .badge {
    font-size: 0.7rem;
}

.table thead th {
    background: #f6efe2 !important; /* warm header tint */
    border-bottom-color: var(--gs-border);
    color: #3b3127;
}

.table td,
.table th {
    vertical-align: middle;
    border-color: var(--gs-border);
}

.table tr:hover {
    background-color: rgba(var(--gs-primary-rgb), 0.08);
    transition: background-color 0.15s;
}

.item-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 0.75rem;
    background-color: transparent;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.item-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.item-icon::after {
    content: attr(data-initial);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(var(--gs-text-rgb), 0.55);
    opacity: 0;
}

.item-icon.item-icon--placeholder::after {
    opacity: 1;
}

.item-icon.item-icon--placeholder img {
    display: none;
}

.item-cell-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.item-name {
    font-weight: 600;
    line-height: 1.2;
}

.item-id-badge {
    align-self: flex-start;
    margin-top: 0.1rem;
}

.text-break {
    white-space: normal !important;
    word-break: break-word;
}

#dbg-pre {
    max-height: 320px;
    overflow: auto;
    background: #f5efe4; /* warm subtle bg */
    border-radius: 0.75rem;
    border: 1px solid var(--gs-border);
}

.form-control {
    transition: box-shadow 0.2s, border-color 0.2s;
    background: #fff;
    border: 1px solid var(--gs-border);
    color: var(--gs-text);
}

.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--gs-primary-rgb), 0.25);
    border-color: var(--gs-primary);
}

.form-control::placeholder {
    color: rgba(var(--gs-text-rgb), 0.3);
}

.card-title,
h2,
h5 {
    color: var(--gs-text);
}

.text-muted {
    color: rgba(var(--gs-text-rgb), 0.6) !important;
}

.btn-outline-secondary.btn-sm[data-unpin] {
    padding: 0.25rem 0.45rem;
    line-height: 1;
}

header .text-muted {
    font-size: 0.9rem;
}

/* ——— HEADER / HERO ——— */
.hero {
    border-bottom: 1px solid var(--gs-border);
    padding-bottom: 1rem;
}

.hero-title {
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-size: clamp(1.6rem, 2.2vw + 1rem, 3rem);
    color: var(--gs-primary);
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
}

.hero-sub {
    margin-top: 0.25rem;
    font-size: 0.95rem;
    color: rgba(var(--gs-text-rgb), 0.7);
}

.badge-unofficial {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(var(--gs-primary-rgb), 0.18);
    color: var(--gs-primary-dark);
    border: 1px solid rgba(var(--gs-primary-rgb), 0.35);
}

/* keep search tucked under header nicely */
.header-search-wrap {
    margin-top: 0.75rem;
}

/* optional microcopy weight (for "Find items by name or ID") */
.small-muted {
    font-weight: 500;
    opacity: 0.8;
}

@media (max-width: 576px) {
    .hero-sub {
        font-size: 0.9rem;
    }
}

/* Compact layout for Pinned items table only */
#pins .card-body {
    padding: 0.6rem 0.75rem;
    border-radius: 0.75rem;
}

#pins table {
    font-size: 0.85rem;
} /* overall text smaller */
#pins thead th,
#pins tbody td {
    padding: 0.25rem 0.4rem;
} /* tighter cell padding */
#pins tbody tr:nth-child(odd) {
    background: #fbf7ee;
}

#pins .item-cell {
    gap: 0.5rem;
} /* less space between icon & text */
#pins .item-icon {
    width: 22px;
    height: 22px;
    border-radius: 0.5rem;
}
#pins .item-name {
    font-size: 0.9em;
    line-height: 1.1;
}
#pins .item-id-badge.badge {
    font-size: 0.62rem;
    padding: 0.15rem 0.35rem;
}

#pins .text-break.small,
#pins .text-muted.small {
    font-size: 0.75rem !important;
    line-height: 1.1;
} /* shop/location */

#pins .btn-outline-secondary.btn-sm[data-unpin] {
    padding: 0.15rem 0.35rem; /* smaller unpin button */
    font-size: 0.8rem;
}

/* Optional: slightly narrower columns for price/qty */
#pins td.text-end {
    white-space: nowrap;
}
