/* T&K WhatsApp Widget */

#tk-wa-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Floating Button */
.tk-wa-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: white;
    position: relative;
    z-index: 2;
}

.tk-wa-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.tk-wa-btn svg {
    transition: opacity 0.2s ease;
}

/* Pulse animation */
.tk-wa-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #25D366;
    animation: tk-wa-pulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes tk-wa-pulse {
    0% { transform: scale(1); opacity: 0.5; }
    70% { transform: scale(1.3); opacity: 0; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* Chat Window */
.tk-wa-chat {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 48px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: bottom right;
}

.tk-wa-chat.tk-wa-hidden {
    opacity: 0;
    transform: scale(0.85) translateY(10px);
    pointer-events: none;
}

.tk-wa-chat.tk-wa-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

/* Header */
.tk-wa-header {
    background: #075E54;
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tk-wa-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tk-wa-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.tk-wa-header-text {
    display: flex;
    flex-direction: column;
}

.tk-wa-name {
    font-weight: 600;
    font-size: 15px;
}

.tk-wa-status {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

.tk-wa-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.tk-wa-close:hover {
    opacity: 1;
}

/* Chat Body */
.tk-wa-body {
    background: #E5DDD5;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c8bfb0' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    padding: 20px;
    min-height: 120px;
}

.tk-wa-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 0 12px 12px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #303030;
    max-width: 85%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    position: relative;
}

.tk-wa-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid white;
    border-left: 8px solid transparent;
}

/* Name Input */
.tk-wa-name-input-wrap {
    margin-top: 12px;
}

.tk-wa-name-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.tk-wa-name-input:focus {
    border-color: #25D366;
}

.tk-wa-name-input::placeholder {
    color: #999;
}

/* Footer */
.tk-wa-footer {
    background: #F0F0F0;
    padding: 16px 20px;
}

.tk-wa-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: #25D366;
    color: white !important;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.2s;
}

.tk-wa-send-btn:hover {
    background: #1da851;
    color: white !important;
    text-decoration: none !important;
}

.tk-wa-send-btn svg {
    flex-shrink: 0;
}

/* Hidden utility */
.tk-wa-hidden {
    display: none !important;
}

/* But override for chat animation */
.tk-wa-chat.tk-wa-hidden {
    display: block !important;
}

/* Mobile */
@media (max-width: 480px) {
    #tk-wa-widget {
        bottom: 16px;
        right: 16px;
    }

    .tk-wa-btn {
        width: 54px;
        height: 54px;
    }

    .tk-wa-btn svg {
        width: 24px;
        height: 24px;
    }

    .tk-wa-chat {
        bottom: 70px;
        right: -8px;
        width: calc(100vw - 32px);
    }
}
