/**
 * 月陆直播平台 - 交互样式
 */

/* Toast 提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success { background: linear-gradient(135deg, #10b981, #059669); }
.toast-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.toast-info { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.toast-error { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* 按钮点击效果 */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn:active::after {
    width: 200px;
    height: 200px;
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* 直播卡片特殊效果 */
.live-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.live-card:hover {
    transform: translateY(-5px);
}

.live-card:hover .live-cover img {
    transform: scale(1.05);
}

/* 礼物点击动画 */
.gift-item {
    cursor: pointer;
    transition: transform 0.2s;
}

.gift-item:hover {
    transform: scale(1.1);
}

.gift-item:active {
    transform: scale(0.95);
}

/* 关注按钮状态 */
.btn-follow {
    transition: all 0.3s;
}

.btn-follow.following {
    background-color: #6c757d;
    border-color: #6c757d;
}

/* 点赞动画 */
.like-btn {
    transition: all 0.3s;
}

.like-btn.liked {
    animation: likeAnimation 0.5s ease;
}

@keyframes likeAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Tab 切换动画 */
.tab-pane {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.tab-pane.show.active {
    opacity: 1;
    transform: translateY(0);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    margin: 50px auto;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* 消息未读标记 */
.message-item {
    position: relative;
    transition: background-color 0.2s;
}

.message-item.unread {
    background-color: #f0f9ff;
}

.message-item.unread::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

/* 搜索建议下拉 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-suggestions.show {
    display: block;
}

.search-suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-suggestion-item:hover {
    background-color: #f3f4f6;
}

/* 充值金额选择 */
.recharge-amount {
    cursor: pointer;
    border: 2px solid #e5e7eb;
    transition: all 0.3s;
}

.recharge-amount.active {
    border-color: #4f46e5;
    background: #eef2ff;
}

/* 支付方式选择 */
.pay-method {
    cursor: pointer;
    border: 2px solid #e5e7eb;
    transition: all 0.3s;
}

.pay-method.active {
    border-color: #4f46e5;
    background: #eef2ff;
}

.pay-method.active::after {
    content: '\2713';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #4f46e5;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* 弹幕输入框 */
.danmu-input-group {
    position: relative;
}

.danmu-input-group input:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 弹幕动画 */
.danmu-item {
    animation: danmuSlide 10s linear forwards;
}

@keyframes danmuSlide {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(-100%);
    }
}

/* VIP卡片悬停 */
.vip-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.vip-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.vip-card.selected {
    border: 2px solid #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f4f6;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 图片上传预览 */
.upload-preview {
    width: 100px;
    height: 100px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
}

.upload-preview:hover {
    border-color: #4f46e5;
    background: #f9fafb;
}

.upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 工具提示 */
.tooltip-custom {
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.tooltip-custom::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}
