/* Ana sayfa yardım sohbet baloncuğu (yardim_baloncugu.php). Sitenin "violeta" renkleri. */
.ys {
    --ys-ana: #9C27B0;
    --ys-koyu: #6A1B9A;
    --ys-acik: #F3E5F5;
    --ys-cizgi: #E6D3EC;
    --ys-yazi: #2b1a33;
    --ys-soluk: #7a6a82;
    --ys-zemin: #ffffff;
    --ys-gelen: #F4EEF7;
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1040; /* çerez bandı (1050) ve modalların altında */
    font-family: 'Open Sans', 'Poppins', system-ui, sans-serif;
    color: var(--ys-yazi);
}

/* ---------- başlatıcı düğme ---------- */
.ys-baslatici {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    height: 56px;
    padding: 0 1.25rem 0 1.1rem;
    border: 0;
    border-radius: 28px;
    background: linear-gradient(135deg, var(--ys-ana), var(--ys-koyu));
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    /* beyaz çerçeve: mor kahraman alanının üstünde de seçilsin */
    box-shadow: 0 0 0 3px #fff, 0 8px 24px rgba(43, 26, 51, .35);
    cursor: pointer;
    position: relative;
    transition: transform .15s ease, box-shadow .15s ease;
}
.ys-baslatici:hover { transform: translateY(-2px); box-shadow: 0 0 0 3px #fff, 0 12px 28px rgba(43, 26, 51, .42); }
.ys-baslatici:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px var(--ys-ana); }
.ys-baslatici i { font-size: 1.35rem; }
.ys-rozet {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #e53935;
    color: #fff;
    font-size: .75rem;
    line-height: 22px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}
.ys.ys-acik .ys-baslatici { display: none; }

/* ---------- çıkış balonu ("Gitmek istediğinize emin misiniz?") ---------- */
.ys-davet {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: 290px;
    padding: 1rem 1rem .9rem;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(43, 26, 51, .28);
    animation: ys-gel .2s ease-out;
}
.ys-davet[hidden] { display: none; }
.ys-davet::after { /* düğmeyi gösteren kuyruk */
    content: '';
    position: absolute;
    right: 34px;
    bottom: -8px;
    width: 16px;
    height: 16px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: 4px 4px 8px rgba(43, 26, 51, .08);
}
.ys-davet-baslik { margin: 0 1.5rem .3rem 0; font-weight: 700; font-size: .98rem; color: var(--ys-koyu); }
.ys-davet-metin { margin: 0 0 .75rem; font-size: .86rem; line-height: 1.45; color: var(--ys-yazi); }
.ys-davet-btn {
    border: 0;
    border-radius: 10px;
    padding: .5rem .9rem;
    background: var(--ys-ana);
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
}
.ys-davet-btn:hover { background: var(--ys-koyu); }
.ys-davet-kapat {
    position: absolute;
    top: .5rem;
    right: .5rem;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ys-soluk);
    cursor: pointer;
}
.ys-davet-kapat:hover { background: var(--ys-acik); }
.ys-davet-btn:focus-visible, .ys-davet-kapat:focus-visible { outline: 2px solid var(--ys-koyu); outline-offset: 2px; }
.ys.ys-acik .ys-davet { display: none; }

/* ---------- panel ---------- */
.ys-panel {
    width: 360px;
    max-height: min(560px, calc(100vh - 40px));
    max-height: min(560px, calc(100dvh - 40px));
    display: flex;
    flex-direction: column;
    background: var(--ys-zemin);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(43, 26, 51, .28);
    overflow: hidden;
    transform-origin: bottom right;
    animation: ys-gel .18s ease-out;
    transition: width .22s ease, height .22s ease;
}
.ys-panel[hidden] { display: none; }
/* Sohbet başlayınca baloncuk büyür */
.ys-panel.ys-genis {
    width: 400px;
    height: min(620px, calc(100vh - 40px));
    height: min(620px, calc(100dvh - 40px));
    max-height: none;
}
@keyframes ys-gel {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ys-panel { animation: none; transition: none; }
    .ys-baslatici { transition: none; }
}

.ys-baslik {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .9rem 1rem;
    background: linear-gradient(135deg, var(--ys-ana), var(--ys-koyu));
    color: #fff;
    flex: 0 0 auto;
}
.ys-baslik-metin { flex: 1 1 auto; min-width: 0; }
.ys-baslik-ad { font-weight: 700; font-size: 1rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ys-baslik-alt { font-size: .8rem; opacity: .85; }
.ys-ikon-btn {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}
.ys-ikon-btn:hover { background: rgba(255, 255, 255, .28); }
.ys-ikon-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.ys-avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--ys-acik);
    color: var(--ys-koyu);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .95rem;
}
.ys-baslik .ys-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }

.ys-govde {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* ---------- başlangıç formu ---------- */
.ys-form {
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}
.ys-form[hidden], .ys-sohbet[hidden] { display: none; }
.ys-giris-metni { margin: 0; font-size: .92rem; color: var(--ys-soluk); }
.ys-etiket { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .35rem; color: var(--ys-yazi); }
.ys-terapistler { display: flex; flex-direction: column; gap: .45rem; margin: 0; padding: 0; border: 0; }
.ys-terapist {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .7rem;
    border: 1.5px solid var(--ys-cizgi);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease;
}
.ys-terapist:hover { border-color: var(--ys-ana); }
.ys-terapist input { position: absolute; opacity: 0; pointer-events: none; }
.ys-terapist:has(input:checked) { border-color: var(--ys-ana); background: var(--ys-acik); }
.ys-terapist:has(input:focus-visible) { outline: 2px solid var(--ys-ana); outline-offset: 2px; }
.ys-terapist-metin { min-width: 0; }
.ys-terapist-ad { font-weight: 600; font-size: .92rem; }
.ys-terapist-alt { font-size: .78rem; color: var(--ys-soluk); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ys-girdi {
    width: 100%;
    border: 1.5px solid var(--ys-cizgi);
    border-radius: 10px;
    padding: .55rem .7rem;
    font: inherit;
    font-size: .92rem;
    color: var(--ys-yazi);
    background: #fff;
}
.ys-girdi:focus { outline: none; border-color: var(--ys-ana); box-shadow: 0 0 0 3px rgba(156, 39, 176, .15); }
textarea.ys-girdi { resize: none; min-height: 84px; }
.ys-not { font-size: .74rem; color: var(--ys-soluk); margin: 0; line-height: 1.4; }
.ys-not a { color: var(--ys-koyu); }
.ys-hata { font-size: .82rem; color: #c62828; margin: 0; }
.ys-hata:empty { display: none; }

.ys-ana-btn {
    border: 0;
    border-radius: 10px;
    padding: .65rem 1rem;
    background: var(--ys-ana);
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
}
.ys-ana-btn:hover { background: var(--ys-koyu); }
.ys-ana-btn:disabled { opacity: .6; cursor: default; }
.ys-ana-btn:focus-visible { outline: 2px solid var(--ys-koyu); outline-offset: 2px; }

/* ---------- kayıtlı e-posta: önce giriş ---------- */
.ys-hesap {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: .8rem;
    border: 1.5px solid var(--ys-ana);
    border-radius: 12px;
    background: var(--ys-acik);
}
.ys-hesap[hidden], .ys-yontem[hidden] { display: none; }
.ys-hesap-metin { margin: 0; font-size: .84rem; line-height: 1.45; color: var(--ys-yazi); }
.ys-hesap-metin b { color: var(--ys-koyu); }
.ys-yontem { display: flex; flex-direction: column; gap: .45rem; }
.ys-yontem .ys-etiket { margin-bottom: 0; }
.ys-google { display: flex; justify-content: center; min-height: 40px; }
.ys-apple {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: #000;
    color: #fff;
    font: 500 .92rem/1 -apple-system, "SF Pro Text", Roboto, Arial, sans-serif;
    cursor: pointer;
}
.ys-apple:disabled { opacity: .6; cursor: wait; }
.ys-apple:focus-visible { outline: 2px solid var(--ys-koyu); outline-offset: 2px; }
.ys-baglanti {
    align-self: center;
    border: 0;
    background: none;
    padding: 0;
    color: var(--ys-koyu);
    font-size: .8rem;
    text-decoration: underline;
    cursor: pointer;
}
.ys-hesap-durum { margin: 0; font-size: .8rem; color: #c62828; }
.ys-hesap-durum.ys-tamam { color: #1b5e20; }
.ys-hesap-durum:empty { display: none; }

.ys-bos { padding: 1.25rem 1rem; font-size: .92rem; color: var(--ys-soluk); }
.ys-bos a { color: var(--ys-koyu); font-weight: 600; }

/* ---------- sohbet ---------- */
.ys-sohbet { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ys-mesajlar {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem .9rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    background: #fcfaFD;
}
.ys-mesaj {
    max-width: 82%;
    padding: .5rem .75rem;
    border-radius: 14px;
    font-size: .92rem;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.ys-mesaj-zaman { display: block; font-size: .68rem; opacity: .7; margin-top: .15rem; text-align: right; }
.ys-mesaj.ys-gelen { align-self: flex-start; background: var(--ys-gelen); border-bottom-left-radius: 4px; }
.ys-mesaj.ys-giden { align-self: flex-end; background: var(--ys-ana); color: #fff; border-bottom-right-radius: 4px; }
.ys-mesaj.ys-ozel { font-style: italic; }
.ys-mesaj.ys-bekliyor { opacity: .6; }
.ys-bilgi {
    align-self: center;
    text-align: center;
    font-size: .78rem;
    color: var(--ys-soluk);
    background: #fff;
    border: 1px dashed var(--ys-cizgi);
    border-radius: 10px;
    padding: .45rem .7rem;
    margin: .25rem 0;
    max-width: 92%;
}
.ys-gun { align-self: center; font-size: .72rem; color: var(--ys-soluk); margin: .35rem 0 .1rem; }

.ys-yaz {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: .5rem;
    padding: .6rem .7rem;
    border-top: 1px solid var(--ys-cizgi);
    background: #fff;
}
.ys-yaz textarea {
    flex: 1 1 auto;
    min-height: 40px;
    max-height: 120px;
    border: 1.5px solid var(--ys-cizgi);
    border-radius: 20px;
    padding: .5rem .85rem;
    font: inherit;
    font-size: .92rem;
    resize: none;
}
.ys-yaz textarea:focus { outline: none; border-color: var(--ys-ana); }
.ys-gonder {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--ys-ana);
    color: #fff;
    cursor: pointer;
}
.ys-gonder:disabled { opacity: .5; cursor: default; }
.ys-gonder:focus-visible { outline: 2px solid var(--ys-koyu); outline-offset: 2px; }
.ys-alt {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    padding: .35rem .9rem .55rem;
    background: #fff;
    font-size: .75rem;
}
.ys-alt button {
    border: 0;
    background: none;
    padding: 0;
    color: var(--ys-koyu);
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
}

/* ---------- telefon: tam ekran panel, küçük başlatıcı ---------- */
@media (max-width: 575.98px) {
    .ys { right: 16px; bottom: 16px; }
    .ys-baslatici { width: 56px; padding: 0; justify-content: center; }
    .ys-baslatici-yazi { display: none; }
    .ys.ys-acik { inset: 0; right: 0; bottom: 0; }
    .ys-panel, .ys-panel.ys-genis {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
    }
}

/* Alttaki "Randevu bildirimleri" bandı (onesignal_importer-1.js) görünürken bandın üstüne çık */
body:has(#custom-notif-request) .ys:not(.ys-acik) { bottom: 100px; }
@media (max-width: 575.98px) {
    body:has(#custom-notif-request) .ys:not(.ys-acik) { bottom: 150px; }
}
