/* ==========================================================================
   KÖPÜK BALONCUĞU ADAM (BUBBLE ASSISTANT) — WhatsApp yardım widget'ı
   ========================================================================== */

#bubble-assistant-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 90000; /* header (50) üstünde, açılış animasyonu (999999) altında */
    font-family: "Poppins", "Segoe UI", Tahoma, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

.bubble-mascot-wrapper {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.bubble-mascot-wrapper:hover { transform: scale(1.08); }

.bubble-speech-tooltip {
    position: absolute;
    bottom: 105%;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #1a365d;
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 150, 255, 0.2), 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 1.5px solid rgba(186, 230, 253, 0.8);
    animation: tooltipFloat 3s ease-in-out infinite;
    pointer-events: none;
}
.bubble-speech-tooltip::after {
    content: '';
    position: absolute;
    bottom: -7px;
    right: 30px;
    width: 0; height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid rgba(255, 255, 255, 0.95);
}

.bubble-mascot-svg {
    width: 95px;
    height: 95px;
    filter: drop-shadow(0 10px 20px rgba(0, 140, 255, 0.35));
    animation: mascotBounce 3.5s ease-in-out infinite;
}
.anim-wipe { transform-origin: 65px 55px; animation: wipeHand 2.2s ease-in-out infinite alternate; }
.anim-sparkle { transform-origin: center; animation: sparkleRotate 3s linear infinite; }
.anim-eye { transform-origin: center; animation: eyeBlink 4s infinite; }
.anim-foam-bubble { animation: foamRise 2.8s ease-in-out infinite alternate; }
.anim-foam-bubble-2 { animation: foamRise 3.5s ease-in-out infinite alternate-reverse; }

.bubble-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #ffffff;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: bold;
    box-shadow: 0 0 0 3px #ffffff, 0 4px 10px rgba(37, 211, 102, 0.4);
    animation: badgePulse 2s infinite;
}

.bubble-popup-window {
    position: absolute;
    bottom: 110px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 100, 200, 0.22), 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(224, 242, 254, 0.9);
    overflow: hidden;
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.bubble-popup-window.active { display: flex; opacity: 1; transform: translateY(0) scale(1); }

.bubble-popup-header {
    background: linear-gradient(135deg, #0ea5e9, #0284c7, #25D366);
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
    padding: 16px 20px;
    color: white;
    display: flex; align-items: center; justify-content: space-between;
}
.bubble-header-info { display: flex; align-items: center; gap: 12px; }
.bubble-header-avatar {
    width: 44px; height: 44px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    padding: 4px;
    box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.4);
}
.bubble-header-text h4 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: 0.3px; }
.bubble-status-online { font-size: 12px; opacity: 0.92; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.bubble-status-dot { width: 8px; height: 8px; background-color: #4ade80; border-radius: 50%; box-shadow: 0 0 8px #4ade80; }
.bubble-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none; color: white;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s ease;
}
.bubble-close-btn:hover { background: rgba(255, 255, 255, 0.35); }

.bubble-popup-body {
    padding: 20px;
    max-height: 420px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 15px;
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
}
.bubble-chat-msg { display: flex; gap: 10px; align-items: flex-start; }
.bubble-chat-bubble {
    background: #ffffff; color: #1e293b;
    padding: 12px 16px;
    border-radius: 18px;
    border-top-left-radius: 4px;
    font-size: 13.5px; line-height: 1.5;
    box-shadow: 0 3px 12px rgba(0, 140, 255, 0.08);
    border: 1px solid #e0f2fe;
}
.bubble-chat-form { display: flex; flex-direction: column; gap: 10px; margin-top: 5px; }
.bubble-input-group { display: flex; flex-direction: column; gap: 4px; }
.bubble-input-group label {
    font-size: 11.5px; font-weight: 600; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.bubble-input-field {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    font: inherit;
    font-size: 16px; /* iOS Safari input odaklanınca otomatik yakınlaştırma yapmasın */
    color: #0f172a;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}
.bubble-input-field:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15); }
textarea.bubble-input-field { resize: none; min-height: 70px; }

.bubble-send-btn {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white; border: none;
    padding: 12px 18px;
    border-radius: 14px;
    font: inherit; font-size: 14px; font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 6px;
}
.bubble-send-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37, 211, 102, 0.45); }
.bubble-send-btn:active { transform: translateY(0); }
.bubble-send-btn:disabled { opacity: .7; cursor: default; transform: none; }
.bubble-send-btn svg { width: 18px; height: 18px; fill: currentColor; }

.bubble-footer-note {
    text-align: center; font-size: 11px; color: #94a3b8; margin-top: 4px;
    display: flex; align-items: center; justify-content: center; gap: 4px;
}
.bubble-response-box { display: none; padding: 12px; border-radius: 12px; font-size: 13px; text-align: center; font-weight: 600; }
.bubble-response-box.success { display: block; background-color: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.bubble-response-box.error { display: block; background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.bubble-hp { position: absolute; left: -9999px; }

@keyframes mascotBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(-3deg); }
    50% { transform: translateY(-4px) rotate(2deg); }
    75% { transform: translateY(-10px) rotate(-1deg); }
}
@keyframes tooltipFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes wipeHand { 0% { transform: rotate(-15deg) translate(-2px, 2px); } 100% { transform: rotate(20deg) translate(5px, -3px); } }
@keyframes sparkleRotate {
    0% { transform: rotate(0deg) scale(0.9); opacity: 0.7; }
    50% { transform: rotate(180deg) scale(1.2); opacity: 1; }
    100% { transform: rotate(360deg) scale(0.9); opacity: 0.7; }
}
@keyframes eyeBlink { 0%, 94%, 98%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
@keyframes foamRise { 0% { transform: translateY(0) scale(1); opacity: 0.8; } 100% { transform: translateY(-6px) scale(1.15); opacity: 1; } }
@keyframes badgePulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

@media (max-width: 480px) {
    #bubble-assistant-container { bottom: 15px; right: 15px; }
    .bubble-popup-window { right: 0; width: calc(100vw - 30px); bottom: 95px; }
    .bubble-mascot-svg { width: 78px; height: 78px; }
}
@media (prefers-reduced-motion: reduce) {
    .bubble-mascot-svg, .anim-wipe, .anim-sparkle, .anim-eye,
    .anim-foam-bubble, .anim-foam-bubble-2, .bubble-badge,
    .bubble-speech-tooltip, .bubble-popup-header { animation: none; }
}
