/* ═══════════════════════════════════════════════════════
   YILDIZ CANLI DESTEK — JivoChat Tarzı Sohbet Aracı
   Siyah & Altın premium tema
   ═══════════════════════════════════════════════════════ */

:root {
    --slsf-bg: #0d0d12;
    --slsf-surface: #141420;
    --slsf-surface2: #1c1c2e;
    --slsf-surface3: #252538;
    --slsf-border: #2e2e45;
    --slsf-gold: #d4a017;
    --slsf-gold-light: #f0d264;
    --slsf-gold-dark: #a67c00;
    --slsf-gold-glow: rgba(212, 160, 23, 0.25);
    --slsf-text: #f0f0f5;
    --slsf-text-dim: #7e7e9a;
    --slsf-radius: 18px;
    --slsf-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ══════════════════════════════════════════════════════
   PROAKTIF DAVET BALONU (JivoChat tarzı)
   ══════════════════════════════════════════════════════ */
.sls-invite {
    position: fixed;
    top: calc(50% - 112px);
    right: 24px;
    bottom: auto;
    background: var(--slsf-surface);
    border: 1px solid var(--slsf-border);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 320px;
    box-shadow:
        0 10px 40px rgba(0,0,0,0.4),
        0 0 0 1px rgba(212,160,23,0.08),
        0 0 60px rgba(212,160,23,0.05);
    z-index: 999997;
    animation: sls-inviteIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.sls-invite:hover {
    transform: translateY(-2px);
    box-shadow:
        0 14px 50px rgba(0,0,0,0.5),
        0 0 0 1px rgba(212,160,23,0.15),
        0 0 80px rgba(212,160,23,0.08);
}
@keyframes sls-inviteIn {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.sls-invite-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: var(--slsf-surface3);
    color: var(--slsf-text-dim);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}
.sls-invite-close:hover {
    background: var(--slsf-gold);
    color: #000;
}
.sls-invite-avatar {
    position: relative;
    flex-shrink: 0;
}
.sls-invite-avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--slsf-surface2), var(--slsf-surface3));
    border: 2px solid var(--slsf-gold);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sls-invite-online {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid var(--slsf-surface);
    animation: sls-glow 2s ease-in-out infinite;
}
@keyframes sls-glow {
    0%, 100% { box-shadow: 0 0 4px rgba(34,197,94,0.5); }
    50% { box-shadow: 0 0 12px rgba(34,197,94,0.8); }
}
.sls-invite-content {
    flex: 1;
    min-width: 0;
}
.sls-invite-name {
    font-family: var(--slsf-font);
    font-size: 13px;
    font-weight: 600;
    color: var(--slsf-gold);
    margin-bottom: 3px;
}
.sls-invite-msg {
    font-family: var(--slsf-font);
    font-size: 14px;
    color: var(--slsf-text);
    line-height: 1.4;
}

/* ══════════════════════════════════════════════════════
   YÜZEN BUTON
   ══════════════════════════════════════════════════════ */
.sls-toggle {
    position: fixed;
    top: 50%;
    right: 24px;
    bottom: auto;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    background: transparent;
    padding: 0;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 6px 30px rgba(212, 160, 23, 0.35),
        0 2px 8px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.15);
    z-index: 999999;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateY(-50%);
    animation: sls-heartbeat 1.5s infinite;
}
@keyframes sls-heartbeat {
    0% { transform: translateY(-50%) scale(1); }
    14% { transform: translateY(-50%) scale(1.15); }
    28% { transform: translateY(-50%) scale(1); }
    42% { transform: translateY(-50%) scale(1.15); }
    70% { transform: translateY(-50%) scale(1); }
}
.sls-toggle:hover {
    transform: translateY(-50%) scale(1.1) !important;
    box-shadow:
        0 10px 40px rgba(212, 160, 23, 0.5),
        0 4px 15px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.2);
    animation: none;
}
.sls-icon-close {
    background: #1e293b;
    border-radius: 50%;
    width: 62px !important;
    height: 62px !important;
    padding: 16px;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.sls-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #ef4444;
    border-radius: 12px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--slsf-font);
    border: 2px solid var(--slsf-bg);
    animation: sls-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes sls-bounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ══════════════════════════════════════════════════════
   SOHBET PENCERESİ
   ══════════════════════════════════════════════════════ */
.sls-window {
    position: fixed;
    top: 50%;
    right: 24px;
    bottom: auto;
    width: 400px;
    max-height: 620px;
    height: 600px;
    background: var(--slsf-bg);
    border-radius: var(--slsf-radius);
    box-shadow:
        0 25px 80px rgba(0,0,0,0.6),
        0 0 0 1px rgba(212,160,23,0.1),
        0 0 100px rgba(212,160,23,0.03);
    z-index: 999998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--slsf-font);
    transform: translateY(-50%);
    animation: sls-windowIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes sls-windowIn {
    from { opacity: 0; transform: translateY(calc(-50% + 30px)) scale(0.92); }
    to { opacity: 1; transform: translateY(-50%) scale(1); }
}
@media (max-width: 480px) {
    .sls-invite {
        top: calc(50% - 112px);
        right: 12px;
        max-width: min(300px, calc(100vw - 84px));
        padding: 13px 15px;
    }
    .sls-toggle {
        top: calc(50% + 22px);
        right: 12px;
        width: 56px;
        height: 56px;
    }
    .sls-icon-close {
        width: 56px !important;
        height: 56px !important;
        padding: 14px;
    }
    .sls-window {
        top: 50%;
        right: 8px;
        bottom: auto;
        width: calc(100vw - 24px);
        height: min(590px, calc(100vh - 36px));
        max-height: calc(100vh - 36px);
        border-radius: 14px;
    }
}

/* ── Üst Başlık ──────────────────────────────────────── */
.sls-w-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(160deg, #1a1a2e 0%, var(--slsf-surface) 100%);
    border-bottom: 1px solid var(--slsf-border);
    flex-shrink: 0;
}
.sls-w-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sls-w-avatars {
    position: relative;
    flex-shrink: 0;
}
.sls-w-avatar-main {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--slsf-surface2), var(--slsf-surface3));
    border: 2px solid var(--slsf-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slsf-gold);
}
.sls-w-avatar-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid var(--slsf-surface);
}
.sls-w-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--slsf-text);
}
.sls-w-subtitle {
    font-size: 11px;
    color: var(--slsf-text-dim);
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sls-w-online-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
}
.sls-w-header-actions {
    display: flex;
    gap: 6px;
}
.sls-w-minimize {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    color: var(--slsf-text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.sls-w-minimize:hover {
    background: rgba(255,255,255,0.12);
    color: var(--slsf-text);
}

/* ── Giriş Formu ─────────────────────────────────────── */
.sls-prechat {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}
.sls-prechat-inner {
    width: 100%;
}
.sls-prechat-welcome {
    text-align: center;
    margin-bottom: 28px;
}
.sls-prechat-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--slsf-surface2), var(--slsf-surface3));
    border: 2px solid var(--slsf-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px var(--slsf-gold-glow);
}
.sls-prechat h3 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 800;
    color: var(--slsf-text);
    letter-spacing: -0.3px;
}
.sls-prechat p {
    margin: 0;
    font-size: 14px;
    color: var(--slsf-text-dim);
    line-height: 1.6;
}
.sls-field {
    margin-bottom: 16px;
}
.sls-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--slsf-text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sls-field input {
    width: 100%;
    padding: 13px 16px;
    background: var(--slsf-surface2);
    border: 1px solid var(--slsf-border);
    border-radius: 12px;
    color: var(--slsf-text);
    font-family: var(--slsf-font);
    font-size: 14px;
    outline: none;
    transition: all 0.25s;
    box-sizing: border-box;
}
.sls-field input:focus {
    border-color: var(--slsf-gold);
    box-shadow: 0 0 0 4px var(--slsf-gold-glow);
    background: var(--slsf-surface3);
}
.sls-field input::placeholder {
    color: var(--slsf-text-dim);
}
.sls-start-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(145deg, var(--slsf-gold), var(--slsf-gold-dark));
    border: none;
    border-radius: 12px;
    color: #000;
    font-family: var(--slsf-font);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s;
    margin-top: 8px;
    letter-spacing: 0.2px;
}
.sls-start-btn:hover {
    box-shadow: 0 8px 30px rgba(212,160,23,0.4);
    transform: translateY(-2px);
}
.sls-start-btn:active {
    transform: translateY(0);
}
.sls-start-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── Mesajlar ────────────────────────────────────────── */
.sls-w-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--slsf-border) transparent;
}
.sls-w-messages::-webkit-scrollbar {
    width: 4px;
}
.sls-w-messages::-webkit-scrollbar-track {
    background: transparent;
}
.sls-w-messages::-webkit-scrollbar-thumb {
    background: var(--slsf-border);
    border-radius: 4px;
}

.sls-w-msg {
    max-width: 82%;
    padding: 11px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    animation: sls-msgIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    word-wrap: break-word;
    position: relative;
}
@keyframes sls-msgIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Müşteri mesajı — altın balon */
.sls-w-msg.visitor {
    align-self: flex-end;
    background: linear-gradient(145deg, var(--slsf-gold), var(--slsf-gold-dark));
    color: #000;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 12px rgba(212,160,23,0.2);
}
/* Temsilci mesajı — koyu balon */
.sls-w-msg.agent {
    align-self: flex-start;
    background: var(--slsf-surface2);
    color: var(--slsf-text);
    border: 1px solid var(--slsf-border);
    border-bottom-left-radius: 6px;
}
/* Sistem mesajı */
.sls-w-msg.system {
    align-self: center;
    background: rgba(212,160,23,0.08);
    color: var(--slsf-gold);
    font-size: 12px;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(212,160,23,0.15);
}
.sls-w-msg-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.5;
}
.sls-w-msg.visitor .sls-w-msg-time { color: rgba(0,0,0,0.5); }
.sls-w-msg.agent .sls-w-msg-time { color: var(--slsf-text-dim); }

/* ── Yazıyor Göstergesi ──────────────────────────────── */
.sls-w-typing {
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sls-typing-bubble {
    background: var(--slsf-surface2);
    border: 1px solid var(--slsf-border);
    padding: 10px 14px;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
}
.sls-typing-dots {
    display: flex;
    gap: 4px;
}
.sls-typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--slsf-gold);
    animation: sls-dotPulse 1.4s infinite;
}
.sls-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.sls-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes sls-dotPulse {
    0%, 60%, 100% { opacity: 0.25; transform: scale(0.85); }
    30% { opacity: 1; transform: scale(1.15); }
}
.sls-typing-label {
    font-size: 12px;
    color: var(--slsf-text-dim);
    font-style: italic;
}

/* ── Mesaj Giriş Alanı ───────────────────────────────── */
.sls-w-input-area {
    padding: 12px 14px;
    background: var(--slsf-surface);
    border-top: 1px solid var(--slsf-border);
}
.sls-w-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--slsf-surface2);
    border: 1px solid var(--slsf-border);
    border-radius: 14px;
    padding: 4px 4px 4px 14px;
    transition: border-color 0.25s;
}
.sls-w-input-wrap:focus-within {
    border-color: var(--slsf-gold);
    box-shadow: 0 0 0 3px var(--slsf-gold-glow);
}
.sls-w-input-wrap textarea {
    flex: 1;
    background: none;
    border: none;
    color: var(--slsf-text);
    padding: 10px 0;
    font-family: var(--slsf-font);
    font-size: 14px;
    resize: none;
    max-height: 100px;
    line-height: 1.4;
    outline: none;
}
.sls-w-input-wrap textarea::placeholder {
    color: var(--slsf-text-dim);
}
.sls-w-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(145deg, var(--slsf-gold), var(--slsf-gold-dark));
    color: #000;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.sls-w-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(212,160,23,0.4);
}
.sls-w-send-btn:active {
    transform: scale(0.95);
}

/* ── Alt Bilgi ───────────────────────────────────────── */
.sls-w-footer {
    padding: 8px;
    text-align: center;
    font-size: 10px;
    color: var(--slsf-text-dim);
    background: var(--slsf-surface);
    border-top: 1px solid rgba(46,46,69,0.3);
    letter-spacing: 0.3px;
}
