/* Shared Birlik UI — modal + forum thread */

body.birlik-modal-open {
    overflow: hidden;
}

.birlik-modal {
    position: fixed;
    inset: 0;
    z-index: 10850;
    display: none;
}

.birlik-modal.is-open {
    display: block;
}

.birlik-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 17, 21, .52);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.birlik-modal__dialog {
    position: relative;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    pointer-events: none;
}

.birlik-modal__panel {
    pointer-events: auto;
    width: min(560px, 100%);
    background: var(--birlik-surface, var(--bs-body-bg, #fff));
    color: var(--birlik-text, var(--bs-body-color, #1f2937));
    border: 1px solid var(--birlik-border, var(--bs-border-color, rgba(0, 0, 0, .08)));
    border-radius: 20px;
    box-shadow: 0 28px 80px rgba(15, 17, 21, .28);
    transform: translateY(16px) scale(.98);
    animation: birlikModalIn .22s ease forwards;
    overflow: hidden;
}

.birlik-modal.is-danger .birlik-modal__panel {
    border-color: rgba(220, 53, 69, .25);
}

@keyframes birlikModalIn {
    to {
        transform: translateY(0) scale(1);
    }
}

.birlik-modal__header,
.birlik-modal__footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
}

.birlik-modal__header {
    justify-content: space-between;
    border-bottom: 1px solid var(--birlik-border, var(--bs-border-color, #eee));
}

.birlik-modal__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
}

.birlik-modal__close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-size: 1.6rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: .6;
}

.birlik-modal__close:hover {
    opacity: 1;
    background: rgba(127, 127, 127, .12);
}

.birlik-modal__body {
    padding: 20px 22px 8px;
}

.birlik-modal__text {
    margin: 0;
    line-height: 1.55;
    font-size: .98rem;
}

.birlik-modal__field {
    margin-bottom: 14px;
}

.birlik-modal__field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: .9rem;
}

.birlik-modal__input,
.birlik-modal__form textarea {
    width: 100%;
    border: 1px solid var(--birlik-border, var(--bs-border-color, #d9dce3));
    background: var(--birlik-surface-2, var(--bs-body-bg, #fff));
    color: inherit;
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
}

.birlik-modal__input:focus,
.birlik-modal__form textarea:focus {
    outline: 2px solid rgba(36, 72, 236, .35);
    border-color: #2448ec;
}

.birlik-modal__footer {
    border-top: 1px solid var(--birlik-border, var(--bs-border-color, #eee));
    justify-content: flex-end;
}

.birlik-modal__footer-inner {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    width: 100%;
}

.birlik-btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: .55rem 1.1rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.birlik-btn--ghost {
    background: transparent;
    color: inherit;
    border: 1px solid var(--birlik-border, var(--bs-border-color, #d9dce3));
}

.birlik-btn--primary {
    background: #2448ec;
    color: #fff;
}

.birlik-btn--danger {
    background: #dc3545;
    color: #fff;
}

.forum-topic__card,
.forum-comment__card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.forum-topic__card {
    padding: 8px 0 24px;
    border-bottom: 1px solid var(--birlik-border, #e4e6e8);
}

.forum-topic__title {
    font-size: 1.45rem;
    font-weight: 600;
    margin: 0 0 10px;
    line-height: 1.35;
}

.forum-topic__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    font-size: 13px;
    color: var(--birlik-text-muted, #6c727c);
    margin-bottom: 16px;
}

.forum-topic__body {
    margin-bottom: 12px;
}

.forum-react {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 52px;
    flex-shrink: 0;
}

.forum-vote {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.forum-vote__score {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
}

.forum-react__btn,
.forum-react__chip {
    border: 1px solid var(--birlik-border, #e4e6e8);
    background: var(--birlik-surface, #fff);
    color: inherit;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
}

.forum-react__btn {
    width: 36px;
    height: 36px;
}

.forum-react__chip {
    min-width: 36px;
    padding: 4px 8px;
    font-size: 12px;
}

.forum-react__btn.is-on,
.forum-react__chip.is-on {
    background: rgba(36, 72, 236, .1);
    border-color: #2448ec;
    color: #2448ec;
}

.forum-react__btn.is-down.is-on {
    background: rgba(220, 53, 69, .1);
    border-color: #dc3545;
    color: #dc3545;
}

.forum-react__btn:disabled,
.forum-react__chip:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.forum-comment {
    margin: 0 0 14px;
    padding-left: calc(var(--forum-depth, 0) * 22px);
}

.forum-comment__card {
    background: var(--birlik-surface, #fff);
    border: 1px solid var(--birlik-border, #e4e6e8);
    border-radius: 16px;
    padding: 14px;
}

.forum-comment__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.forum-comment__time {
    font-size: 12px;
    color: var(--birlik-text-muted, #6c727c);
    white-space: nowrap;
}

.forum-comment__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.forum-text-btn {
    border: 0;
    background: transparent;
    color: #2448ec;
    padding: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.forum-text-btn.is-danger {
    color: #dc3545;
}

.forum-inline-form {
    margin-top: 12px;
}

.forum-inline-form__actions,
.forum-root-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.forum-composer {
    margin-top: 28px;
    padding: 20px;
    border: 1px solid var(--birlik-border, #e4e6e8);
    border-radius: 16px;
    background: var(--birlik-surface, #fff);
}

.forum-composer__hint {
    color: var(--birlik-text-muted, #6c727c);
    margin-bottom: 0;
}

.forum-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
}

.forum-user:hover .forum-user__name {
    text-decoration: underline;
}

.forum-user__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2448ec;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

.forum-user__avatar.is-lg {
    width: 88px;
    height: 88px;
    font-size: 28px;
}

.forum-user__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.forum-user__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.forum-user__name {
    font-weight: 600;
    line-height: 1.2;
}

.forum-user__headline {
    font-size: 12px;
    color: var(--birlik-text-muted, #6c727c);
}

.member-profile-stats {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 24px;
}

.member-profile-stats li {
    color: var(--birlik-text-muted, #6c727c);
    font-size: 13px;
}

.member-profile-social {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.member-profile-social a {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--birlik-surface-2, #f3f4f6);
    color: var(--birlik-text, #1f2937);
    text-decoration: none;
    font-size: 16px;
}

.member-profile-social a:hover {
    background: var(--birlik-primary, #2563eb);
    color: #fff;
}

html[data-theme="dark"] .forum-comment__card,
html[data-theme="dark"] .forum-composer,
html[data-theme="dark"] .forum-react__btn,
html[data-theme="dark"] .forum-react__chip,
html[data-theme="dark"] .birlik-modal__panel {
    background: var(--birlik-surface);
    border-color: var(--birlik-border);
    color: var(--birlik-text);
}

@media (max-width: 767px) {
    .forum-topic__card,
    .forum-comment__card {
        flex-direction: column;
    }

    .forum-react {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
    }

    .forum-vote {
        flex-direction: row;
        gap: 8px;
    }

    .forum-comment {
        padding-left: calc(var(--forum-depth, 0) * 12px);
    }
}

.birlik-lang-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.birlik-lang-flag-img {
    display: block;
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.birlik-header .birlik-lang-flag-img,
.birlik-footer .birlik-lang-flag-img {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.offer-chat {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.offer-chat__thread {
    max-height: 420px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--birlik-border, var(--bs-border-color, #e4e6e8));
    border-radius: 16px;
    background: var(--birlik-surface-2, #f7f8fa);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.offer-chat__empty {
    margin: 24px 8px;
    text-align: center;
    color: var(--birlik-text-muted, #6c727c);
}

.offer-chat__row {
    display: flex;
}

.offer-chat__row.is-mine {
    justify-content: flex-end;
}

.offer-chat__row.is-theirs {
    justify-content: flex-start;
}

.offer-chat__bubble {
    max-width: min(78%, 440px);
    padding: 10px 12px;
    border-radius: 16px;
    background: var(--birlik-surface, #fff);
    border: 1px solid var(--birlik-border, #e4e6e8);
}

.offer-chat__row.is-mine .offer-chat__bubble {
    background: #2448ec;
    border-color: #2448ec;
    color: #fff;
}

.offer-chat__meta {
    display: flex;
    gap: 8px;
    align-items: baseline;
    justify-content: space-between;
    font-size: 12px;
    opacity: .8;
    margin-bottom: 4px;
}

.offer-chat__text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
}

.offer-chat__composer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
}

.offer-chat__starters {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.offer-chat__chip {
    border: 1px solid var(--birlik-border, #e4e6e8);
    background: var(--birlik-surface, #fff);
    color: inherit;
    border-radius: 999px;
    padding: 4px 12px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.offer-chat__composer textarea {
    width: 100%;
    min-height: 48px;
    resize: vertical;
    border: 1px solid var(--birlik-border, #e4e6e8);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    background: var(--birlik-surface, #fff);
    color: inherit;
}

.offer-chat__send {
    white-space: nowrap;
}

html[data-theme="dark"] .offer-chat__thread,
html[data-bs-theme="dark"] .offer-chat__thread {
    background: var(--birlik-surface-2, #22262f);
}

html[data-theme="dark"] .offer-chat__bubble,
html[data-bs-theme="dark"] .offer-chat__bubble,
html[data-theme="dark"] .offer-chat__composer textarea,
html[data-bs-theme="dark"] .offer-chat__composer textarea,
html[data-theme="dark"] .offer-chat__chip,
html[data-bs-theme="dark"] .offer-chat__chip {
    background: var(--birlik-surface, #1a1d24);
    border-color: var(--birlik-border, #2c313c);
    color: var(--birlik-text, #e8eaed);
}

html[data-theme="dark"] .offer-chat__row.is-mine .offer-chat__bubble,
html[data-bs-theme="dark"] .offer-chat__row.is-mine .offer-chat__bubble {
    background: #2448ec;
    border-color: #2448ec;
    color: #fff;
}
