/**
 * 麦豆助手引导组件样式
 *
 * 包含三部分：
 * 1. 悬浮气泡入口（右下角常驻）
 * 2. 引导弹窗主体
 * 3. 动画效果
 */

/* ============================================================
 * 1. 悬浮气泡入口
 * ============================================================ */

.maidou-bubble {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: maidou-float 3s ease-in-out infinite;
}

.maidou-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(102, 126, 234, 0.5);
}

.maidou-bubble-icon {
    width: 32px;
    height: 32px;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maidou-bubble-icon svg {
    width: 28px;
    height: 28px;
}

/* 红点徽标 */
.maidou-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid white;
    animation: maidou-pulse 2s infinite;
}

.maidou-badge.maidou-badge-number {
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    padding: 0 4px;
    font-size: 11px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* 悬停提示文字 */
.maidou-bubble-tooltip {
    position: absolute;
    right: 64px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.maidou-bubble:hover .maidou-bubble-tooltip {
    opacity: 1;
}


/* ============================================================
 * 2. 引导弹窗主体
 * ============================================================ */

.maidou-panel {
    position: fixed;
    bottom: 100px;
    right: 32px;
    width: 380px;
    max-width: calc(100vw - 64px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    overflow: hidden;
    animation: maidou-slide-up 0.3s ease-out;
}

/* 弹窗头部 */
.maidou-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.maidou-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
}

.maidou-header-title-icon {
    font-size: 20px;
}

.maidou-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
}

.maidou-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 弹窗内容区 */
.maidou-body {
    padding: 20px;
}

.maidou-tip-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 22px;
}

.maidou-tip-icon-wrapper.color-primary {
    background: #ebf4ff;
    color: #3b82f6;
}

.maidou-tip-icon-wrapper.color-secondary {
    background: #f0fdf4;
    color: #22c55e;
}

.maidou-tip-icon-wrapper.color-accent {
    background: #fef3c7;
    color: #f59e0b;
}

.maidou-tip-icon-wrapper.color-warning {
    background: #fff7ed;
    color: #f97316;
}

.maidou-tip-icon-wrapper.color-success {
    background: #f0fdf4;
    color: #16a34a;
}

.maidou-tip-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.maidou-tip-content {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* 进度条 */
.maidou-progress-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.maidou-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 6px;
}

.maidou-progress-bar {
    width: 100%;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
}

.maidou-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* 弹窗底部按钮区 */
.maidou-footer {
    padding: 16px 20px;
    background: #f9fafb;
    display: flex;
    gap: 12px;
    align-items: center;
}

.maidou-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.maidou-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.maidou-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.maidou-btn-secondary {
    background: white;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.maidou-btn-secondary:hover {
    background: #f9fafb;
}

/* 加载状态 */
.maidou-btn-loading {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.maidou-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: maidou-spin 0.8s linear infinite;
    display: inline-block;
}

/* 成功提示 */
.maidou-success-icon {
    color: #16a34a;
    font-size: 18px;
}


/* ============================================================
 * 3. 动画效果
 * ============================================================ */

@keyframes maidou-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes maidou-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes maidou-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes maidou-slide-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes maidou-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 弹窗淡入淡出 */
.maidou-fade-enter-active,
.maidou-fade-leave-active {
    transition: all 0.3s ease;
}

.maidou-fade-enter-from,
.maidou-fade-leave-to {
    opacity: 0;
    transform: translateY(20px);
}


/* ============================================================
 * 4. 响应式适配
 * ============================================================ */

@media (max-width: 640px) {
    .maidou-bubble {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }

    .maidou-bubble-icon {
        width: 26px;
        height: 26px;
    }

    .maidou-panel {
        bottom: 80px;
        right: 20px;
        left: 20px;
        width: auto;
        max-width: none;
    }
}

/* ============================================================
 * 5. 提醒列表样式
 * ============================================================ */

.maidou-alerts-header {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #f59e0b;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.maidou-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.maidou-alert-item {
    background: #f9fafb;
    border-radius: 10px;
    padding: 14px;
    border-left: 3px solid #f59e0b;
    transition: all 0.2s;
}

.maidou-alert-item:hover {
    background: #f3f4f6;
}

.maidou-alert-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.maidou-alert-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.maidou-alert-icon.color-warning {
    background: #fef3c7;
    color: #f59e0b;
}

.maidou-alert-icon.color-danger {
    background: #fee2e2;
    color: #ef4444;
}

.maidou-alert-icon.color-primary {
    background: #ebf4ff;
    color: #3b82f6;
}

.maidou-alert-icon.color-success {
    background: #f0fdf4;
    color: #16a34a;
}

.maidou-alert-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.maidou-alert-content {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 10px;
    white-space: pre-wrap;
}

.maidou-alert-action-btn {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.maidou-alert-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}
