.bilgibi-wa {
    position: fixed;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.bilgibi-wa__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 10px;
    border: 0;
    text-decoration: none;
    cursor: pointer;
    padding: 12px 14px;
    border-radius: var(--wa-radius);
    background: var(--wa-bg);
    color: var(--wa-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    animation: bilgibi-wa-gentle-float 1.8s ease-in-out infinite;
}

.bilgibi-wa__trigger::before,
.bilgibi-wa__trigger::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    border: 2px solid color-mix(in srgb, var(--wa-bg) 70%, #ffffff 30%);
    opacity: 0;
    pointer-events: none;
}

.bilgibi-wa__trigger::before {
    animation: bilgibi-wa-ripple 2s ease-out infinite;
}

.bilgibi-wa__trigger::after {
    animation: bilgibi-wa-ripple 2s ease-out 0.8s infinite;
}

.bilgibi-wa[data-layout="icon-only"] .bilgibi-wa__trigger {
    width: 52px;
    height: 52px;
    padding: 0;
}

.bilgibi-wa__trigger:hover,
.bilgibi-wa__trigger:focus {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
    color: var(--wa-color);
}

.bilgibi-wa__icon {
    display: block;
    width: 22px;
    height: 22px;
    color: currentColor;
    animation: bilgibi-wa-icon-breathe 1.8s ease-in-out infinite;
}

.bilgibi-wa__button-text {
    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;
}

.bilgibi-wa__close-icon {
    display: none;
    font-size: 32px;
    line-height: 1;
    font-weight: 300;
}

.bilgibi-wa[data-contact-box="1"] .bilgibi-wa__trigger {
    width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 999px;
}

.bilgibi-wa[data-contact-box="1"] .bilgibi-wa__button-text {
    display: none;
}

.bilgibi-wa.is-open .bilgibi-wa__trigger > .bilgibi-wa__icon {
    display: none;
}

.bilgibi-wa.is-open .bilgibi-wa__close-icon {
    display: block;
}

.bilgibi-wa.is-open .bilgibi-wa__trigger::before,
.bilgibi-wa.is-open .bilgibi-wa__trigger::after {
    animation: none;
}

.bilgibi-wa__box {
    width: min(370px, calc(100vw - 28px));
    border-radius: 14px;
    background: #ffffff;
    color: #4b5563;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.bilgibi-wa__box-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 18px 16px;
    background: var(--wa-bg);
    color: #fff;
}

.bilgibi-wa__box-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.bilgibi-wa__box-header-icon .bilgibi-wa__icon {
    animation: none;
    width: 28px;
    height: 28px;
}

.bilgibi-wa__box-title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 0.92);
}

.bilgibi-wa__box-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.92);
}

.bilgibi-wa__box-body {
    padding: 12px;
    background: #f8fafc;
}

.bilgibi-wa__reply-time {
    margin: 2px 8px 10px;
    color: #9ca3af;
    font-size: 12px;
}

.bilgibi-wa__agent {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 2px;
    padding: 10px 12px 10px 10px;
    border-radius: 12px;
    text-decoration: none;
    background: #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.bilgibi-wa__agent:hover,
.bilgibi-wa__agent:focus {
    text-decoration: none;
    border-color: color-mix(in srgb, var(--wa-bg) 35%, #d1d5db 65%);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.bilgibi-wa__agent-avatar {
    width: 44px;
    height: 44px;
    object-fit: cover;
    flex: 0 0 44px;
}

.bilgibi-wa__agent-avatar--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--wa-bg);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.bilgibi-wa__agent-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.bilgibi-wa__agent-name {
    color: #374151;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.bilgibi-wa__agent-role {
    margin-top: 2px;
    color: #6b7280;
    font-size: 13px;
}

.bilgibi-wa__agent-icon .bilgibi-wa__icon {
    width: 24px;
    height: 24px;
    animation: none;
    color: var(--wa-bg);
}

.bilgibi-wa__cta {
    display: inline-block;
    text-decoration: none;
    border-radius: calc(var(--wa-box-radius) - 4px);
    padding: 10px 14px;
    background: var(--wa-bg);
    color: var(--wa-color);
    font-size: 14px;
    font-weight: 600;
}

.bilgibi-wa__cta:hover,
.bilgibi-wa__cta:focus {
    color: var(--wa-color);
    opacity: 0.92;
}

@keyframes bilgibi-wa-gentle-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes bilgibi-wa-icon-breathe {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

@keyframes bilgibi-wa-ripple {
    0% {
        transform: scale(1);
        opacity: 0;
    }
    20% {
        opacity: 0.4;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bilgibi-wa__trigger,
    .bilgibi-wa__icon,
    .bilgibi-wa__trigger::before,
    .bilgibi-wa__trigger::after {
        animation: none;
    }
}
