/* WhatsApp destek chatbot — renk/konum: #wa-chatbot-wrapper (--wa-*) */

#wa-chatbot-wrapper {
    position: fixed;
    bottom: 20px;
    z-index: 1088;
    font-family: system-ui, -apple-system, sans-serif;
    --wa-primary: #25d366;
    --wa-bg: #ffffff;
    --wa-text: #1e3a5f;
}

#wa-chatbot-wrapper.wa-chatbot--pos-left {
    left: 20px;
    right: auto;
}

#wa-chatbot-wrapper.wa-chatbot--pos-right {
    right: 20px;
    left: auto;
}

html.fmh-menu-open #wa-chatbot-wrapper {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

@media (max-width: 767.98px) {
    #wa-chatbot-wrapper {
        bottom: calc(4rem + 15px) !important;
        z-index: 1090;
    }
    #wa-chatbot-wrapper.wa-chatbot--hide-mobile {
        display: none !important;
    }
    .wa-proactive-bubble,
    .wa-proactive-bubble.is-visible {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

@media (min-width: 768px) {
    #wa-chatbot-wrapper.wa-chatbot--hide-desktop {
        display: none !important;
    }
}

.wa-float-btn {
    width: 60px;
    height: 60px;
    background-color: var(--wa-primary);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.3s ease;
    border: none;
    outline: none;
    position: absolute;
    bottom: 0;
}

.wa-chatbot--pos-left .wa-float-btn {
    left: 0;
    right: auto;
}

.wa-chatbot--pos-right .wa-float-btn {
    right: 0;
    left: auto;
}

.wa-float-btn:hover {
    transform: scale(1.08);
}

.wa-float-btn svg {
    width: 34px;
    height: 34px;
    fill: currentColor;
}

.wa-float-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--wa-primary);
    opacity: 0.6;
    animation: wa-pulse 2s infinite;
    z-index: -1;
}

@keyframes wa-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.wa-chat-window {
    position: absolute;
    bottom: 80px;
    width: 350px;
    max-width: calc(100vw - 40px);
    background: var(--wa-bg);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wa-chatbot--pos-left .wa-chat-window,
.wa-chatbot--pos-left .wa-proactive-bubble {
    left: 0;
    right: auto;
}

.wa-chatbot--pos-right .wa-chat-window,
.wa-chatbot--pos-right .wa-proactive-bubble {
    right: 0;
    left: auto;
}

.wa-chat-window.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.wa-chat-header {
    background: var(--wa-primary);
    color: #fff;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wa-header-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #fff;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.wa-header-avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wa-primary);
    font-size: 24px;
}

.wa-header-info {
    flex: 1;
}

.wa-header-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.wa-header-status {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wa-status-dot {
    width: 8px;
    height: 8px;
    background: #4cdc6a;
    border-radius: 50%;
}

.wa-status-dot.offline {
    background: #ff4757;
}

.wa-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
}

.wa-close-btn:hover {
    opacity: 1;
}

.wa-chat-body {
    height: 380px;
    padding: 16px;
    overflow-y: auto;
    background: #edece9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wa-chat-body::-webkit-scrollbar {
    width: 6px;
}

.wa-chat-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.wa-msg {
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wa-msg--bot {
    align-self: flex-start;
    background: var(--wa-bg);
    color: var(--wa-text);
    border-top-left-radius: 0;
}

.wa-msg--user {
    align-self: flex-end;
    background: #dcf8c6;
    color: #111;
    border-top-right-radius: 0;
}

.wa-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.wa-chip {
    background: #fff;
    border: 1px solid var(--wa-primary);
    color: var(--wa-primary);
    padding: 10px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.wa-chip:hover {
    background: var(--wa-primary);
    color: #fff;
}

.wa-typing {
    display: flex;
    gap: 4px;
    padding: 14px;
    align-self: flex-start;
    background: var(--wa-bg);
    border-radius: 12px;
    border-top-left-radius: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wa-typing span {
    width: 6px;
    height: 6px;
    background: #aebac1;
    border-radius: 50%;
    animation: wa-bounce 1.4s infinite ease-in-out both;
}

.wa-typing span:nth-child(1) {
    animation-delay: -0.32s;
}

.wa-typing span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes wa-bounce {
    0%,
    80%,
    100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.wa-form {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wa-input {
    width: 100%;
    border: 1px solid #d1d5db;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
}

.wa-input:focus {
    outline: none;
    border-color: var(--wa-primary);
}

.wa-submit {
    background: var(--wa-primary);
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.wa-submit:hover {
    opacity: 0.9;
}

.wa-error-msg {
    color: red;
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

.wa-form-success {
    color: #28a745;
    font-weight: bold;
}

.wa-proactive-bubble {
    position: absolute;
    bottom: 80px;
    background: #fff;
    color: #333;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
    pointer-events: none;
    z-index: 1040;
}

.wa-proactive-bubble.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.wa-chatbot--pos-left .wa-proactive-bubble::after {
    left: 20px;
    right: auto;
}

.wa-chatbot--pos-right .wa-proactive-bubble::after {
    right: 20px;
    left: auto;
}

.wa-proactive-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
}

.wa-float-status {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--wa-primary);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

.wa-float-status.online {
    background: #4cdc6a;
}

.wa-float-status.offline {
    background: #ff4757;
}

.wa-chip-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wa-chip-icon {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    object-fit: cover;
}
