/* 莹虹商贸客服小工具样式 */
.yhsm-cs-widget {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

/* 状态指示器 */
.widget-status {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-online { background: #28a745; }
.status-offline { background: #6c757d; }
.status-busy { background: #ffc107; }

.status-text {
    font-weight: 600;
    font-size: 14px;
}

/* 联系渠道 */
.widget-channels {
    padding: 15px 0;
}

.channel-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.3s;
    border-bottom: 1px solid #f8f9fa;
}

.channel-item:hover {
    background: #f8f9fa;
}

.channel-item:last-child {
    border-bottom: none;
}

.channel-icon {
    font-size: 24px;
    margin-right: 15px;
    width: 40px;
    text-align: center;
}

.channel-info {
    flex: 1;
}

.channel-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.channel-desc {
    font-size: 12px;
    color: #666;
}

/* 工作时间 */
.widget-work-hours {
    padding: 12px 20px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #666;
}

.hours-icon {
    font-size: 14px;
}

/* 快速操作 */
.widget-actions {
    padding: 15px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.widget-action-btn {
    padding: 8px 12px;
    border: 1px solid #007cba;
    background: white;
    color: #007cba;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    text-align: center;
}

.widget-action-btn:hover {
    background: #007cba;
    color: white;
}

/* 不同样式变体 */
.yhsm-widget-compact {
    font-size: 13px;
}

.yhsm-widget-compact .channel-item {
    padding: 8px 15px;
}

.yhsm-widget-compact .channel-icon {
    font-size: 20px;
    width: 30px;
}

.yhsm-widget-compact .widget-actions {
    padding: 10px 15px;
}

.yhsm-widget-minimal {
    background: transparent;
    box-shadow: none;
    border: 1px solid #e9ecef;
}

.yhsm-widget-minimal .widget-status {
    background: #f8f9fa;
    color: #333;
}

.yhsm-widget-minimal .channel-item {
    border-bottom: 1px solid #e9ecef;
}

/* 左侧中部固定样式 */
.yhsm-widget-fixed-left {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    width: 260px;
    margin: 0;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.yhsm-widget-fixed-left:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

/* 简化版本的固定侧边小工具 */
.yhsm-widget-mini-fixed-left {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.yhsm-widget-mini-fixed-left:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 25px rgba(0,0,0,0.3);
}

/* 弹窗样式 */
.yhsm-widget-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.yhsm-widget-modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .yhsm-widget-modal {
        padding: 10px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .widget-actions {
        grid-template-columns: 1fr;
    }
    
    /* 移动设备上的固定小工具调整 */
    .yhsm-widget-fixed-left {
        left: 10px;
        width: 240px;
        transform: translateY(-50%) scale(0.9);
    }
    
    /* 在非常小的屏幕上隐藏完整小工具，只显示迷你按钮 */
    @media (max-width: 480px) {
        .yhsm-widget-fixed-left {
            display: none;
        }
        
        /* 移动设备上的迷你按钮调整为底部固定 */
        .yhsm-widget-mini-fixed-left {
            left: 50%;
            bottom: 30px;
            top: auto;
            transform: translateX(-50%);
        }
    }
}

/* 小工具内的聊天界面 */
.widget-chat-container {
    height: 300px;
    display: flex;
    flex-direction: column;
}

.widget-chat-messages {
    flex: 1;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow-y: auto;
    max-height: 200px;
}

.widget-chat-input {
    display: flex;
    gap: 10px;
}

.widget-chat-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
}

.widget-chat-input button {
    padding: 8px 15px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

/* 通知样式 */
.widget-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10001;
    max-width: 350px;
    animation: slideInRight 0.3s ease;
}

.widget-notification-info {
    background: #007cba;
    color: white;
}

.widget-notification-success {
    background: #28a745;
    color: white;
}

.widget-notification-error {
    background: #dc3545;
    color: white;
}

.widget-notification-warning {
    background: #ffc107;
    color: #333;
}

.notification-content {
    font-size: 14px;
    line-height: 1.5;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
