/* v4 — hızlı sohbet paneli (deploy-marker: yon-quick-chat-v4) */

/* yonv2-core çakışmalarını sıfırla */
.yqc-root {
    --yqc-bg: #14151f;
    --yqc-surface: #1c1d2a;
    --yqc-surface-2: #252736;
    --yqc-border: rgba(255, 255, 255, 0.08);
    --yqc-text: #f1f5f9;
    --yqc-muted: #94a3b8;
    --yqc-accent: #667afa;
    --yqc-accent-deep: #5462d6;
    --yqc-green: #22c55e;
    --yqc-panel-w: 720px;
    --yqc-panel-h: 540px;
    position: fixed !important;
    z-index: 10400 !important;
    pointer-events: none;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: min(var(--yqc-panel-w), calc(100vw - 48px));
    max-width: calc(100vw - 48px);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.yqc-root.is-left {
    left: 24px !important;
    right: auto !important;
}

.yqc-root.is-right {
    right: 24px !important;
    left: auto !important;
    align-items: stretch;
}
.yqc-root, .yqc-root * { box-sizing: border-box; }
.yqc-root.is-open { pointer-events: auto; }

body.ysp-panel-open .yqc-root {
    z-index: 60 !important;
    pointer-events: none !important;
    opacity: 0.35;
}

.yqc-scrim {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 14, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: -1;
}

.yqc-root.is-open .yqc-scrim {
    opacity: 1;
    visibility: visible;
}

.yqc-panel {
    position: relative;
    order: 1;
    width: 100%;
    height: min(var(--yqc-panel-h), calc(100dvh - 140px));
    margin-bottom: 0;
    border-radius: 18px;
    border: 1px solid transparent;
    background: linear-gradient(180deg, #1f2030 0%, var(--yqc-bg) 100%);
    box-shadow: none;
    display: none;
    flex-direction: column;
    overflow: hidden;
    pointer-events: none;
}

.yqc-root.is-open .yqc-panel {
    display: flex !important;
    margin-bottom: 12px;
    border-color: var(--yqc-border);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 28px 64px rgba(0, 0, 0, 0.65);
    pointer-events: auto;
    animation: yqc-panel-in 0.2s ease;
}

@keyframes yqc-panel-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.yqc-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(90deg, #7f1d1d, #991b1b);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}

.yqc-body {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    flex: 1;
    min-height: 0;
}

.yqc-list {
    border-right: 1px solid var(--yqc-border);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.yqc-list__head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--yqc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.yqc-list__head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--yqc-text);
}

.yqc-list__head a {
    font-size: 11px;
    font-weight: 700;
    color: #93c5fd;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.yqc-list__scroll {
    overflow: auto;
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
}

.yqc-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    width: 100%;
    padding: 11px 14px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.yqc-item:hover,
.yqc-item.is-active {
    background: rgba(102, 122, 250, 0.12);
}

.yqc-item__avatar {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--yqc-surface-2);
    border: 1px solid var(--yqc-border);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-weight: 800;
    color: var(--yqc-accent);
}

.yqc-item__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yqc-item__dot {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--yqc-green);
    border: 2px solid var(--yqc-surface);
}

.yqc-item__body { min-width: 0; flex: 1; }
.yqc-item__top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.yqc-item__top strong {
    font-size: 13px;
    font-weight: 800;
    color: var(--yqc-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.yqc-item__top time { font-size: 11px; color: var(--yqc-muted); flex-shrink: 0; }
.yqc-item__preview {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--yqc-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yqc-item__badge {
    align-self: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--yqc-accent-deep);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.yqc-thread {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
}

.yqc-thread__inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.yqc-thread__head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--yqc-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.yqc-thread__back {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--yqc-border);
    background: var(--yqc-surface-2);
    color: var(--yqc-text);
    cursor: pointer;
}

.yqc-thread__avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--yqc-surface-2);
    border: 1px solid var(--yqc-border);
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--yqc-accent);
}

.yqc-thread__avatar img { width: 100%; height: 100%; object-fit: cover; }
.yqc-thread__meta { min-width: 0; flex: 1; }
.yqc-thread__meta strong { display: block; font-size: 14px; font-weight: 800; color: var(--yqc-text); }

.yqc-thread__status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--yqc-green);
}

.yqc-thread__status.is-off { color: var(--yqc-muted); }
.yqc-thread__status em { width: 7px; height: 7px; border-radius: 50%; background: currentColor; font-style: normal; }

.yqc-info {
    margin: 10px 14px 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    background: rgba(59, 130, 246, 0.1);
    font-size: 11px;
    line-height: 1.45;
    color: #bfdbfe;
}

.yqc-info a { color: #93c5fd; font-weight: 700; text-decoration: none; }
.yqc-info strong { display: block; margin-bottom: 4px; color: #dbeafe; }

.yqc-messages {
    flex: 1;
    overflow: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.yqc-msg { max-width: 78%; display: flex; flex-direction: column; gap: 4px; }
.yqc-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.yqc-msg time { font-size: 10px; color: var(--yqc-muted); }
.yqc-msg p {
    margin: 0;
    padding: 10px 13px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}

.yqc-msg.is-mine p {
    background: linear-gradient(135deg, var(--yqc-accent), var(--yqc-accent-deep));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.yqc-msg:not(.is-mine) p {
    background: var(--yqc-surface-2);
    color: var(--yqc-text);
    border: 1px solid var(--yqc-border);
    border-bottom-left-radius: 4px;
}

.yqc-compose {
    padding: 12px 14px 14px;
    border-top: 1px solid var(--yqc-border);
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(0, 0, 0, 0.15);
}

.yqc-compose input {
    flex: 1;
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--yqc-border);
    background: var(--yqc-surface-2);
    color: var(--yqc-text);
    padding: 0 16px;
    font-size: 13px;
    outline: none;
}

.yqc-compose input:focus {
    border-color: rgba(102, 122, 250, 0.45);
    box-shadow: 0 0 0 3px rgba(102, 122, 250, 0.15);
}

.yqc-compose button {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 0;
    background: linear-gradient(135deg, var(--yqc-accent), var(--yqc-accent-deep));
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 18px;
    flex-shrink: 0;
}

.yqc-compose button:disabled { opacity: 0.45; cursor: not-allowed; }

.yqc-compose--blocked {
    border-top: 1px solid rgba(245, 158, 11, 0.28);
    background: rgba(245, 158, 11, 0.08);
}

.yqc-compose--blocked p {
    margin: 0;
    flex: 1;
    font-size: 12px;
    line-height: 1.45;
    color: #fcd34d;
}

.yqc-empty,
.yqc-guest,
.yqc-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    text-align: center;
    color: var(--yqc-muted);
}

.yqc-empty i,
.yqc-guest i,
.yqc-placeholder i {
    font-size: 34px;
    opacity: 0.7;
}

.yqc-guest a,
.yqc-empty a {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--yqc-accent), var(--yqc-accent-deep));
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.yqc-error {
    margin: 0 14px 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #fca5a5;
    font-size: 12px;
}

.yqc-fab {
    pointer-events: auto;
    order: 2;
    flex-shrink: 0;
    align-self: flex-start;
    width: 58px;
    height: 58px;
    border-radius: 999px;
    border: 0;
    background: linear-gradient(145deg, #7c89ff, #667afa 45%, #5462d6);
    color: #fff;
    box-shadow: 0 14px 32px -8px rgba(102, 122, 250, 0.55);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 26px;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.yqc-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px -8px rgba(102, 122, 250, 0.65);
}

.yqc-fab__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: grid;
    place-items: center;
    border: 2px solid var(--yqc-bg);
}

.yqc-root.is-right .yqc-fab {
    align-self: flex-end;
}

@media (max-width: 767px) {
    .yqc-root {
        left: 12px !important;
        right: auto !important;
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        bottom: calc(var(--ymm-bar-h, 62px) + env(safe-area-inset-bottom, 0px) + 12px);
    }

    .yqc-root.is-right {
        left: auto !important;
        right: 12px !important;
    }

    .yqc-panel {
        width: 100%;
        height: min(74dvh, 580px);
        margin-bottom: 10px;
    }

    .yqc-body { grid-template-columns: 1fr; }
    .yqc-root.has-thread .yqc-list { display: none; }
    .yqc-thread__back { display: grid; place-items: center; }
    .yqc-thread:not(.is-visible) { display: none; }
    .yqc-root.has-thread .yqc-thread.is-visible { display: flex; }
}

/* yonv2-core legacy override */
.yqc-root .yqc-body {
    display: grid !important;
    grid-template-columns: 280px minmax(0, 1fr) !important;
}

.yqc-root .yqc-compose {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 12px 14px !important;
}

.yqc-root .yqc-compose input {
    flex: 1;
    min-width: 0;
}

.yqc-root .yqc-compose button {
    flex-shrink: 0;
}
