/* Canlı destek widget — statik, tüm sayfalarda */

.uh-support-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.uh-live-chat-panel {
    position: fixed;
    right: 20px;
    bottom: 148px;
    width: min(380px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 180px));
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 10051;
}

.uh-live-chat-panel[hidden] {
    display: none !important;
}

.uh-live-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.uh-live-chat-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.uh-live-chat-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.uh-live-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f8fafc;
}

.uh-live-chat-msg {
    display: flex;
}

.uh-live-chat-msg-user {
    justify-content: flex-end;
}

.uh-live-chat-msg-bot {
    justify-content: flex-start;
}

.uh-live-chat-bubble {
    max-width: 88%;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    word-break: break-word;
}

.uh-live-chat-msg-user .uh-live-chat-bubble {
    background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.uh-live-chat-msg-bot .uh-live-chat-bubble {
    background: #fff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.uh-live-chat-msg-loading .uh-live-chat-bubble {
    color: #64748b;
    font-style: italic;
}

.uh-live-chat-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0 1rem 0.65rem;
    background: #f8fafc;
    border-top: 1px solid #eef2f7;
}

.uh-live-chat-chip {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
    cursor: pointer;
    font-family: inherit;
}

.uh-live-chat-chip:hover {
    border-color: #3b82f6;
    color: #1e3a5f;
}

.uh-live-chat-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    padding: 0.75rem;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}

.uh-live-chat-input {
    flex: 1;
    resize: none;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    font-size: 0.88rem;
    font-family: inherit;
    line-height: 1.4;
    min-height: 42px;
    max-height: 120px;
}

.uh-live-chat-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.uh-live-chat-send {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 100%);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.uh-live-chat-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.uh-support-btn {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 12px 14px;
    border-radius: 999px;
    text-decoration: none;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    min-width: 56px;
    overflow: hidden;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    font-family: inherit;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.uh-support-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.uh-support-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    pointer-events: none;
}

.uh-support-label {
    max-width: 0;
    opacity: 0;
    transition: max-width 0.25s ease, opacity 0.2s ease;
    overflow: hidden;
    pointer-events: none;
}

.uh-support-btn:hover .uh-support-label,
.uh-support-btn:focus-visible .uh-support-label {
    max-width: 140px;
    opacity: 1;
}

.uh-support-chat {
    background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 100%);
}

.uh-support-phone {
    background: #334155;
}

.uh-support-pulse {
    position: absolute;
    top: 50%;
    left: 27px;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    z-index: -1;
    animation: uh-support-pulse-anim 2.2s infinite;
    pointer-events: none;
}

.uh-support-pulse-chat {
    background: rgba(59, 130, 246, 0.45);
}

@keyframes uh-support-pulse-anim {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.7; }
    70% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

@media (max-width: 768px) {
    .uh-support-widget {
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        gap: 8px;
    }
    .uh-live-chat-panel {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: calc(132px + env(safe-area-inset-bottom, 0px));
        height: min(65vh, 480px);
    }
    .uh-support-btn { padding: 11px; }
    .uh-support-label { display: none; }
    .uh-support-phone { display: none; }
}

@media (max-width: 768px) {
    body.has-mobile-sticky .uh-support-widget {
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }
    body.has-mobile-sticky .uh-live-chat-panel {
        bottom: calc(196px + env(safe-area-inset-bottom, 0px));
        height: min(58vh, 440px);
    }
}