/* WhatsApp Support - Public Styles */

.wsp-widget-wrapper {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 悬浮按钮 */
.wsp-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #25D366;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
    padding: 0;
    z-index: 1000000;
}

.wsp-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.wsp-fab:active {
    transform: scale(0.95);
}

.wsp-fab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 离线状态的悬浮按钮 */
.wsp-fab.wsp-offline {
    background-color: #9e9e9e !important;
}

.wsp-fab.wsp-offline .wsp-fab-pulse {
    display: none;
}

/* 脉冲动画 */
.wsp-fab-pulse {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background-color: inherit;
    opacity: 0.5;
    z-index: -1;
    animation: wsp-pulse 2s infinite;
}

@keyframes wsp-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    70% {
        transform: scale(1.5);
        opacity: 0;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 悬浮面板 */
.wsp-panel {
    position: fixed;
    bottom: 95px;
    right: 20px;
    width: 320px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px) scale(0.95);
    transform-origin: bottom right;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 999999;
}

.wsp-panel.wsp-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.wsp-panel.wsp-position-left {
    transform-origin: bottom left;
}

/* 面板头部 */
.wsp-panel-header {
    background-color: #25D366;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wsp-panel-header-content {
    flex: 1;
}

.wsp-panel-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 2px 0;
}

.wsp-panel-subtitle {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

.wsp-panel-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
    margin-left: 12px;
}

.wsp-panel-close:hover {
    opacity: 1;
}

/* 面板主体 */
.wsp-panel-body {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.wsp-welcome {
    font-size: 14px;
    color: #666;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* 离线提示 */
.wsp-offline-notice {
    font-size: 13px;
    color: #e65100;
    background-color: #fff3e0;
    border-left: 3px solid #ff9800;
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* 客服列表 */
.wsp-agents-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wsp-agent-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
    gap: 12px;
}

.wsp-agent-item:hover {
    background-color: #f0fdf4;
}

.wsp-agent-item.wsp-agent-offline {
    opacity: 0.6;
}

.wsp-agent-avatar {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e0e0e0;
    overflow: hidden;
}

.wsp-agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wsp-avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #25D366;
    color: #fff;
    font-weight: 600;
    font-size: 18px;
}

.wsp-status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.wsp-status-dot.wsp-status-online {
    background: #4caf50;
}

.wsp-status-dot.wsp-status-offline {
    background: #9e9e9e;
}

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

.wsp-agent-name {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wsp-agent-title {
    font-size: 12px;
    color: #888;
    margin: 0 0 2px 0;
}

.wsp-agent-status {
    font-size: 11px;
    color: #4caf50;
    font-weight: 500;
}

.wsp-agent-offline .wsp-agent-status {
    color: #9e9e9e;
}

.wsp-agent-icon {
    flex-shrink: 0;
    color: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wsp-agent-item.wsp-type-email .wsp-agent-icon {
    color: #1565c0;
}

/* 面板底部 */
.wsp-panel-footer {
    padding: 10px 16px;
    border-top: 1px solid #eee;
    text-align: center;
}

.wsp-powered-by {
    font-size: 11px;
    color: #aaa;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .wsp-panel {
        width: calc(100vw - 32px);
    }
}
