/* ─── UV CHATBOT PRO v3.3.0 ─────────────────────────────────────────────────── */
:root {
    --uv-black: #111;
    --uv-gold:  #c9a96e;
    --uv-white: #fff;
    --uv-gray:  #f5f5f5;
    --uv-radius:20px;
}

#uv-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ─── PROMO BALON ─────────────────────────────────────────────────────────────── */
#uv-chat-promo-bubble {
    position: absolute;
    bottom: 68px;
    right: 0;
    background: var(--uv-white);
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    padding: 13px 14px 13px 16px;
    min-width: 210px;
    max-width: 270px;
    display: none;
    align-items: center;
    gap: 8px;
    border: 1px solid #ebebeb;
    cursor: pointer;
}
#uv-chat-promo-bubble::after {
    content:'';
    position:absolute;
    bottom:-8px;
    right:22px;
    border:8px solid transparent;
    border-top-color:var(--uv-white);
    border-bottom:0;
}
#uv-chat-promo-text {
    flex:1;
    font-size:13.5px;
    color:var(--uv-black);
    line-height:1.45;
    font-weight:500;
}
#uv-chat-promo-close {
    background:none;border:none;color:#bbb;font-size:14px;
    cursor:pointer;padding:2px 4px;line-height:1;flex-shrink:0;
}
#uv-chat-promo-close:hover{color:#666;}

/* ─── ANA BUTON ──────────────────────────────────────────────────────────────── */
#uv-chat-bubble {
    width:58px;height:58px;
    background:var(--uv-black);
    border-radius:50%;
    display:flex;align-items:center;justify-content:center;
    cursor:pointer;
    box-shadow:0 4px 22px rgba(0,0,0,0.28);
    transition:transform .2s,box-shadow .2s;
    position:relative;
    margin-left:auto;
}
#uv-chat-bubble:hover{transform:scale(1.08);box-shadow:0 6px 28px rgba(0,0,0,0.38);}
#uv-chat-badge {
    position:absolute;top:-3px;right:-3px;
    background:#e74c3c;color:white;
    border-radius:50%;width:20px;height:20px;
    font-size:11px;font-weight:700;
    display:none;align-items:center;justify-content:center;
    border:2px solid white;
}

/* ─── CHAT KUTUSU — MASAÜSTÜ ─────────────────────────────────────────────────── */
#uv-chat-box {
    position:absolute;
    bottom:72px;right:0;
    width:370px;
    background:var(--uv-white);
    border-radius:var(--uv-radius);
    box-shadow:0 12px 56px rgba(0,0,0,0.18);
    display:none;
    flex-direction:column;
    overflow:hidden;
    max-height:600px;
}
#uv-chat-box.open {
    display:flex;
    animation:uvSlideUp .25s cubic-bezier(.16,1,.3,1);
}
@keyframes uvSlideUp {
    from{opacity:0;transform:translateY(16px) scale(.98);}
    to{opacity:1;transform:translateY(0) scale(1);}
}

/* ─── HEADER ─────────────────────────────────────────────────────────────────── */
#uv-chat-header {
    background:var(--uv-black);
    color:var(--uv-white);
    padding:14px 16px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-shrink:0;
}
#uv-chat-hi{display:flex;align-items:center;gap:11px;}
#uv-chat-av {
    width:38px;height:38px;
    background:var(--uv-gold);
    border-radius:50%;
    display:flex;align-items:center;justify-content:center;
    font-weight:800;font-size:12px;letter-spacing:.5px;flex-shrink:0;
}
#uv-chat-nm{font-weight:700;font-size:14.5px;letter-spacing:.2px;}
#uv-chat-st{font-size:11.5px;color:#4ade80;margin-top:2px;display:flex;align-items:center;gap:5px;}
.uv-dot{width:7px;height:7px;background:#4ade80;border-radius:50%;display:inline-block;animation:uvPulse 2s infinite;}
@keyframes uvPulse{0%,100%{opacity:1;}50%{opacity:.35;}}
.uv-hdr-btns{display:flex;gap:6px;align-items:center;}
.uv-hdr-btns button {
    background:none;border:none;color:rgba(255,255,255,.6);
    cursor:pointer;padding:6px;border-radius:8px;
    display:flex;align-items:center;justify-content:center;
    transition:background .15s,color .15s;
}
.uv-hdr-btns button:hover{background:rgba(255,255,255,.1);color:white;}

/* ─── EMAIL GATE ──────────────────────────────────────────────────────────────── */
#uv-email-gate {
    padding:28px 22px 22px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#fafafa;
    border-bottom:1px solid #eee;
    flex-shrink:0;
}
#uv-email-inner{width:100%;display:flex;flex-direction:column;align-items:center;gap:10px;}
#uv-email-icon{font-size:34px;margin-bottom:2px;}
#uv-email-title{font-size:15.5px;font-weight:700;color:var(--uv-black);text-align:center;}
#uv-email-sub{font-size:12.5px;color:#888;text-align:center;line-height:1.5;margin-bottom:2px;}
#uv-email-name,
#uv-email-input {
    width:100%;border:1.5px solid #e8e8e8;border-radius:12px;
    padding:10px 14px;font-size:14px;outline:none;
    background:white;font-family:inherit;box-sizing:border-box;
    transition:border-color .2s;
}
#uv-email-name:focus,#uv-email-input:focus{border-color:var(--uv-black);}
#uv-email-btn {
    width:100%;background:var(--uv-black);color:white;
    border:none;border-radius:12px;padding:12px;
    font-size:14px;font-weight:700;cursor:pointer;
    font-family:inherit;transition:background .2s,transform .15s;margin-top:4px;
}
#uv-email-btn:hover{background:#333;transform:scale(1.01);}
#uv-email-btn:active{transform:scale(.98);}
#uv-email-skip{
    background:none;border:none;color:#bbb;font-size:12px;
    cursor:pointer;font-family:inherit;text-decoration:underline;
    transition:color .2s;padding:2px;
}
#uv-email-skip:hover{color:#666;}

/* ─── MESAJLAR ───────────────────────────────────────────────────────────────── */
#uv-chat-messages {
    flex:1;overflow-y:auto;
    padding:14px 14px 8px;
    display:flex;flex-direction:column;gap:8px;
    background:var(--uv-gray);
    min-height:180px;max-height:360px;
}
#uv-chat-messages::-webkit-scrollbar{width:3px;}
#uv-chat-messages::-webkit-scrollbar-thumb{background:#ddd;border-radius:2px;}

.uv-time-label {
    text-align:center;font-size:11px;color:#bbb;
    margin:4px 0;font-weight:500;
}

.uv-msg {
    max-width:84%;padding:10px 14px;
    border-radius:16px;font-size:14px;line-height:1.52;
    animation:uvFadeIn .18s ease;word-break:break-word;
}
@keyframes uvFadeIn{from{opacity:0;transform:translateY(5px);}to{opacity:1;transform:translateY(0);}}
.uv-bot{
    background:white;color:var(--uv-black);
    align-self:flex-start;border-bottom-left-radius:4px;
    box-shadow:0 1px 4px rgba(0,0,0,.07);
}
.uv-user{
    background:var(--uv-black);color:white;
    align-self:flex-end;border-bottom-right-radius:4px;
}
.uv-msg code{background:#f0f0f0;color:#c0392b;padding:1px 5px;border-radius:4px;font-size:13px;}
.uv-user code{background:rgba(255,255,255,.15);color:#ffd;padding:1px 5px;border-radius:4px;}
.uv-typing{display:flex;gap:5px;align-items:center;padding:12px 16px;}
.uv-typing span{
    width:7px;height:7px;background:#bbb;border-radius:50%;
    animation:uvBounce 1.2s infinite;
}
.uv-typing span:nth-child(2){animation-delay:.2s;}
.uv-typing span:nth-child(3){animation-delay:.4s;}
@keyframes uvBounce{0%,60%,100%{transform:translateY(0);}30%{transform:translateY(-7px);}}

/* ─── INPUT ───────────────────────────────────────────────────────────────────── */
#uv-chat-input-area {
    padding:10px 12px;
    display:flex;gap:8px;align-items:center;
    background:white;border-top:1px solid #eee;flex-shrink:0;
}
#uv-chat-input {
    flex:1;border:1.5px solid #e8e8e8;border-radius:22px;
    padding:9px 16px;font-size:14px;outline:none;
    background:#fafafa;font-family:inherit;
    transition:border-color .2s,background .2s;
}
#uv-chat-input:focus{border-color:var(--uv-black);background:white;}
#uv-chat-send {
    width:38px;height:38px;flex-shrink:0;
    background:var(--uv-black);border:none;border-radius:50%;
    cursor:pointer;display:flex;align-items:center;justify-content:center;
    transition:background .2s,transform .15s;
}
#uv-chat-send:hover{background:#333;transform:scale(1.06);}
#uv-chat-send:active{transform:scale(.94);}
#uv-chat-footer{
    text-align:center;font-size:10.5px;color:#ccc;
    padding:5px 12px 7px;background:white;flex-shrink:0;
    letter-spacing:.3px;
}

/* ─── MOBİL — TAM SAYFA ──────────────────────────────────────────────────────── */

/* MOBİL — body scroll ile çakışmayı önle */

/* ── iOS SAFE FULLSCREEN CHAT ─────────────────────────────────────── */

/* Masaüstü: köşe popup */
@media (min-width:601px){
    #uv-chat-box{
        position:absolute;bottom:72px;right:0;
        width:370px;max-height:600px;
    }
}

/* Mobil: sayfa scroll kilitlenir, chat sabit kalır */
@media (max-width:600px){

    /* Scroll kilidi */
    html.uv-open, body.uv-open {
        overflow: hidden !important;
        height: 100% !important;
        position: fixed !important;
        width: 100% !important;
    }

    #uv-chat-bubble {
        position: fixed !important;
        bottom: 24px !important;
        right: 20px !important;
        left: auto !important;
        z-index: 2147483647 !important;
    }

    #uv-chat-promo-bubble {
        position: fixed !important;
        bottom: 90px !important;
        right: 16px !important;
        left: 16px !important;
        max-width: none !important;
        z-index: 2147483646 !important;
    }

    #uv-chat-box {
        /* Sayfanın üzerine tam ekran overlay — scroll etkilemiyor */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 2147483647 !important;
        display: none;
        flex-direction: column;
        /* iOS transform hack — fixed'ı viewport'a kilitler */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        overflow: hidden !important;
    }

    #uv-chat-box.open { display: flex !important; }

    #uv-chat-header {
        flex: 0 0 auto;
        /* iOS notch */
        padding-top: max(14px, env(safe-area-inset-top)) !important;
    }

    #uv-email-gate { flex: 0 0 auto; }

    #uv-chat-messages {
        flex: 1 1 0px !important;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    #uv-chat-input-area {
        flex: 0 0 auto;
        /* Klavye açılınca bu alan yukarı çıkar — flex ile */
        padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
    }

    #uv-chat-footer {
        flex: 0 0 auto;
        padding-bottom: max(4px, env(safe-area-inset-bottom)) !important;
    }

    /* Input genişlik fix */
    #uv-chat-input {
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important; /* iOS zoom önle */
    }
}
