/**
 * @package     mod_pwwhatsappchat
 * @copyright   Copyright (C) 2026 panky.cz All rights reserved.
 * @license     GNU/GPLv3 or later : http://www.gnu.org/copyleft/gpl.html
 */

#pw-wa-widget,
#pw-wa-widget * {
    box-sizing: border-box;
}

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

#pw-wa-widget.pw-wa-left {
    right: auto;
    left: 20px;
}

#pw-wa-popup {
    position: absolute;
    bottom: 74px;
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .22);
    overflow: hidden;
}

#pw-wa-widget.pw-wa-left #pw-wa-popup {
    right: auto;
    left: 0;
}

.pw-wa-anim {
    animation: pw-wa-slidein .25s ease;
}

@keyframes pw-wa-slidein {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.pw-wa-header {
    background: var(--pw-color);
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.pw-wa-header::after {
    content: '';
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .07);
    bottom: -40px;
    right: -25px;
}

#pw-wa-widget.pw-wa-left .pw-wa-header::after {
    right: auto;
    left: -25px;
}

.pw-wa-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.pw-wa-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .5);
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(0, 0, 0, .15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pw-wa-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pw-wa-initials {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    user-select: none;
    letter-spacing: -.5px;
}

.pw-wa-agent-info {
    flex: 1;
    min-width: 0;
}

.pw-wa-agent-name {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pw-wa-status {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
}

.pw-wa-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pw-wa-dot-online  { background: #4ade80; }
.pw-wa-dot-offline { background: #fbbf24; }

.pw-wa-status-text {
    color: rgba(255, 255, 255, .85);
    font-size: 12px;
}

.pw-wa-availability {
    color: rgba(255, 255, 255, .7);
    font-size: 11px;
    display: block;
    margin-top: 2px;
}

.pw-wa-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    opacity: .75;
    transition: opacity .2s;
    margin-left: 4px;
    flex-shrink: 0;
}

.pw-wa-close-btn:hover { opacity: 1; }

.pw-wa-close-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.pw-wa-body {
    background: #e5ddd5;
    padding: 16px 16px 12px;
}

.pw-wa-bubble {
    background: #fff;
    border-radius: 0 8px 8px 8px;
    padding: 10px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
    display: inline-block;
    max-width: 92%;
    position: relative;
}

.pw-wa-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    border: 8px solid transparent;
    border-top-color: #fff;
    border-right-color: #fff;
}

.pw-wa-greeting {
    margin: 0;
    color: #303030;
    font-size: 14px;
    line-height: 1.5;
}

.pw-wa-footer {
    padding: 12px 16px 14px;
    background: #fff;
}

.pw-wa-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--pw-color);
    color: #fff;
    text-decoration: none;
    padding: 11px 20px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    transition: opacity .2s;
}

.pw-wa-cta:hover {
    opacity: .85;
    color: #fff;
    text-decoration: none;
}

.pw-wa-cta svg {
    width: 20px;
    height: 20px;
    fill: #fff;
    flex-shrink: 0;
}

.pw-wa-btn-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

#pw-wa-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--pw-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .28);
    transition: transform .2s, box-shadow .2s;
    padding: 0;
    z-index: 1;
    overflow: visible;
}

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

#pw-wa-btn svg {
    width: 32px;
    height: 32px;
    fill: #fff;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

#pw-wa-btn.pw-wa-btn-pill {
    border-radius: 30px;
    width: auto;
    padding: 0 20px 0 14px;
    gap: 10px;
}

.pw-wa-btn-text {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

#pw-wa-btn.pw-wa-btn-pill .pw-wa-pulse {
    border-radius: inherit;
}

.pw-wa-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--pw-color);
    opacity: .4;
    animation: pw-wa-pulse 2s ease-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes pw-wa-pulse {
    0%   { transform: scale(1);    opacity: .4; }
    70%  { transform: scale(1.65); opacity: 0; }
    100% { transform: scale(1.65); opacity: 0; }
}

.pw-wa-tooltip {
    position: absolute;
    right: 70px;
    background: #fff;
    color: #333;
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    font-size: 14px;
    pointer-events: none;
}

#pw-wa-widget.pw-wa-left .pw-wa-tooltip {
    right: auto;
    left: 70px;
}
