﻿/* FloatBar 主样式 */
.floatbar-container {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

    .floatbar-container.left-side {
        right: auto;
        left: 0;
    }

        .floatbar-container.left-side .floatbar-content {
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
            border-radius: 0 5px 5px 0;
        }

        .floatbar-container.left-side .floatbar-toggle {
            border-radius: 0 5px 5px 0;
            box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
        }

            .floatbar-container.left-side .floatbar-toggle i {
                transform: rotate(0deg);
            }

        .floatbar-container.left-side.collapsed .floatbar-toggle i {
            transform: rotate(180deg);
        }

/* 主内容区域 */
.floatbar-content {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px 0 0 5px;
    /*overflow: hidden;*/
    width: 150px;
    transition: all 0.3s ease;
}

/* 收缩状态 */
.floatbar-container.collapsed .floatbar-content {
    width: 0;
    opacity: 0;
    visibility: hidden;
}

/* 客服项样式 */
.floatbar-item {
    padding: 15px;
    color: #fff;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    display: flex;
    align-items: center;
}

    .floatbar-item:last-child {
        border-bottom: none;
    }

    .floatbar-item:hover {
        filter: brightness(1.1);
    }

    .floatbar-item i {
        font-size: 24px;
        min-width: 30px;
    }

    .floatbar-item .floatbar-text {
        font-size: 14px;
        margin-left: 10px;
        transition: all 0.3s ease;
    }

/* 各平台颜色 */
.floatbar-whatsapp {
    background-color: #25D366;
}

.floatbar-line {
    background-color: #00C300;
}

.floatbar-email {
    background-color: #EA4335;
}

.floatbar-facebook {
    background-color: #3B5998;
}

.floatbar-phone {
    background-color: #FF5722;
}

.floatbar-skype {
    background-color: #00AFF0;
}

/* 切换按钮 */
.floatbar-toggle {
    background-color: #555;
    color: white;
    width: 40px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 5px 0 0 5px;
    align-self: center;
    transition: all 0.3s ease;
}

    .floatbar-toggle:hover {
        background-color: #444;
    }

    .floatbar-toggle i {
        font-size: 16px;
        transition: transform 0.3s ease;
    }

.floatbar-container.collapsed .floatbar-toggle i {
    transform: rotate(180deg);
}

/*phone*/
.floatbar-phone-number {
    position: absolute;
    right: -100%; /* Start positioned to the right (outside) of the floatbar-content */
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 15px;
    background-color: #FF5722;
    color: white;
    white-space: nowrap;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    min-width: max-content; /* Ensure the phone number doesn't wrap */
    z-index: -1; /* Place behind the main floatbar */
}

.floatbar-phone:hover .floatbar-phone-number {
    right: calc(100% + 5px); /* Slide to the left of the floatbar-content */
    opacity: 1;
}
/* For left-side positioned floatbar (reverse the animation) */
.floatbar-container.left-side .floatbar-phone-number {
    right: auto;
    left: -100%;
}

.floatbar-container.left-side .floatbar-phone:hover .floatbar-phone-number {
    left: calc(100% + 5px);
    right: auto;
}

/* 二维码弹窗 */
.floatbar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.floatbar-modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    max-width: 90%;
    max-height: 90%;
}

.floatbar-modal-title {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
}

.floatbar-modal-image {
    max-width: 100%;
    max-height: 300px;
    margin-bottom: 15px;
}

.floatbar-modal-close {
    background-color: #555;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .floatbar-modal-close:hover {
        background-color: #444;
    }

/* 响应式设计 */
@media (max-width: 768px) {
    .floatbar-container {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        transform: none;
        width: 100%;
        justify-content: flex-end;
    }

        .floatbar-container.left-side {
            justify-content: flex-start;
        }

    .floatbar-content {
        width: 100%;
        flex-direction: row;
        border-radius: 5px 5px 0 0;
        overflow-x: auto;
    }

    .floatbar-item {
        flex: 1;
        min-width: 70px;
        flex-direction: column;
        padding: 10px 5px;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.2);
    }

        .floatbar-item:last-child {
            border-right: none;
        }

        .floatbar-item i {
            font-size: 20px;
            margin-bottom: 5px;
        }

    .floatbar-text {
        font-size: 12px !important;
        margin-left: 0 !important;
    }

    .floatbar-toggle {
        display: none;
    }

    .floatbar-container.collapsed .floatbar-content {
        width: 100%;
        opacity: 1;
        visibility: visible;
    }
}

.floatbar {
    position: fixed;
    z-index: 1000;
    transition: all 0.3s ease;
}
/* Collapsible version */
.floatbar-collapsible {
    /* Your existing styles */
}

    .floatbar-collapsible.collapsed {
        /* Styles for collapsed state */
        transform: translateX(calc(100% - 40px)); /* Adjust based on your toggle width */
    }

    .floatbar-collapsible .floatbar-toggle {
        /* Toggle button styles */
        cursor: pointer;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #333;
        color: white;
    }
/* Static version */
.floatbar-static {
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

    .floatbar-static .floatbar-content {
        width: 85px;
    }

    .floatbar-static .floatbar-item {
        padding: 15px 15px 15px 5px;
        display: flex;
        align-items: center;
        flex-direction: column;
    }
