/* 通用悬浮球控件样式 */

.floating-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.floating-widget-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    position: relative;
}

.floating-widget-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.floating-widget-toggle:active {
    transform: scale(0.95);
}

.floating-widget-toggle.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 20px rgba(240, 147, 251, 0.4);
}

.floating-widget-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 400px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    z-index: 999;
}

.floating-widget-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.floating-widget-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.floating-widget-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.floating-widget-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.floating-widget-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.floating-widget-content {
    width: 100%;
    height: calc(100% - 60px);
    overflow: hidden;
}

.floating-widget-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .floating-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .floating-widget-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .floating-widget-window {
        bottom: 75px;
        right: 15px;
        width: calc(100vw - 30px);
        height: 60vh;
        max-width: 350px;
    }
}

@media (max-width: 480px) {
    .floating-widget-window {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
        height: 70vh;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.8);
    }
    100% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
}

.floating-widget-toggle.pulse {
    animation: pulse 2s infinite;
}

/* 自定义主题支持 */
.floating-widget.theme-game .floating-widget-toggle {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    box-shadow: 0 4px 20px rgba(255, 154, 158, 0.4);
}

.floating-widget.theme-game .floating-widget-toggle:hover {
    box-shadow: 0 6px 25px rgba(255, 154, 158, 0.6);
}

.floating-widget.theme-game .floating-widget-window .floating-widget-header {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
}

.floating-widget.theme-chat .floating-widget-toggle {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    box-shadow: 0 4px 20px rgba(132, 250, 176, 0.4);
}

.floating-widget.theme-chat .floating-widget-toggle:hover {
    box-shadow: 0 6px 25px rgba(132, 250, 176, 0.6);
}

.floating-widget.theme-chat .floating-widget-window .floating-widget-header {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}
