/* İlan etiket çipi ve editör ilan seçicisi.
   Tasarım dili species-refs.css > .species-ref-chip ile aynı: 22px
   yükseklik, vertical-align: middle, aynı tipografi. Renk ayrı — ilan
   çipi ile tür çipi aynı cümlede yan yana geçebiliyor ve ayırt edilmesi
   gerekiyor.

   Hover kartı ortak: çip data-species-preview yolluyor ve
   topic-list-preview-tooltip.js tek kart çizicisi kullanıyor, bu yüzden
   .species-preview-card kuralları burada tekrarlanmıyor. */

.listing-ref-chip {
    display: inline-flex;
    align-items: center;
    height: 22px;
    max-width: 100%;
    padding: 0;
    border-radius: var(--site-box-radius, 4px);
    overflow: hidden;
    background: rgba(13, 148, 136, .18);
    border: 1px solid rgba(13, 148, 136, .42);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
    color: var(--bs-body-color);
    vertical-align: middle;
    line-height: 1;
    font-size: .68rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease-in-out, border-color .2s ease-in-out;
}

.listing-ref-chip:hover,
.listing-ref-chip:focus-visible {
    background: rgba(13, 148, 136, .3);
    border-color: rgba(13, 148, 136, .6);
    color: var(--bs-body-color);
    text-decoration: none;
}

/* Arıyorum ilanları yeşil: satıyorum ile aynı renkte olunca hangisi
   olduğu ancak tıklayınca anlaşılıyordu. */
.listing-ref-chip--ariyorum {
    background: rgba(25, 135, 84, .18);
    border-color: rgba(25, 135, 84, .42);
}

.listing-ref-chip--ariyorum:hover,
.listing-ref-chip--ariyorum:focus-visible {
    background: rgba(25, 135, 84, .3);
    border-color: rgba(25, 135, 84, .6);
}

[data-bs-theme="light"] .listing-ref-chip {
    background: rgba(13, 148, 136, .13);
    border-color: rgba(13, 148, 136, .34);
}

[data-bs-theme="light"] .listing-ref-chip--ariyorum {
    background: rgba(25, 135, 84, .13);
    border-color: rgba(25, 135, 84, .34);
}

.listing-ref-chip__thumb {
    width: 22px;
    height: 22px;
    object-fit: cover;
    border-radius: 0;
    border-right: 1px solid rgba(var(--text-color-rgb), .2);
    flex-shrink: 0;
    display: block;
}

.listing-ref-chip__thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--text-color-rgb), .1);
    font-size: .62rem;
    opacity: .6;
}

.listing-ref-chip__label {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    min-width: 0;
    padding: 0 .4rem;
    line-height: 1;
}

.listing-ref-chip__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 16em;
    line-height: 1;
    padding: 0;
}

/* Sağ uçtaki tür işareti: çipin bir ilan olduğunu söylüyor.
   Sol görselin aynası — aynı 22px kare, aynı ayıraç çizgisi. */
.listing-ref-chip__kind {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 22px;
    border-left: 1px solid rgba(var(--text-color-rgb), .2);
    background: rgba(var(--text-color-rgb), .07);
    font-size: .6rem;
    opacity: .75;
}

/* Konu/yorum akışında satır içi hizayı bozmasın */
.topic-content .listing-ref-chip,
.forum-comment-body .listing-ref-chip {
    margin: 0 .12em;
}

/* topic.css içindeki `.topic-content img` kuralları (margin, border-radius,
   box-shadow, min-height) çipin görselini şişiriyor. Tür ve galeri
   çiplerinde de aynı koruma var. */
.topic-content .listing-ref-chip__thumb,
.forum-comment-body .listing-ref-chip__thumb {
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-height: 0 !important;
    width: 22px !important;
    height: 22px !important;
    cursor: pointer !important;
}

/* --- Editör ilan seçicisi --- */

/* position ve inset !important: layout/base.css içindeki
   `body > *:not(#id)...{ position: relative }` kuralı :not(#id) yüzünden
   id düzeyinde özgüllük taşıyor ve sınıf seçicimizi yeniyor. Overlay
   body'nin doğrudan çocuğu olduğu için pencere sayfanın en altına düşüp
   görünmez oluyordu. Tür seçicisinde tam olarak bu yaşandı. */
.listing-picker-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10060;
    background: rgba(0, 0, 0, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.listing-picker {
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: 1rem;
    border-radius: var(--site-box-radius, 4px);
    background: var(--bs-card-bg, #161a20);
    border: 1px solid rgba(255, 255, 255, .12);
}

[data-bs-theme="light"] .listing-picker {
    background: var(--lm-card-bg, #fff);
    border-color: var(--lm-card-border, rgba(0, 0, 0, .15));
}

.listing-picker__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.listing-picker__close {
    border: 0;
    background: none;
    color: inherit;
    opacity: .7;
    cursor: pointer;
    padding: .25rem .4rem;
    flex-shrink: 0;
    font-size: 1.1rem;
    line-height: 1;
}

.listing-picker__close:hover {
    opacity: 1;
}

.listing-picker__list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.listing-picker__item {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .45rem;
    border: 0;
    border-radius: var(--site-box-radius, 4px);
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.listing-picker__item:hover {
    background: rgba(var(--text-color-rgb), .08);
}

.listing-picker__thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--site-box-radius, 4px);
    object-fit: cover;
    flex-shrink: 0;
}

.listing-picker__thumb--empty {
    background: rgba(var(--text-color-rgb), .1);
}

.listing-picker__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.listing-picker__title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.listing-picker__meta {
    font-size: .78rem;
    opacity: .7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.listing-picker__empty {
    padding: 1.5rem .5rem;
    text-align: center;
    opacity: .75;
    margin: 0;
}

/* Araç çubuğu düğmesi Quill ikonlarıyla aynı ölçüde dursun */
.ql-toolbar button.ql-listing-picker {
    width: 28px;
    height: 24px;
    padding: 3px 5px;
    color: inherit;
}

.ql-toolbar button.ql-listing-picker svg .ql-stroke {
    fill: none;
}

.ql-toolbar button.ql-listing-picker svg .ql-fill {
    stroke: none;
}
